Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added minimal style checks: licence header, file length, illegal imports

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk@1425284 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit bf40506949d422eac7753bbd6a00658195175ec6 1 parent 7ae0401
@ok2c ok2c authored
Showing with 183 additions and 106 deletions.
  1. +26 −0 asl2.header
  2. +44 −0 hc-checkstyle.xml
  3. +0 −3  httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java
  4. +1 −1  httpcore-nio/src/test/java/org/apache/http/impl/nio/TestContentChannel.java
  5. +0 −2  httpcore/src/main/java/org/apache/http/HttpEntityEnclosingRequest.java
  6. +14 −13 httpcore/src/main/java/org/apache/http/annotation/GuardedBy.java
  7. +14 −13 httpcore/src/main/java/org/apache/http/annotation/Immutable.java
  8. +14 −13 httpcore/src/main/java/org/apache/http/annotation/NotThreadSafe.java
  9. +14 −13 httpcore/src/main/java/org/apache/http/annotation/ThreadSafe.java
  10. +1 −1  httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
  11. +14 −14 httpcore/src/main/java/org/apache/http/pool/PoolEntryFuture.java
  12. +14 −14 httpcore/src/main/java/org/apache/http/pool/RouteSpecificPool.java
  13. +1 −1  httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
  14. +0 −1  httpcore/src/test/java/org/apache/http/entity/TestContentType.java
  15. +0 −5 httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java
  16. +0 −1  httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
  17. +0 −1  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java
  18. +0 −1  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderIterator.java
  19. +0 −3  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java
  20. +0 −3  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java
  21. +0 −3  httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java
  22. +26 −0 pom.xml
View
26 asl2.header
@@ -0,0 +1,26 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
View
44 hc-checkstyle.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<module name="Checker">
+ <module name="TreeWalker">
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport" />
+ <module name="RedundantImport" />
+ </module>
+ <module name="Header">
+ <property name="headerFile" value="asl2.header" />
+ </module>
+ <module name="FileLength">
+ <property name="max" value="3000" />
+ </module>
+ <!--<module name="FileTabCharacter">
+ <property name="eachLine" value="true"/>
+ </module>
+ <module name="RegexpSingleline">
+ <property name="format" value="[ \t]+$"/>
+ <property name="message" value="Trailing whitespace"/>
+ </module>
+ -->
+</module>
View
3  httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java
@@ -1,6 +1,4 @@
/*
- * $Date:
- *
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -26,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.nio.reactor;
/**
View
2  httpcore-nio/src/test/java/org/apache/http/impl/nio/TestContentChannel.java
@@ -26,9 +26,9 @@
*/
package org.apache.http.impl.nio;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.junit.Assert.*;
import java.nio.ByteBuffer;
View
2  httpcore/src/main/java/org/apache/http/HttpEntityEnclosingRequest.java
@@ -1,5 +1,4 @@
/*
- * $Header: $
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -25,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http;
/**
View
27 httpcore/src/main/java/org/apache/http/annotation/GuardedBy.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
View
27 httpcore/src/main/java/org/apache/http/annotation/Immutable.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
View
27 httpcore/src/main/java/org/apache/http/annotation/NotThreadSafe.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
View
27 httpcore/src/main/java/org/apache/http/annotation/ThreadSafe.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
View
2  httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java
@@ -22,8 +22,8 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
+ *
*/
-
package org.apache.http.params;
import org.apache.http.annotation.ThreadSafe;
View
28 httpcore/src/main/java/org/apache/http/pool/PoolEntryFuture.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
@@ -23,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.pool;
import java.io.IOException;
View
28 httpcore/src/main/java/org/apache/http/pool/RouteSpecificPool.java
@@ -1,20 +1,21 @@
/*
* ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
@@ -23,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.pool;
import java.util.HashSet;
View
2  httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
@@ -22,8 +22,8 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
+ *
*/
-
package org.apache.http.protocol;
import java.io.IOException;
View
1  httpcore/src/test/java/org/apache/http/entity/TestContentType.java
@@ -31,7 +31,6 @@
import org.apache.http.Header;
import org.apache.http.ParseException;
-import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.BasicHeader;
import org.junit.Assert;
import org.junit.Test;
View
5 httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java
@@ -1,8 +1,4 @@
/*
- * $HeadURL$
- * $Revision$
- * $Date$
- *
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -28,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.impl.io;
import java.io.InterruptedIOException;
View
1  httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
@@ -24,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.message;
import org.apache.http.Header;
View
1  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java
@@ -24,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.message;
import java.util.NoSuchElementException;
View
1  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderIterator.java
@@ -24,7 +24,6 @@
* <http://www.apache.org/>.
*
*/
-
package org.apache.http.message;
import java.util.NoSuchElementException;
View
3  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java
@@ -23,10 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * [Additional notices, if required by prior licensing conditions]
- *
*/
-
package org.apache.http.message;
import org.apache.http.HeaderElement;
View
3  httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java
@@ -23,10 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * [Additional notices, if required by prior licensing conditions]
- *
*/
-
package org.apache.http.message;
import org.apache.http.HeaderElement;
View
3  httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java
@@ -1,5 +1,4 @@
/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/test/org/apache/commons/httpclient/TestHeaderElement.java,v 1.7 2004/02/22 18:08:49 olegk Exp $
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,8 +23,6 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- * [Additional notices, if required by prior licensing conditions]
- *
*/
package org.apache.http.message;
View
26 pom.xml
@@ -280,6 +280,32 @@
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.9.1</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ <executions>
+ <execution>
+ <id>validate</id>
+ <phase>validate</phase>
+ <configuration>
+ <configLocation>hc-checkstyle.xml</configLocation>
+ <consoleOutput>true</consoleOutput>
+ <failsOnError>true</failsOnError>
+ <linkXRef>false</linkXRef>
+ <sourceDirectory>${basedir}/src</sourceDirectory>
+ </configuration>
+ <goals>
+ <goal>checkstyle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
Please sign in to comment.
Something went wrong with that request. Please try again.