performance, bit operations

This commit is contained in:
Alexey Kudravtsev
2012-01-24 12:10:39 +04:00
parent 9adadf6569
commit 8f4258d45d
3 changed files with 97 additions and 60 deletions
@@ -14,7 +14,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -26,7 +26,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -38,7 +38,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -50,7 +50,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -62,7 +62,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -74,7 +74,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -86,7 +86,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -98,7 +98,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -110,7 +110,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -122,7 +122,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -134,7 +134,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -146,7 +146,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -158,7 +158,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -170,7 +170,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -178,7 +178,7 @@
<file>X.java</file>
<line>81</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -189,7 +189,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -201,7 +201,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -213,7 +213,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -225,7 +225,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -237,7 +237,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -249,7 +249,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -257,14 +257,14 @@
<file>X.java</file>
<line>118</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
<problem>
<file>X.java</file>
<line>119</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -276,7 +276,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -288,7 +288,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -300,7 +300,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -312,7 +312,7 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -322,7 +322,7 @@
<file>X.java</file>
<line>173</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -331,7 +331,7 @@
<file>X.java</file>
<line>174</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -340,7 +340,7 @@
<file>X.java</file>
<line>175</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -349,7 +349,7 @@
<file>X.java</file>
<line>177</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -357,7 +357,7 @@
<file>X.java</file>
<line>178</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -366,7 +366,7 @@
<file>X.java</file>
<line>179</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -375,7 +375,7 @@
<file>X.java</file>
<line>180</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y, Const.Z</description>
<description>Must be one of: Const.X, Const.Y, Const.Z</description>
</problem>
@@ -383,7 +383,7 @@
<file>X.java</file>
<line>193</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
@@ -391,14 +391,14 @@
<file>X.java</file>
<line>195</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
<problem>
<file>X.java</file>
<line>227</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
@@ -406,7 +406,7 @@
<file>X.java</file>
<line>228</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
@@ -414,7 +414,7 @@
<file>X.java</file>
<line>229</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
@@ -422,28 +422,28 @@
<file>X.java</file>
<line>230</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
<problem>
<file>X.java</file>
<line>231</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">magic constant</problem_class>
<description>Must be one of the: Const.X, Const.Y</description>
<description>Must be one of: Const.X, Const.Y</description>
</problem>
<problem>
<file>X.java</file>
<line>238</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Magic Constant</problem_class>
<description>Must be one of the: Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL, Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST, Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER</description>
<description>Must be one of: Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL, Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST, Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER</description>
</problem>
<problem>
<file>X.java</file>
<line>239</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Magic Constant</problem_class>
<description>Must be one of the: SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, SwingConstants.LEADING, SwingConstants.TRAILING</description>
<description>Must be one of: SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, SwingConstants.LEADING, SwingConstants.TRAILING</description>
</problem>
</problems>
@@ -103,10 +103,10 @@ public class X {
if (x == Const.X) {
x = Const.Y;
assert x != Const.Z;
f |= Const.Y;
f |= Const.Y; f &= Const.X & ~(Const.Z | Const.X);
}
else {
f |= Const.X;
f |= Const.X; f = f & ~(Const.X | Const.X);
}
f3(f);