]> source.dussan.org Git - jgit.git/commitdiff
Drop warnings about unchecked casts in a few stable select places 51/29951/3
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Tue, 15 Jul 2014 09:37:10 +0000 (11:37 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 4 Sep 2014 09:35:19 +0000 (11:35 +0200)
Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544

org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommitList.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevObjectList.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Daemon.java

index c95689ccb7128f0fefc51871b49c0c0cef71645d..d880d9b616e91a892c8c6b1ba0cc17ce069e914c 100644 (file)
@@ -82,6 +82,7 @@ class GlobalBundleCache {
         * @exception TranslationBundleLoadingException see {@link TranslationBundle#load(Locale)}
         * @exception TranslationStringMissingException see {@link TranslationBundle#load(Locale)}
         */
+       @SuppressWarnings("unchecked")
        static synchronized <T extends TranslationBundle> T lookupBundle(Locale locale, Class<T> type) {
                try {
                        Map<Class, TranslationBundle> bundles = cachedBundles.get(locale);
index 0fac3af9b9d969c9708eae78e865717e705e3cb1..6ba0dfed03ff22217cd65077a6bcffdd7ac8fbb1 100644 (file)
@@ -91,6 +91,7 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
         * @param h
         *            total height (in pixels) of this cell.
         */
+       @SuppressWarnings("unchecked")
        protected void paintCommit(final PlotCommit<TLane> commit, final int h) {
                final int dotSize = computeDotSize(h);
                final TLane myLane = commit.getLane();
@@ -114,7 +115,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
                                        LINE_WIDTH);
 
                        for (int i = 0; i < commit.mergingLanes.length; i++) {
-                               @SuppressWarnings("unchecked")
                                final TLane pLane = (TLane) commit.mergingLanes[i];
                                final TColor pColor = laneColor(pLane);
                                final int cx = laneC(pLane);
@@ -138,7 +138,6 @@ public abstract class AbstractPlotRenderer<TLane extends PlotLane, TColor> {
 
                if (commit.getChildCount() > 0) {
                        for (int i = 0; i < commit.forkingOffLanes.length; i++) {
-                               @SuppressWarnings("unchecked")
                                final TLane childLane = (TLane) commit.forkingOffLanes[i];
                                final TColor cColor = laneColor(childLane);
                                final int cx = laneC(childLane);
index dba68465c23688cdbb81924f093dff971279664e..2e8aab885acda2198dd3151be9bcf4d49ab3c37f 100644 (file)
@@ -198,6 +198,7 @@ public class PlotCommit<L extends PlotLane> extends RevCommit {
         *
         * @return the assigned lane for this commit.
         */
+       @SuppressWarnings("unchecked")
        public final L getLane() {
                return (L) lane;
        }
index 3444c8df1c6ac1cb8e3fe2b241f69b905610cffd..6102a8148244b04e19dedf40f17942f6b4c36649 100644 (file)
@@ -115,6 +115,7 @@ public class PlotCommitList<L extends PlotLane> extends
         * @param result
         *            collection to add the passing lanes into.
         */
+       @SuppressWarnings("unchecked")
        public void findPassingThrough(final PlotCommit<L> currCommit,
                        final Collection<L> result) {
                for (final PlotLane p : currCommit.passingLanes)
@@ -343,6 +344,7 @@ public class PlotCommitList<L extends PlotLane> extends
                }
        }
 
+       @SuppressWarnings("unchecked")
        private void closeLane(PlotLane lane) {
                if (activeLanes.remove(lane)) {
                        recycleLane((L) lane);
@@ -395,6 +397,7 @@ public class PlotCommitList<L extends PlotLane> extends
        /**
         * @return a new Lane appropriate for this particular PlotList.
         */
+       @SuppressWarnings("unchecked")
        protected L createLane() {
                return (L) new PlotLane();
        }
index 835e0ce224b2c581c656baa5baa850c28af5b94d..64f99bbd28969bc4da9ca0fc5f782ed5944acfcb 100644 (file)
@@ -297,6 +297,7 @@ public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
         * @throws MissingObjectException
         *             see {@link RevWalk#next()}
         */
+       @SuppressWarnings("unchecked")
        public void fillTo(final int highMark) throws MissingObjectException,
                        IncorrectObjectTypeException, IOException {
                if (walker == null || size > highMark)
@@ -361,6 +362,7 @@ public class RevCommitList<E extends RevCommit> extends RevObjectList<E> {
         * @throws MissingObjectException
         *             see {@link RevWalk#next()}
         */
+       @SuppressWarnings("unchecked")
        public void fillTo(final RevCommit commitToLoad, int highMark)
                        throws MissingObjectException, IncorrectObjectTypeException,
                        IOException {
index a05cc9046f6baf4f0a31aff08c278177cbefea6e..5052a4dea580067a3843ebd0c425309318c79d4d 100644 (file)
@@ -87,6 +87,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
                size++;
        }
 
+       @SuppressWarnings("unchecked")
        public E set(int index, E element) {
                Block s = contents;
                while (index >> s.shift >= BLOCK_SIZE) {
@@ -106,6 +107,7 @@ public class RevObjectList<E extends RevObject> extends AbstractList<E> {
                return (E) old;
        }
 
+       @SuppressWarnings("unchecked")
        public E get(int index) {
                Block s = contents;
                if (index >> s.shift >= 1024)
index 89f0764a5e25738c5c687e393c067cf4834be07c..03f7c72835b8b89a7f58ee3c77917a3ee57a7f77 100644 (file)
@@ -103,6 +103,7 @@ public class Daemon {
         *            address to listen for connections on. If null, any available
         *            port will be chosen on all network interfaces.
         */
+       @SuppressWarnings("unchecked")
        public Daemon(final InetSocketAddress addr) {
                myAddress = addr;
                processors = new ThreadGroup("Git-Daemon"); //$NON-NLS-1$