git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f0abe70
)
JAL-1819 use Float.isNaN() to check for NaNs!
author
Jim Procter
<jprocter@issues.jalview.org>
Thu, 23 Jul 2015 10:26:11 +0000
(11:26 +0100)
committer
Jim Procter
<jprocter@issues.jalview.org>
Thu, 23 Jul 2015 10:26:11 +0000
(11:26 +0100)
src/jalview/analysis/AlignmentSorter.java
patch
|
blob
|
history
src/jalview/appletgui/IdPanel.java
patch
|
blob
|
history
src/jalview/datamodel/Annotation.java
patch
|
blob
|
history
src/jalview/io/AnnotationFile.java
patch
|
blob
|
history
src/jalview/io/FeaturesFile.java
patch
|
blob
|
history
src/jalview/io/SequenceAnnotationReport.java
patch
|
blob
|
history
src/jalview/io/vamsas/Sequencefeature.java
patch
|
blob
|
history
src/jalview/renderer/seqfeatures/FeatureRenderer.java
patch
|
blob
|
history
src/jalview/schemes/GraduatedColor.java
patch
|
blob
|
history
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
patch
|
blob
|
history
src/jalview/ws/jws2/AADisorderClient.java
patch
|
blob
|
history
diff --git
a/src/jalview/analysis/AlignmentSorter.java
b/src/jalview/analysis/AlignmentSorter.java
index
2fad332
..
0022af6
100755
(executable)
--- a/
src/jalview/analysis/AlignmentSorter.java
+++ b/
src/jalview/analysis/AlignmentSorter.java
@@
-820,7
+820,7
@@
public class AlignmentSorter
else
{
// or, also take a look at the scores if necessary.
else
{
// or, also take a look at the scores if necessary.
- if (!ignoreScore && sf[f].getScore() != Float.NaN)
+ if (!ignoreScore && !Float.isNaN(sf[f].getScore()))
{
if (seqScores[i] == 0)
{
{
if (seqScores[i] == 0)
{
diff --git
a/src/jalview/appletgui/IdPanel.java
b/src/jalview/appletgui/IdPanel.java
index
258b8b6
..
72f94ec
100755
(executable)
--- a/
src/jalview/appletgui/IdPanel.java
+++ b/
src/jalview/appletgui/IdPanel.java
@@
-142,7
+142,7
@@
public class IdPanel extends Panel implements MouseListener,
nl = true;
}
;
nl = true;
}
;
- if (sf[sl].getScore() != Float.NaN && sf[sl].getScore() != 0f)
+ if (!Float.isNaN(sf[sl].getScore()) && sf[sl].getScore() != 0f)
{
tooltiptext.append(" Score = ");
tooltiptext.append(sf[sl].getScore());
{
tooltiptext.append(" Score = ");
tooltiptext.append(sf[sl].getScore());
diff --git
a/src/jalview/datamodel/Annotation.java
b/src/jalview/datamodel/Annotation.java
index
dae81ef
..
0230e7a
100755
(executable)
--- a/
src/jalview/datamodel/Annotation.java
+++ b/
src/jalview/datamodel/Annotation.java
@@
-168,7
+168,7
@@
public class Annotation
{
sb.append(",");
}
{
sb.append(",");
}
- if (value != Float.NaN)
+ if (!Float.isNaN(value))
{
sb.append(value);
}
{
sb.append(value);
}
diff --git
a/src/jalview/io/AnnotationFile.java
b/src/jalview/io/AnnotationFile.java
index
88cb46e
..
937826a
100755
(executable)
--- a/
src/jalview/io/AnnotationFile.java
+++ b/
src/jalview/io/AnnotationFile.java
@@
-241,7
+241,7
@@
public class AnnotationFile
&& row.annotations[j].displayCharacter.length() > 0 && !row.annotations[j].displayCharacter
.equals(" "));
hasGlyphs |= (row.annotations[j].secondaryStructure != 0 && row.annotations[j].secondaryStructure != ' ');
&& row.annotations[j].displayCharacter.length() > 0 && !row.annotations[j].displayCharacter
.equals(" "));
hasGlyphs |= (row.annotations[j].secondaryStructure != 0 && row.annotations[j].secondaryStructure != ' ');
- hasValues |= (row.annotations[j].value != Float.NaN); // NaNs can't
+ hasValues |= (!Float.isNaN(row.annotations[j].value)); // NaNs can't
// be
// rendered..
hasText |= (row.annotations[j].description != null && row.annotations[j].description
// be
// rendered..
hasText |= (row.annotations[j].description != null && row.annotations[j].description
@@
-331,7
+331,7
@@
public class AnnotationFile
}
if (hasValues)
{
}
if (hasValues)
{
- if (row.annotations[j].value != Float.NaN)
+ if (!Float.isNaN(row.annotations[j].value))
{
text.append(comma + row.annotations[j].value);
}
{
text.append(comma + row.annotations[j].value);
}
diff --git
a/src/jalview/io/FeaturesFile.java
b/src/jalview/io/FeaturesFile.java
index
57f6384
..
fbe871b
100755
(executable)
--- a/
src/jalview/io/FeaturesFile.java
+++ b/
src/jalview/io/FeaturesFile.java
@@
-1384,7
+1384,7
@@
public class FeaturesFile extends AlignFile
out.append(next[j].end);
out.append("\t");
out.append(next[j].type);
out.append(next[j].end);
out.append("\t");
out.append(next[j].type);
- if (next[j].score != Float.NaN)
+ if (!Float.isNaN(next[j].score))
{
out.append("\t");
out.append(next[j].score);
{
out.append("\t");
out.append(next[j].score);
diff --git
a/src/jalview/io/SequenceAnnotationReport.java
b/src/jalview/io/SequenceAnnotationReport.java
index
7c96d45
..
6d8ce5f
100644
(file)
--- a/
src/jalview/io/SequenceAnnotationReport.java
+++ b/
src/jalview/io/SequenceAnnotationReport.java
@@
-152,7
+152,7
@@
public class SequenceAnnotationReport
}
}
// check score should be shown
}
}
// check score should be shown
- if (feature.getScore() != Float.NaN)
+ if (!Float.isNaN(feature.getScore()))
{
float[][] rng = (minmax == null) ? null : ((float[][]) minmax
.get(feature.getType()));
{
float[][] rng = (minmax == null) ? null : ((float[][]) minmax
.get(feature.getType()));
diff --git
a/src/jalview/io/vamsas/Sequencefeature.java
b/src/jalview/io/vamsas/Sequencefeature.java
index
3d598d2
..
d1af2cf
100644
(file)
--- a/
src/jalview/io/vamsas/Sequencefeature.java
+++ b/
src/jalview/io/vamsas/Sequencefeature.java
@@
-220,7
+220,7
@@
public class Sequencefeature extends Rangetype
}
}
dsa.setGroup(feature.getFeatureGroup());
}
}
dsa.setGroup(feature.getFeatureGroup());
- if (feature.getScore() != Float.NaN)
+ if (!Float.isNaN(feature.getScore()))
{
Score fscore = new Score();
dsa.setScore(new Score[]
{
Score fscore = new Score();
dsa.setScore(new Score[]
diff --git
a/src/jalview/renderer/seqfeatures/FeatureRenderer.java
b/src/jalview/renderer/seqfeatures/FeatureRenderer.java
index
7eda2f7
..
0f2a49c
100644
(file)
--- a/
src/jalview/renderer/seqfeatures/FeatureRenderer.java
+++ b/
src/jalview/renderer/seqfeatures/FeatureRenderer.java
@@
-349,7
+349,7
@@
public class FeatureRenderer extends
else if (showFeature(sequenceFeature))
{
if (av_isShowSeqFeatureHeight
else if (showFeature(sequenceFeature))
{
if (av_isShowSeqFeatureHeight
- && sequenceFeature.score != Float.NaN)
+ && !Float.isNaN(sequenceFeature.score))
{
renderScoreFeature(g, seq,
seq.findIndex(sequenceFeature.begin) - 1,
{
renderScoreFeature(g, seq,
seq.findIndex(sequenceFeature.begin) - 1,
diff --git
a/src/jalview/schemes/GraduatedColor.java
b/src/jalview/schemes/GraduatedColor.java
index
4f1cb58
..
8a55f79
100644
(file)
--- a/
src/jalview/schemes/GraduatedColor.java
+++ b/
src/jalview/schemes/GraduatedColor.java
@@
-145,7
+145,7
@@
public class GraduatedColor
public boolean isColored(SequenceFeature feature)
{
float val = feature.getScore();
public boolean isColored(SequenceFeature feature)
{
float val = feature.getScore();
- if (val == Float.NaN)
+ if (Float.isNaN(val))
{
return true;
}
{
return true;
}
@@
-153,7
+153,7
@@
public class GraduatedColor
{
return true;
}
{
return true;
}
- if (this.thrsh == Float.NaN)
+ if (Float.isNaN(this.thrsh))
{
return true;
}
{
return true;
}
@@
-211,7
+211,7
@@
public class GraduatedColor
return getMaxColor();
}
float scr = feature.getScore();
return getMaxColor();
}
float scr = feature.getScore();
- if (scr == Float.NaN)
+ if (Float.isNaN(scr))
{
return getMinColor();
}
{
return getMinColor();
}
diff --git
a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
index
674f3d1
..
19c6ca8
100644
(file)
--- a/
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
+++ b/
src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java
@@
-369,7
+369,7
@@
public abstract class FeatureRendererModel implements
{
allfeatures.add(features[index].getType());
}
{
allfeatures.add(features[index].getType());
}
- if (features[index].score != Float.NaN)
+ if (!Float.isNaN(features[index].score))
{
int nonpos = features[index].getBegin() >= 1 ? 0 : 1;
float[][] mm = (float[][]) minmax.get(features[index].getType());
{
int nonpos = features[index].getBegin() >= 1 ? 0 : 1;
float[][] mm = (float[][]) minmax.get(features[index].getType());
diff --git
a/src/jalview/ws/jws2/AADisorderClient.java
b/src/jalview/ws/jws2/AADisorderClient.java
index
dfb13a6
..
91be2e6
100644
(file)
--- a/
src/jalview/ws/jws2/AADisorderClient.java
+++ b/
src/jalview/ws/jws2/AADisorderClient.java
@@
-265,7
+265,7
@@
public class AADisorderClient extends JabawsCalcWorker implements
+ rn.from, base + rn.to, methodName);
}
dseq.addSequenceFeature(sf);
+ rn.from, base + rn.to, methodName);
}
dseq.addSequenceFeature(sf);
- if (last != val && last != Float.NaN)
+ if (last != val && !Float.isNaN(last))
{
fc.put(sf.getType(), sf);
}
{
fc.put(sf.getType(), sf);
}