From 72ae0892066fb4875136cf77c624194e394c0856 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sat, 22 Jun 2019 18:47:43 +0900 Subject: Fix NarrowingCompoundAssignment warnings from Error Prone Error Prone reports: [NarrowingCompoundAssignment] Compound assignments from long to int hide lossy casts and [NarrowingCompoundAssignment] Compound assignments from int to byte hide lossy casts See https://errorprone.info/bugpattern/NarrowingCompoundAssignment Fix the warnings by adding explicit casts or changing types as necessary. Now that all occurrences of the warning are fixed, increase its severity to ERROR. Change-Id: Idb3670e6047b146ae37daee07212ff9455512623 Signed-off-by: David Pursehouse --- org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index d2a59c1310..d4db15ce9b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -448,9 +448,9 @@ public class DirCacheEntry { */ public void setAssumeValid(boolean assume) { if (assume) - info[infoOffset + P_FLAGS] |= ASSUME_VALID; + info[infoOffset + P_FLAGS] |= (byte) ASSUME_VALID; else - info[infoOffset + P_FLAGS] &= ~ASSUME_VALID; + info[infoOffset + P_FLAGS] &= (byte) ~ASSUME_VALID; } /** @@ -470,9 +470,9 @@ public class DirCacheEntry { */ public void setUpdateNeeded(boolean updateNeeded) { if (updateNeeded) - inCoreFlags |= UPDATE_NEEDED; + inCoreFlags |= (byte) UPDATE_NEEDED; else - inCoreFlags &= ~UPDATE_NEEDED; + inCoreFlags &= (byte) ~UPDATE_NEEDED; } /** -- cgit v1.2.3