Skip to content

Commit

Permalink
Minimal changes to build successfully with Java 8, plus optional prof…
Browse files Browse the repository at this point in the history
…ile to enable it
  • Loading branch information
srowen committed Mar 25, 2014
1 parent 4fb569c commit fabd9f6
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class InactivityTimer {
private final Activity activity;
private final BroadcastReceiver powerStatusReceiver;
private boolean registered;
private AsyncTask<?,?,?> inactivityTask;
private AsyncTask<Object,Object,Object> inactivityTask;

InactivityTimer(Activity activity) {
this.activity = activity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
import android.widget.Adapter;
import android.widget.ListView;

import java.util.List;

public final class AppPickerActivity extends ListActivity {

private AsyncTask<?,?,?> backgroundTask;
private AsyncTask<Object,Object,List<AppInfo>> backgroundTask;

@Override
protected void onResume() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class BenchmarkActivity extends Activity {

private View runBenchmarkButton;
private TextView textView;
private AsyncTask<?,?,?> benchmarkTask;
private AsyncTask<Object,Object,String> benchmarkTask;

private final View.OnClickListener runBenchmark = new View.OnClickListener() {
@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/google/zxing/Binarizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final LuminanceSource getLuminanceSource() {
* and passed in with each call for performance. However it is legal to keep more than one row
* at a time if needed.
*
* @param y The row to fetch, 0 <= y < bitmap height.
* @param y The row to fetch, which must be in [0, bitmap height)
* @param row An optional preallocated array. If null or too small, it will be ignored.
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
* @return The array of bits for this row (true means black).
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/com/google/zxing/BinaryBitmap.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public int getHeight() {
* cached data. Callers should assume this method is expensive and call it as seldom as possible.
* This method is intended for decoding 1D barcodes and may choose to apply sharpening.
*
* @param y The row to fetch, 0 <= y < bitmap height.
* @param y The row to fetch, which must be in [0, bitmap height)
* @param row An optional preallocated array. If null or too small, it will be ignored.
* If used, the Binarizer will call BitArray.clear(). Always use the returned object.
* @return The array of bits for this row (true means black).
Expand Down Expand Up @@ -96,8 +96,8 @@ public boolean isCropSupported() {
* Returns a new object with cropped image data. Implementations may keep a reference to the
* original data rather than a copy. Only callable if isCropSupported() is true.
*
* @param left The left coordinate, 0 <= left < getWidth().
* @param top The top coordinate, 0 <= top <= getHeight().
* @param left The left coordinate, which must be in [0,getWidth())
* @param top The top coordinate, which must be in [0,getHeight())
* @param width The width of the rectangle to crop.
* @param height The height of the rectangle to crop.
* @return A cropped version of this object.
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/com/google/zxing/LuminanceSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected LuminanceSource(int width, int height) {
* to only fetch this row rather than the whole image, since no 2D Readers may be installed and
* getMatrix() may never be called.
*
* @param y The row to fetch, 0 <= y < getHeight().
* @param y The row to fetch, which must be in [0,getHeight())
* @param row An optional preallocated array. If null or too small, it will be ignored.
* Always use the returned object, and ignore the .length of the array.
* @return An array containing the luminance data.
Expand All @@ -51,7 +51,7 @@ protected LuminanceSource(int width, int height) {

/**
* Fetches luminance data for the underlying bitmap. Values should be fetched using:
* int luminance = array[y * width + x] & 0xff;
* {@code int luminance = array[y * width + x] & 0xff}
*
* @return A row-major 2D array of luminance values. Do not use result.length as it may be
* larger than width * height bytes on some platforms. Do not modify the contents
Expand Down Expand Up @@ -84,8 +84,8 @@ public boolean isCropSupported() {
* Returns a new object with cropped image data. Implementations may keep a reference to the
* original data rather than a copy. Only callable if isCropSupported() is true.
*
* @param left The left coordinate, 0 <= left < getWidth().
* @param top The top coordinate, 0 <= top <= getHeight().
* @param left The left coordinate, which must be in [0,getWidth())
* @param top The top coordinate, which must be in [0,getHeight())
* @param width The width of the rectangle to crop.
* @param height The height of the rectangle to crop.
* @return A cropped version of this object.
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/google/zxing/ResultPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public final String toString() {
}

/**
* <p>Orders an array of three ResultPoints in an order [A,B,C] such that AB < AC and
* BC < AC and the angle between BC and BA is less than 180 degrees.
* Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC
* and BC is less than AC, and the angle between BC and BA is less than 180 degrees.
*/
public static void orderBestPatterns(ResultPoint[] patterns) {

Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/com/google/zxing/oned/UPCEReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

/**
* <p>Implements decoding of the UPC-E format.</p>
* <p/>
* <p><a href="http://www.barcodeisland.com/upce.phtml">This</a> is a great reference for
* UPC-E information.</p>
*
Expand Down
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,30 @@
</plugins>
</build>
</profile>
<profile>
<id>java8</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<javadocVersion>1.8</javadocVersion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>

</project>

0 comments on commit fabd9f6

Please sign in to comment.