File: openjdk_21_syntax.patch

package info (click to toggle)
drop-seq 3.0.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 174,608 kB
  • sloc: java: 51,214; sh: 526; xml: 271; makefile: 34
file content (231 lines) | stat: -rw-r--r-- 10,985 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
Description: some pieces of syntax are for OpenJDK-21, which is not yet the
 default one in Debian. Let's remove this patch when it is.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2024-04-21

--- a/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DataProcessorUtils.java
+++ b/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DataProcessorUtils.java
@@ -140,7 +140,7 @@
                 finalLF = AnnotationUtils.getInstance().getLocusFunction(lf, false);
             }
             // any instance of list l is fine.
-            FunctionalData result = new FunctionalData(l.getFirst().getGene(), l.getFirst().getGeneStrand(), finalLF, l.getFirst().getReadStrand());
+            FunctionalData result = new FunctionalData(l.get(0).getGene(), l.get(0).getGeneStrand(), finalLF, l.get(0).getReadStrand());
             resultList.add(result);
         }
         return (resultList);
--- a/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DropSeqPriorityScore.java
+++ b/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DropSeqPriorityScore.java
@@ -4,14 +4,20 @@
 
 public class DropSeqPriorityScore implements PriorityScoreI {
     public int getScore(FunctionalData fd) {
-        int result = switch (fd.getLocusFunction()) {
-            case null -> Integer.MAX_VALUE;
-            case LocusFunction.CODING -> 1;
-            case LocusFunction.UTR -> 1;
-            case LocusFunction.INTRONIC -> 2;
-            case LocusFunction.INTERGENIC -> 3;
-            default -> Integer.MAX_VALUE;
-        };
+        int result;
+        if (fd.getLocusFunction() == null) {
+            result = Integer.MAX_VALUE;
+        } else if (fd.getLocusFunction() == LocusFunction.CODING) {
+            result = 1;
+        } else if (fd.getLocusFunction() == LocusFunction.UTR) {
+            result = 1;
+        } else if (fd.getLocusFunction() == LocusFunction.INTRONIC) {
+            result = 2;
+        } else if (fd.getLocusFunction() == LocusFunction.INTERGENIC) {
+            result = 3;
+        } else {
+            result = Integer.MAX_VALUE;
+        }
 
         return result;
     }
--- a/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/disambiguate/ClassifyDropSeqFunctionalData.java
+++ b/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/disambiguate/ClassifyDropSeqFunctionalData.java
@@ -130,7 +130,7 @@
         // simplify multiple annotations on the same gene.
 
         if (filtered.isEmpty() && antisense.size()==1) {
-            return antisense.getFirst();
+            return antisense.get(0);
         }
         return null;
     }
@@ -145,7 +145,7 @@
         List<FunctionalData> filtered = filterFunctionalData (fdList);
         List<FunctionalData> sense = filtered.stream().filter(FunctionalData::isSense).toList();
         if (sense.size()==1) {
-            return sense.getFirst();
+            return sense.get(0);
         }
         return null;
     }
--- a/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/disambiguate/OptimusDropSeqLocusFunctionComparison.java
+++ b/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/disambiguate/OptimusDropSeqLocusFunctionComparison.java
@@ -127,8 +127,8 @@
             if (recs.size()<2)
                 continue;
 
-            String cellBarcode = recs.getFirst().getStringAttribute(this.CELL_BARCODE_TAG);
-            String umiBarcode = recs.getFirst().getStringAttribute(this.MOLECULAR_BARCODE_TAG);
+            String cellBarcode = recs.get(0).getStringAttribute(this.CELL_BARCODE_TAG);
+            String umiBarcode = recs.get(0).getStringAttribute(this.MOLECULAR_BARCODE_TAG);
 
             Map<String, List<FunctionalData>> dropSeqFD = getFunctionalAnnotations(recs);
 
--- a/src/java/org/broadinstitute/dropseqrna/beadsynthesis/CorrectAndSplitScrnaReadPairs.java
+++ b/src/java/org/broadinstitute/dropseqrna/beadsynthesis/CorrectAndSplitScrnaReadPairs.java
@@ -171,7 +171,7 @@
                 }
                 ++metrics.NUM_READS_CORRECTED_SINGLE_ED1;
                 numCandidatesHist.increment(1);
-                return ed1Matches.getFirst();
+                return ed1Matches.get(0);
             } else {
                 String bestBarcode = null;
                 double bestBarcodeLikelihood = 0;
--- a/src/java/org/broadinstitute/dropseqrna/beadsynthesis/CountBarcodeSequences.java
+++ b/src/java/org/broadinstitute/dropseqrna/beadsynthesis/CountBarcodeSequences.java
@@ -115,7 +115,7 @@
   final SamReaderFactory readerFactory = SamReaderFactory.makeDefault();
   final List<SamReader> readers = INPUT.stream().map(readerFactory::open).toList();
   // Header is not important, but we need one to iterate
-  final SAMFileHeader header = readers.getFirst().getFileHeader();
+  final SAMFileHeader header = readers.get(0).getFileHeader();
   final CloseableIterator<SAMRecord> it = new UnsortedMergingSamRecordIterator(header, readers);
   final Histogram<String> histogram = new Histogram<>("SEQUENCE", "COUNT");
 
--- a/src/java/org/broadinstitute/dropseqrna/utils/readiterators/GeneFunctionProcessor.java
+++ b/src/java/org/broadinstitute/dropseqrna/utils/readiterators/GeneFunctionProcessor.java
@@ -63,7 +63,7 @@
 		// If there's only one functional data result, re-tag the read, and
 		// queue it, then short circuit out.
 		if (fdList.size() == 1) {
-			FunctionalData fd = fdList.getFirst();
+			FunctionalData fd = fdList.get(0);
 			SAMRecord rr = assignTagsToRead(r, fd);
 			result.add(rr);
 			return result;
@@ -114,11 +114,11 @@
 //		}
 
 		// test if all functional annotations are the same as the first entry.
-		FunctionalData first = fdList.getFirst();
+		FunctionalData first = fdList.get(0);
 		boolean allSame = fdList.stream().allMatch(first::sameGeneAndType);
 		// if so, assign and finish.
 		if (allSame)
-            return (assignTagsToRead(recs.getFirst(), first));
+            return (assignTagsToRead(recs.get(0), first));
 
 		return null;
 	}
--- a/src/java/org/broadinstitute/dropseqrna/utils/readiterators/SamFileMergeUtil.java
+++ b/src/java/org/broadinstitute/dropseqrna/utils/readiterators/SamFileMergeUtil.java
@@ -68,14 +68,14 @@
                     inputSortOrder = header.getSortOrder();
                 } else if (header.getSortOrder() != inputSortOrder) {
                     throw new PicardException(String.format("Sort order(%s) of %s does not agree with sort order(%s) of %s",
-                            header.getSortOrder(), inFile.getAbsolutePath(), inputSortOrder, inputs.getFirst().getAbsolutePath()));
+                            header.getSortOrder(), inFile.getAbsolutePath(), inputSortOrder, inputs.get(0).getAbsolutePath()));
                 }
             }
             headers.add(header);
         }
 
         if (inputs.size() == 1) {
-            return new SamHeaderAndIterator(headers.getFirst(), readers.getFirst().iterator());
+            return new SamHeaderAndIterator(headers.get(0), readers.get(0).iterator());
         } else {
             final SAMFileHeader.SortOrder outputSortOrder;
             if (maintainSort) {
@@ -132,4 +132,4 @@
         }
         return new SamHeaderAndIterator(headerMerger.getMergedHeader(), iterator);
     }
-}
\ No newline at end of file
+}
--- a/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/StarSoloPriorityScore.java
+++ b/src/java/org/broadinstitute/dropseqrna/annotation/functionaldata/StarSoloPriorityScore.java
@@ -8,13 +8,18 @@
 public class StarSoloPriorityScore implements PriorityScoreI {
 
     public int getScore(FunctionalData fd) {
-        int result = switch (fd.getLocusFunction()) {
-            case LocusFunction.CODING -> 1;
-            case LocusFunction.UTR -> 1;
-            case LocusFunction.INTRONIC -> 2;
-            case LocusFunction.INTERGENIC -> 3;
-            default -> Integer.MAX_VALUE;
-        };
+        int result;
+        if (fd.getLocusFunction() == LocusFunction.CODING) {
+            result = 1;
+        } else if (fd.getLocusFunction() == LocusFunction.UTR) {
+            result = 1;
+        } else if (fd.getLocusFunction() == LocusFunction.INTRONIC) {
+            result = 2;
+        } else if (fd.getLocusFunction() == LocusFunction.INTERGENIC) {
+            result = 3;
+        } else {
+            result = Integer.MAX_VALUE;
+        }
 
         return result;
     }
--- a/src/tests/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DropSeqFunctionalDataProcessorTest.java
+++ b/src/tests/java/org/broadinstitute/dropseqrna/annotation/functionaldata/DropSeqFunctionalDataProcessorTest.java
@@ -84,7 +84,7 @@
 		// SENSE STRAND TEST positive strand
 		List<FunctionalData> fdList = fdp.getFilteredFunctionalData(genes, strands, locusFunctions, false);
 		Assert.assertEquals(fdList.size(), 1);
-		FunctionalData fd = fdList.getFirst();
+		FunctionalData fd = fdList.get(0);
 		Assert.assertEquals(fd.getGene(), genes[0]);
 		Assert.assertEquals(fd.getGeneStrand(), strands[0]);
 		Assert.assertEquals(fd.getLocusFunction(), locusFunctions[0]);
@@ -136,7 +136,7 @@
 
 		List<FunctionalData> fdList = fdp.getFilteredFunctionalData(genes, strands, locusFunctions, false);
 		Assert.assertEquals(fdList.size(), 1);
-		FunctionalData fd = fdList.getFirst();
+		FunctionalData fd = fdList.get(0);
 		Assert.assertEquals(fd.getGene(), genes[0]);
 		Assert.assertEquals(fd.getGeneStrand(), strands[0]);
 		Assert.assertEquals(fd.getLocusFunction(), locusFunctions[0]);
--- a/src/tests/java/org/broadinstitute/dropseqrna/annotation/functionaldata/StarSoloFunctionalDataProcessorTest.java
+++ b/src/tests/java/org/broadinstitute/dropseqrna/annotation/functionaldata/StarSoloFunctionalDataProcessorTest.java
@@ -82,7 +82,7 @@
 		// SENSE STRAND TEST positive strand
 		List<FunctionalData> fdList = fdp.getFilteredFunctionalData(genes, strands, locusFunctions, false);
 		Assert.assertEquals(fdList.size(), 2);
-		FunctionalData fd = fdList.getFirst();
+		FunctionalData fd = fdList.get(0);
 		Assert.assertEquals(fd.getGene(), genes[0]);
 		Assert.assertEquals(fd.getGeneStrand(), strands[0]);
 		Assert.assertEquals(fd.getLocusFunction(), locusFunctions[0]);
@@ -134,7 +134,7 @@
 
 		List<FunctionalData> fdList = fdp.getFilteredFunctionalData(genes, strands, locusFunctions, false);
 		Assert.assertEquals(fdList.size(), 1);
-		FunctionalData fd = fdList.getFirst();
+		FunctionalData fd = fdList.get(0);
 		Assert.assertEquals(fd.getGene(), genes[0]);
 		Assert.assertEquals(fd.getGeneStrand(), strands[0]);
 		Assert.assertEquals(fd.getLocusFunction(), locusFunctions[0]);
@@ -316,7 +316,7 @@
 		// once you filter to the preferred annotations, only the intronic gene is retained
 		fdList = fdp.filterToPreferredAnnotations(fdList);
 		Assert.assertEquals(fdList.size(), 1);
-		Assert.assertEquals(fdList.getFirst().getGene(), "B");
+		Assert.assertEquals(fdList.get(0).getGene(), "B");
 
 	}