X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ nil is returned.
* [CLJ-1580](http://dev.clojure.org/jira/browse/CLJ-1580)
Transient collections should guarantee thread visibility
* [CLJ-1590](http://dev.clojure.org/jira/browse/CLJ-1590)
Some IReduce/IReduceInit implementors don't respect reduced
Some IReduce/IReduceInit implementers don't respect reduced
* [CLJ-979](http://dev.clojure.org/jira/browse/CLJ-979)
Clojure resolves to wrong deftype classes when AOT compiling or reloading
* [CLJ-1636](http://dev.clojure.org/jira/browse/CLJ-1636)
Expand Down Expand Up @@ -1472,7 +1472,7 @@ runs them *with their fixtures*.
Clojure can leak memory in a servlet container when using dynamic
bindings or STM transactions.
* [CLJ-1082](http://dev.clojure.org/jira/browse/CLJ-1082)
Subvecs of primitve vectors cannot be reduced
Subvecs of primitive vectors cannot be reduced
* [CLJ-1301](http://dev.clojure.org/jira/browse/CLJ-1301)
Case expressions use a mixture of hashCode and hasheq, potentially
leading to missed case matches when these differ.
Expand Down
2 changes: 1 addition & 1 deletion src/clj/clojure/core_deftype.clj
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@
to specify which impl to use. You can extend a protocol on nil.

If you are supplying the definitions explicitly (i.e. not reusing
exsting functions or mixin maps), you may find it more convenient to
existing functions or mixin maps), you may find it more convenient to
use the extend-type or extend-protocol macros.

Note that multiple independent extend clauses can exist for the same
Expand Down
4 changes: 2 additions & 2 deletions src/clj/clojure/pprint/cl_format.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ not a pretty writer (which keeps track of columns), this function always outputs
:commainterval [ 3 Integer]]
#{ :at :colon :both } {}
(do
(cond ; ~R is overloaded with bizareness
(cond ; ~R is overloaded with bizarreness
(first (:base params)) #(format-integer (:base %1) %1 %2 %3)
(and (:at params) (:colon params)) #(format-old-roman %1 %2 %3)
(:at params) #(format-new-roman %1 %2 %3)
Expand Down Expand Up @@ -1455,7 +1455,7 @@ not a pretty writer (which keeps track of columns), this function always outputs
(print (apply str (repeat n \~)))
arg-navigator)))

(\newline ;; Whitespace supression is handled in the compilation loop
(\newline ;; Whitespace suppression is handled in the compilation loop
[ ]
#{:colon :at} {}
(fn [params arg-navigator offsets]
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/asm/ClassReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public void accept(
classVisitor.visit(
readInt(cpInfoOffsets[1] - 7), accessFlags, thisClass, signature, superClass, interfaces);

// Visit the SourceFile and SourceDebugExtenstion attributes.
// Visit the SourceFile and SourceDebugExtension attributes.
if ((parsingOptions & SKIP_DEBUG) == 0
&& (sourceFile != null || sourceDebugExtension != null)) {
classVisitor.visitSource(sourceFile, sourceDebugExtension);
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/asm/MethodVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void visitParameter(final String name, final int access) {
*
* @return a visitor to the visit the actual default value of this annotation interface method, or
* <tt>null</tt> if this visitor is not interested in visiting this default value. The 'name'
* parameters passed to the methods of this annotation visitor are ignored. Moreover, exacly
* parameters passed to the methods of this annotation visitor are ignored. Moreover, exactly
* one visit method must be called on this annotation visitor, followed by visitEnd.
*/
public AnnotationVisitor visitAnnotationDefault() {
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/asm/Symbol.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ abstract class Symbol {
* #CONSTANT_METHOD_HANDLE_TAG} symbols,
* <li>the CONSTANT_InvokeDynamic_info bootstrap_method_attr_index field value for {@link
* #CONSTANT_INVOKE_DYNAMIC_TAG} symbols,
* <li>the offset of a bootstrap method in the BootstrapMethods boostrap_methods array, for
* <li>the offset of a bootstrap method in the BootstrapMethods bootstrap_methods array, for
* {@link #CONSTANT_DYNAMIC_TAG} or {@link #BOOTSTRAP_METHOD_TAG} symbols,
* <li>the bytecode offset of the NEW instruction that created an {@link
* Frame#ITEM_UNINITIALIZED} type for {@link #UNINITIALIZED_TYPE_TAG} symbols,
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/asm/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class Type {
* @param valueBuffer a buffer containing the value of this field or method type.
* @param valueBegin the beginning index, inclusive, of the value of this field or method type in
* valueBuffer.
* @param valueEnd tne end index, exclusive, of the value of this field or method type in
* @param valueEnd the end index, exclusive, of the value of this field or method type in
* valueBuffer.
*/
private Type(final int sort, final String valueBuffer, final int valueBegin, final int valueEnd) {
Expand Down
96 changes: 48 additions & 48 deletions src/jvm/clojure/lang/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3956,7 +3956,7 @@ protected void emitMethods(ClassVisitor cv){
null,
cv);
gen.visitCode();
gen.push(variadicMethod.reqParms.count());
gen.push(variadicMethod.reqParams.count());
gen.returnValue();
gen.endMethod();
}
Expand Down Expand Up @@ -4043,16 +4043,16 @@ VAR_CALLSITES, emptyVarCallSites(),
else
throw Util.runtimeException("Can't have more than 1 variadic overload");
}
else if(methodArray[f.reqParms.count()] == null)
methodArray[f.reqParms.count()] = f;
else if(methodArray[f.reqParams.count()] == null)
methodArray[f.reqParams.count()] = f;
else
throw Util.runtimeException("Can't have 2 overloads with same arity");
if(f.prim != null)
prims.add(f.prim);
}
if(variadicMethod != null)
{
for(int i = variadicMethod.reqParms.count() + 1; i <= MAX_POSITIONAL_ARITY; i++)
for(int i = variadicMethod.reqParams.count() + 1; i <= MAX_POSITIONAL_ARITY; i++)
if(methodArray[i] != null)
throw Util.runtimeException(
"Can't have fixed arity function with more params than variadic function");
Expand Down Expand Up @@ -4409,7 +4409,7 @@ void compile(String superName, String[] interfaceNames, boolean oneTimeUse) thro
ctorgen.invokeConstructor(Type.getObjectType(superName), voidctor);
// else if(isVariadic()) //RestFn ctor takes reqArity arg
// {
// ctorgen.push(variadicMethod.reqParms.count());
// ctorgen.push(variadicMethod.reqParams.count());
// ctorgen.invokeConstructor(restFnType, restfnctor);
// }
// else
Expand Down Expand Up @@ -5297,8 +5297,8 @@ enum PSTATE{

public static class FnMethod extends ObjMethod{
//localbinding->localbinding
PersistentVector reqParms = PersistentVector.EMPTY;
LocalBinding restParm = null;
PersistentVector reqParams = PersistentVector.EMPTY;
LocalBinding restParam = null;
Type[] argtypes;
Class[] argclasses;
Class retClass;
Expand Down Expand Up @@ -5339,7 +5339,7 @@ static public String primInterface(IPersistentVector arglist) {

static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
//([args] body...)
IPersistentVector parms = (IPersistentVector) RT.first(form);
IPersistentVector params = (IPersistentVector) RT.first(form);
ISeq body = RT.next(form);
try
{
Expand All @@ -5362,7 +5362,7 @@ static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
,METHOD_RETURN_CONTEXT, RT.T
));

method.prim = primInterface(parms);
method.prim = primInterface(params);
if(method.prim != null)
method.prim = method.prim.replace('.', '/');

Expand All @@ -5376,7 +5376,7 @@ static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
if(!(retstr.equals("long") || retstr.equals("double")))
rettag = null;
}
method.retClass = tagClass(tagOf(parms)!=null?tagOf(parms):rettag);
method.retClass = tagClass(tagOf(params)!=null?tagOf(params):rettag);
if(method.retClass.isPrimitive()){
if(!(method.retClass == double.class || method.retClass == long.class))
throw new IllegalArgumentException("Only long and double primitives are supported");
Expand All @@ -5396,11 +5396,11 @@ static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
PersistentVector argLocals = PersistentVector.EMPTY;
ArrayList<Type> argtypes = new ArrayList();
ArrayList<Class> argclasses = new ArrayList();
for(int i = 0; i < parms.count(); i++)
for(int i = 0; i < params.count(); i++)
{
if(!(parms.nth(i) instanceof Symbol))
if(!(params.nth(i) instanceof Symbol))
throw new IllegalArgumentException("fn params must be Symbols");
Symbol p = (Symbol) parms.nth(i);
Symbol p = (Symbol) params.nth(i);
if(p.getNamespace() != null)
throw Util.runtimeException("Can't use qualified name as parameter: " + p);
if(p.equals(_AMP_))
Expand Down Expand Up @@ -5441,10 +5441,10 @@ static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
switch(state)
{
case REQ:
method.reqParms = method.reqParms.cons(lb);
method.reqParams = method.reqParams.cons(lb);
break;
case REST:
method.restParm = lb;
method.restParam = lb;
state = PSTATE.DONE;
break;

Expand All @@ -5453,7 +5453,7 @@ static FnMethod parse(ObjExpr objx, ISeq form, Object rettag) {
}
}
}
if(method.reqParms.count() > MAX_POSITIONAL_ARITY)
if(method.reqParams.count() > MAX_POSITIONAL_ARITY)
throw Util.runtimeException("Can't specify more than " + MAX_POSITIONAL_ARITY + " params");
LOOP_LOCALS.set(argLocals);
method.argLocals = argLocals;
Expand Down Expand Up @@ -5711,20 +5711,20 @@ public void doEmit(ObjExpr fn, ClassVisitor cv){



public final PersistentVector reqParms(){
return reqParms;
public final PersistentVector reqParams(){
return reqParams;
}

public final LocalBinding restParm(){
return restParm;
public final LocalBinding restParam(){
return restParam;
}

boolean isVariadic(){
return restParm != null;
return restParam != null;
}

int numParams(){
return reqParms.count() + (isVariadic() ? 1 : 0);
return reqParams.count() + (isVariadic() ? 1 : 0);
}

String getMethodName(){
Expand All @@ -5738,7 +5738,7 @@ Type getReturnType(){
}

Type[] getArgTypes(){
if(isVariadic() && reqParms.count() == MAX_POSITIONAL_ARITY)
if(isVariadic() && reqParams.count() == MAX_POSITIONAL_ARITY)
{
Type[] ret = new Type[MAX_POSITIONAL_ARITY + 1];
for(int i = 0;i<MAX_POSITIONAL_ARITY + 1;i++)
Expand Down Expand Up @@ -5962,7 +5962,7 @@ public static class LocalBinding{
public final boolean isArg;
public final PathNode clearPathRoot;
public boolean canBeCleared = !RT.booleanCast(getCompilerOption(disableLocalsClearingKey));
public boolean recurMistmatch = false;
public boolean recurMismatch = false;
public boolean used = false;

public LocalBinding(int num, Symbol sym, Symbol tag, Expr init, boolean isArg,PathNode clearPathRoot)
Expand Down Expand Up @@ -6446,7 +6446,7 @@ else if(maybePrimitiveType(init) == float.class)
for(int i = 0;i< loopLocals.count();i++)
{
LocalBinding lb = (LocalBinding) loopLocals.nth(i);
if(lb.recurMistmatch)
if(lb.recurMismatch)
{
recurMismatches = (IPersistentVector)recurMismatches.assoc(i, RT.T);
moreMismatches = true;
Expand Down Expand Up @@ -6700,7 +6700,7 @@ else if(primc == double.class)
}
if(mismatch)
{
lb.recurMistmatch = true;
lb.recurMismatch = true;
if(RT.booleanCast(RT.WARN_ON_REFLECTION.deref()))
RT.errPrintWriter().println
(source + ":" + line +
Expand Down Expand Up @@ -8023,9 +8023,9 @@ static ObjExpr build(IPersistentVector interfaceSyms, IPersistentVector fieldSym
}
Class superClass = Object.class;
Map[] mc = gatherMethods(superClass,RT.seq(interfaces));
Map overrideables = mc[0];
Map overridables = mc[0];
Map covariants = mc[1];
ret.mmap = overrideables;
ret.mmap = overridables;
ret.covariants = covariants;

String[] inames = interfaceNames(interfaces);
Expand Down Expand Up @@ -8060,7 +8060,7 @@ VAR_CALLSITES, emptyVarCallSites(),
IPersistentCollection methods = null;
for(ISeq s = methodForms; s != null; s = RT.next(s))
{
NewInstanceMethod m = NewInstanceMethod.parse(ret, (ISeq) RT.first(s),thistag, overrideables);
NewInstanceMethod m = NewInstanceMethod.parse(ret, (ISeq) RT.first(s),thistag, overridables);
methods = RT.conj(methods, m);
}

Expand Down Expand Up @@ -8400,7 +8400,7 @@ public static class NewInstanceMethod extends ObjMethod{
Class[] exclasses;

static Symbol dummyThis = Symbol.intern(null,"dummy_this_dlskjsdfower");
private IPersistentVector parms;
private IPersistentVector params;

public NewInstanceMethod(ObjExpr objx, ObjMethod parent){
super(objx, parent);
Expand Down Expand Up @@ -8429,19 +8429,19 @@ static public IPersistentVector msig(String name,Class[] paramTypes){
}

static NewInstanceMethod parse(ObjExpr objx, ISeq form, Symbol thistag,
Map overrideables) {
Map overridables) {
//(methodname [this-name args*] body...)
//this-name might be nil
NewInstanceMethod method = new NewInstanceMethod(objx, (ObjMethod) METHOD.deref());
Symbol dotname = (Symbol)RT.first(form);
Symbol name = (Symbol) Symbol.intern(null,munge(dotname.name)).withMeta(RT.meta(dotname));
IPersistentVector parms = (IPersistentVector) RT.second(form);
if(parms.count() == 0)
IPersistentVector params = (IPersistentVector) RT.second(form);
if(params.count() == 0)
{
throw new IllegalArgumentException("Must supply at least one argument for 'this' in: " + dotname);
}
Symbol thisName = (Symbol) parms.nth(0);
parms = RT.subvec(parms,1,parms.count());
Symbol thisName = (Symbol) params.nth(0);
params = RT.subvec(params,1,params.count());
ISeq body = RT.next(RT.next(form));
try
{
Expand Down Expand Up @@ -8469,16 +8469,16 @@ static NewInstanceMethod parse(ObjExpr objx, ISeq form, Symbol thistag,

PersistentVector argLocals = PersistentVector.EMPTY;
method.retClass = tagClass(tagOf(name));
method.argTypes = new Type[parms.count()];
method.argTypes = new Type[params.count()];
boolean hinted = tagOf(name) != null;
Class[] pclasses = new Class[parms.count()];
Symbol[] psyms = new Symbol[parms.count()];
Class[] pclasses = new Class[params.count()];
Symbol[] psyms = new Symbol[params.count()];

for(int i = 0; i < parms.count(); i++)
for(int i = 0; i < params.count(); i++)
{
if(!(parms.nth(i) instanceof Symbol))
if(!(params.nth(i) instanceof Symbol))
throw new IllegalArgumentException("params must be Symbols");
Symbol p = (Symbol) parms.nth(i);
Symbol p = (Symbol) params.nth(i);
Object tag = tagOf(p);
if(tag != null)
hinted = true;
Expand All @@ -8488,7 +8488,7 @@ static NewInstanceMethod parse(ObjExpr objx, ISeq form, Symbol thistag,
pclasses[i] = pclass;
psyms[i] = p;
}
Map matches = findMethodsWithNameAndArity(name.name, parms.count(), overrideables);
Map matches = findMethodsWithNameAndArity(name.name, params.count(), overridables);
Object mk = msig(name.name, pclasses);
java.lang.reflect.Method m = null;
if(matches.size() > 0)
Expand Down Expand Up @@ -8533,26 +8533,26 @@ static NewInstanceMethod parse(ObjExpr objx, ISeq form, Symbol thistag,
throw new IllegalArgumentException("Can't define method not in interfaces: " + name.name);

//else
//validate unque name+arity among additional methods
//validate unique name+arity among additional methods

method.retType = Type.getType(method.retClass);
method.exclasses = m.getExceptionTypes();

for(int i = 0; i < parms.count(); i++)
for(int i = 0; i < params.count(); i++)
{
LocalBinding lb = registerLocal(psyms[i], null, new MethodParamExpr(pclasses[i]),true);
argLocals = argLocals.assocN(i,lb);
method.argTypes[i] = Type.getType(pclasses[i]);
}
for(int i = 0; i < parms.count(); i++)
for(int i = 0; i < params.count(); i++)
{
if(pclasses[i] == long.class || pclasses[i] == double.class)
getAndIncLocalNum();
}
LOOP_LOCALS.set(argLocals);
method.name = name.name;
method.methodMeta = RT.meta(name);
method.parms = parms;
method.params = params;
method.argLocals = argLocals;
method.body = (new BodyExpr.Parser()).parse(C.RETURN, body);
return method;
Expand Down Expand Up @@ -8603,9 +8603,9 @@ public void emit(ObjExpr obj, ClassVisitor cv){
extypes,
cv);
addAnnotation(gen,methodMeta);
for(int i = 0; i < parms.count(); i++)
for(int i = 0; i < params.count(); i++)
{
IPersistentMap meta = RT.meta(parms.nth(i));
IPersistentMap meta = RT.meta(params.nth(i));
addParameterAnnotation(gen, meta, i);
}
gen.visitCode();
Expand Down
2 changes: 1 addition & 1 deletion test/clojure/test_clojure/java_interop.clj
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
(-> (java.io.ByteArrayOutputStream.)
(java.io.ObjectOutputStream.)
(.writeObject (proxy [Object java.io.Serializable] [])))))
;; Serializable included via inheritence:
;; Serializable included via inheritance:
(is (thrown? java.io.NotSerializableException
(-> (java.io.ByteArrayOutputStream.)
(java.io.ObjectOutputStream.)
Expand Down
Loading
X Tutup