Minimal changes to build successfully with Java 8, plus optional profile to enable it

This commit is contained in:
Sean Owen 2014-03-25 18:01:01 +00:00
parent 4fb569cce8
commit fabd9f6473
9 changed files with 39 additions and 14 deletions

View file

@ -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;

View file

@ -24,9 +24,11 @@ import android.view.View;
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() {

View file

@ -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

View file

@ -47,7 +47,7 @@ public abstract class Binarizer {
* 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).

View file

@ -56,7 +56,7 @@ public final class BinaryBitmap {
* 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).
@ -96,8 +96,8 @@ public final class BinaryBitmap {
* 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.

View file

@ -42,7 +42,7 @@ public abstract class LuminanceSource {
* 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.
@ -51,7 +51,7 @@ public abstract class LuminanceSource {
/**
* 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
@ -84,8 +84,8 @@ public abstract class LuminanceSource {
* 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.

View file

@ -68,8 +68,8 @@ public class ResultPoint {
}
/**
* <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) {

View file

@ -24,7 +24,6 @@ import com.google.zxing.common.BitArray;
/**
* <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>
*

24
pom.xml
View file

@ -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>