1. jython
  2. jython

Commits

Alex Grönholm  committed 4b061dc

Fixed code style issues in previous commits

  • Participants
  • Parent commits f79d600
  • Branches default

Comments (0)

Files changed (2)

File src/org/python/core/PyFloat.java

View file
  • Ignore whitespace
 
     @ExposedMethod(doc = BuiltinDocs.float___hash___doc)
     final int float___hash__() {
-    	double value = getValue();
-    	if (Double.isInfinite(value))
-    		return value < 0 ? -271828 : 314159;
-    	if (Double.isNaN(value))
-    		return 0;
-    	
+        double value = getValue();
+        if (Double.isInfinite(value)) {
+            return value < 0 ? -271828 : 314159;
+        }
+        if (Double.isNaN(value)) {
+            return 0;
+        }
+        
         double intPart = Math.floor(value);
         double fractPart = value - intPart;
 

File src/org/python/core/PyType.java

View file
  • Ignore whitespace
     }
 
     protected PyObject richCompare(PyObject other, cmpopType op) {
-    	// Make sure the other object is a type
-    	if (!(other instanceof PyType) && other != this)
-    		return null;
+        // Make sure the other object is a type
+        if (!(other instanceof PyType) && other != this) {
+            return null;
+        }
 
-    	// If there is a __cmp__ method defined, let it be called instead
+        // If there is a __cmp__ method defined, let it be called instead
         // of our dumb function designed merely to warn. See CPython bug #7491.
-    	if (__findattr__("__cmp__") != null || ((PyType)other).__findattr__("__cmp__") != null)
-    		return null;
-    	
-    	// Py3K warning if comparison isn't == or !=
-    	if (Options.py3k_warning && op != cmpopType.Eq && op != cmpopType.NotEq) {
-        	Py.warnPy3k("type inequality comparisons not supported in 3.x");
-        	return null;
-    	}
+        if (__findattr__("__cmp__") != null || ((PyType)other).__findattr__("__cmp__") != null) {
+            return null;
+        }
+        
+        // Py3K warning if comparison isn't == or !=
+        if (Options.py3k_warning && op != cmpopType.Eq && op != cmpopType.NotEq) {
+            Py.warnPy3k("type inequality comparisons not supported in 3.x");
+            return null;
+        }
 
-    	// Compare hashes
-    	int hash1 = object___hash__();
-    	int hash2 = other.object___hash__();
-    	switch (op) {
-    	case Lt: return hash1 < hash2 ? Py.True : Py.False;
-    	case LtE: return hash1 <= hash2 ? Py.True : Py.False;
-    	case Eq: return hash1 == hash2 ? Py.True : Py.False;
-    	case NotEq: return hash1 != hash2 ? Py.True : Py.False;
-    	case Gt: return hash1 > hash2 ? Py.True : Py.False;
-    	case GtE: return hash1 >= hash2 ? Py.True : Py.False;
-    	default: return null;
-    	}
+        // Compare hashes
+        int hash1 = object___hash__();
+        int hash2 = other.object___hash__();
+        switch (op) {
+        case Lt: return hash1 < hash2 ? Py.True : Py.False;
+        case LtE: return hash1 <= hash2 ? Py.True : Py.False;
+        case Eq: return hash1 == hash2 ? Py.True : Py.False;
+        case NotEq: return hash1 != hash2 ? Py.True : Py.False;
+        case Gt: return hash1 > hash2 ? Py.True : Py.False;
+        case GtE: return hash1 >= hash2 ? Py.True : Py.False;
+        default: return null;
+        }
     }
     
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___eq___doc)
     public PyObject type___eq__(PyObject other) {
-    	return richCompare(other, cmpopType.Eq);
+        return richCompare(other, cmpopType.Eq);
     }
 
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___ne___doc)
     public PyObject type___ne__(PyObject other) {
-    	return richCompare(other, cmpopType.NotEq);
+        return richCompare(other, cmpopType.NotEq);
     }
 
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___le___doc)
     public PyObject type___le__(PyObject other) {
-    	return richCompare(other, cmpopType.LtE);
+        return richCompare(other, cmpopType.LtE);
     }
 
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___lt___doc)
     public PyObject type___lt__(PyObject other) {
-    	return richCompare(other, cmpopType.Lt);
+        return richCompare(other, cmpopType.Lt);
     }
 
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___ge___doc)
     public PyObject type___ge__(PyObject other) {
-    	return richCompare(other, cmpopType.GtE);
+        return richCompare(other, cmpopType.GtE);
     }
 
     @ExposedMethod(type = MethodType.BINARY, doc = BuiltinDocs.type___gt___doc)
     public PyObject type___gt__(PyObject other) {
-    	return richCompare(other, cmpopType.Gt);
+        return richCompare(other, cmpopType.Gt);
     }
     
     @ExposedGet(name = "__base__")