Skip to content

Commit 58227be

Browse files
committed
Fix style.
1 parent 6c5bf18 commit 58227be

File tree

4 files changed

+47
-8
lines changed

4 files changed

+47
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinConstructors.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,10 +1815,10 @@ Object strOneArg(VirtualFrame frame, LazyPythonClass strClass, Object obj, @Supp
18151815
return result;
18161816
}
18171817

1818-
@Specialization(guards = {"!isNativeClass(strClass)", "!isNoValue(encoding)"}, limit = "3" )
1818+
@Specialization(guards = {"!isNativeClass(strClass)", "!isNoValue(encoding)"}, limit = "3")
18191819
Object doBuffer(VirtualFrame frame, LazyPythonClass strClass, Object obj, Object encoding, Object errors,
18201820
@CachedLibrary("obj") PythonObjectLibrary bufferLib) {
1821-
if(bufferLib.isBuffer(obj)) {
1821+
if (bufferLib.isBuffer(obj)) {
18221822
try {
18231823
// TODO(fa): we should directly call '_codecs.decode'
18241824
PBytes bytesObj = factory().createBytes(bufferLib.getBufferBytes(obj));
@@ -1847,10 +1847,9 @@ private Object decodeBytes(VirtualFrame frame, LazyPythonClass strClass, PBytes
18471847
* into a natively allocated subtype structure
18481848
*/
18491849
@Specialization(guards = {"isSubtypeOfString(frame, isSubtype, cls)", "isNoValue(encoding)", "isNoValue(errors)"}, limit = "1")
1850-
Object doNativeSubclass(VirtualFrame frame, PythonNativeClass cls, Object obj, @SuppressWarnings("unused") Object encoding,@SuppressWarnings("unused") Object errors,
1850+
Object doNativeSubclass(VirtualFrame frame, PythonNativeClass cls, Object obj, @SuppressWarnings("unused") Object encoding, @SuppressWarnings("unused") Object errors,
18511851
@Cached @SuppressWarnings("unused") IsSubtypeNode isSubtype,
18521852
@Cached CoerceToStringNode castToStringNode,
1853-
@Cached BranchProfile gotException,
18541853
@Cached CExtNodes.StringSubtypeNew subtypeNew) {
18551854
return subtypeNew.call(cls, castToStringNode.execute(frame, obj));
18561855
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/slice/PSlice.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public SliceInfo(int start, int stop, int step, int length) {
118118
this.length = length;
119119
}
120120
}
121+
121122
public SliceInfo computeIndices(int length) {
122123
return PSlice.computeIndices(start, stop, step, length);
123124

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringNodes.java

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
141
package com.oracle.graal.python.builtins.objects.str;
242

343
import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
@@ -52,7 +92,6 @@ public static boolean isMaterialized(PString x) {
5292
return x.getCharSequence() instanceof String;
5393
}
5494

55-
5695
@GenerateUncached
5796
@ImportStatic(StringNodes.class)
5897
public abstract static class StringMaterializeNode extends Node {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/ImportStarNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import com.oracle.graal.python.nodes.util.CastToIndexNode;
4545
import com.oracle.graal.python.nodes.util.CastToJavaStringNode;
4646
import com.oracle.graal.python.nodes.util.CastToJavaStringNodeGen;
47-
import com.oracle.graal.python.parser.sst.SimpleSSTNode.Type;
4847
import com.oracle.graal.python.runtime.exception.PException;
4948
import com.oracle.truffle.api.CompilerDirectives;
5049
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
@@ -131,8 +130,9 @@ public void executeVoid(VirtualFrame frame) {
131130
for (int i = 0; i < n; i++) {
132131
Object attrNameObj = ensureGetItemNode().executeWith(frame, attrAll, i);
133132
String attrName = ensureCastToStringNode().execute(attrNameObj);
134-
if(attrName == null) {
135-
// TODO(fa): this error should be raised by the ReadAttributeFromObjectNode; but that needs some refactoring first.
133+
if (attrName == null) {
134+
// TODO(fa): this error should be raised by the ReadAttributeFromObjectNode;
135+
// but that needs some refactoring first.
136136
throw raise(PythonBuiltinClassType.TypeError, "attribute name must be string, not '%p'", attrNameObj);
137137
}
138138
Object attr = readAttribute(frame, importedModule, attrName);

0 commit comments

Comments
 (0)