mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Additional logging for verification (compile server).
This commit is contained in:
@@ -273,7 +273,6 @@ public class ClassRepr extends Proto {
|
||||
|
||||
public String getPackageName(final int s) {
|
||||
return getPackageName(context.getValue(s));
|
||||
|
||||
}
|
||||
|
||||
public static String getPackageName(final String raw) {
|
||||
@@ -296,8 +295,8 @@ public class ClassRepr extends Proto {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Collection<MethodRepr> findMethods (final MethodRepr.Predicate p) {
|
||||
final Collection<MethodRepr> result = new LinkedList<MethodRepr> ();
|
||||
public Collection<MethodRepr> findMethods(final MethodRepr.Predicate p) {
|
||||
final Collection<MethodRepr> result = new LinkedList<MethodRepr>();
|
||||
|
||||
for (MethodRepr mm : methods) {
|
||||
if (p.satisfy(mm)) {
|
||||
@@ -321,4 +320,113 @@ public class ClassRepr extends Proto {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBuffer(final DependencyContext context, final StringBuffer buf) {
|
||||
super.toBuffer(context, buf);
|
||||
|
||||
buf.append(" Filename : ");
|
||||
buf.append(context.getValue(fileName));
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Superclass : ");
|
||||
buf.append(superClass == null ? "<null>" : superClass.getDescr(context));
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Interfaces : ");
|
||||
final TypeRepr.AbstractType[] is = interfaces.toArray(new TypeRepr.AbstractType[interfaces.size()]);
|
||||
Arrays.sort(is, new Comparator<TypeRepr.AbstractType>() {
|
||||
@Override
|
||||
public int compare(final TypeRepr.AbstractType o1, final TypeRepr.AbstractType o2) {
|
||||
return o1.getDescr(context).compareTo(o2.getDescr(context));
|
||||
}
|
||||
});
|
||||
for (final TypeRepr.AbstractType t : is) {
|
||||
buf.append(t.getDescr(context));
|
||||
buf.append("; ");
|
||||
}
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Targets : ");
|
||||
final ElemType[] es = targets.toArray(new ElemType[targets.size()]);
|
||||
Arrays.sort(es);
|
||||
for (final ElemType e : es) {
|
||||
buf.append(e);
|
||||
buf.append("; ");
|
||||
}
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Policy : ");
|
||||
buf.append(policy);
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Outer class: ");
|
||||
buf.append(context.getValue(outerClassName));
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Local class: ");
|
||||
buf.append(isLocal);
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Fields:\n");
|
||||
final FieldRepr[] fs = fields.toArray(new FieldRepr[fields.size()]);
|
||||
Arrays.sort(fs, new Comparator<FieldRepr>() {
|
||||
@Override
|
||||
public int compare(final FieldRepr o1, final FieldRepr o2) {
|
||||
if (o1.name == o2.name) {
|
||||
return o1.type.getDescr(context).compareTo(o2.type.getDescr(context));
|
||||
}
|
||||
|
||||
return o1.name - o2.name;
|
||||
}
|
||||
});
|
||||
for (final FieldRepr f : fs) {
|
||||
f.toBuffer(context, buf);
|
||||
}
|
||||
buf.append(" End Of Fields\n");
|
||||
|
||||
buf.append(" Methods:\n");
|
||||
final MethodRepr[] ms = methods.toArray(new MethodRepr[methods.size()]);
|
||||
Arrays.sort(ms, new Comparator<MethodRepr>() {
|
||||
@Override
|
||||
public int compare(final MethodRepr o1, final MethodRepr o2) {
|
||||
if (o1.name == o2.name) {
|
||||
final String d1 = o1.type.getDescr(context);
|
||||
final String d2 = o2.type.getDescr(context);
|
||||
|
||||
final int c = d1.compareTo(d2);
|
||||
|
||||
if (c == 0) {
|
||||
final int l1 = o1.argumentTypes.length;
|
||||
final int l2 = o2.argumentTypes.length;
|
||||
|
||||
if (l1 == l2) {
|
||||
for (int i = 0; i<l1; i++) {
|
||||
final String d11 = o1.argumentTypes[i].getDescr(context);
|
||||
final String d22 = o2.argumentTypes[i].getDescr(context);
|
||||
|
||||
final int cc = d11.compareTo(d22);
|
||||
|
||||
if (cc != 0) {
|
||||
return cc;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return l1 -l2;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
return o1.name - o2.name;
|
||||
}
|
||||
});
|
||||
for (final MethodRepr m : ms) {
|
||||
m.toBuffer(context, buf);
|
||||
}
|
||||
buf.append(" End Of Methods\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import gnu.trove.TIntIntProcedure;
|
||||
* Time: 23:48
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
abstract class IntIntMaplet {
|
||||
abstract class IntIntMaplet implements StringBufferizable{
|
||||
abstract boolean containsKey(final int key);
|
||||
abstract int get(final int key);
|
||||
abstract void put(final int key, final int value);
|
||||
@@ -33,7 +33,8 @@ abstract class IntIntMaplet {
|
||||
abstract void close();
|
||||
abstract void forEachEntry(TIntIntProcedure proc);
|
||||
abstract void flush(boolean memoryCachesOnly);
|
||||
void toBuffer (final DependencyContext context, final StringBuffer buf) {
|
||||
|
||||
public void toBuffer (final DependencyContext context, final StringBuffer buf) {
|
||||
forEachEntry(new TIntIntProcedure() {
|
||||
@Override
|
||||
public boolean execute(final int a, final int b) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import gnu.trove.TIntProcedure;
|
||||
* Time: 21:01
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
abstract class IntIntMultiMaplet {
|
||||
abstract class IntIntMultiMaplet implements StringBufferizable{
|
||||
abstract boolean containsKey(final int key);
|
||||
|
||||
abstract TIntHashSet get(final int key);
|
||||
@@ -53,7 +53,7 @@ abstract class IntIntMultiMaplet {
|
||||
|
||||
abstract void flush(boolean memoryCachesOnly);
|
||||
|
||||
void toBuffer(final DependencyContext context, final StringBuffer buf) {
|
||||
public void toBuffer(final DependencyContext context, final StringBuffer buf) {
|
||||
forEachEntry(new TIntObjectProcedure<TIntHashSet>() {
|
||||
@Override
|
||||
public boolean execute(final int a, final TIntHashSet b) {
|
||||
|
||||
@@ -26,19 +26,48 @@ import java.util.Collection;
|
||||
* Time: 21:01
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
interface IntObjectMultiMaplet<V> {
|
||||
boolean containsKey(final int key);
|
||||
Collection<V> get(final int key);
|
||||
void put(final int key, final V value);
|
||||
void put(final int key, final Collection<V> value);
|
||||
void replace(final int key, final Collection<V> value);
|
||||
void putAll(IntObjectMultiMaplet<V> m);
|
||||
void replaceAll(IntObjectMultiMaplet<V> m);
|
||||
void remove(final int key);
|
||||
void removeFrom(final int key, final V value);
|
||||
void removeAll(final int key, final Collection<V> value);
|
||||
void close();
|
||||
abstract class IntObjectMultiMaplet<V extends StringBufferizable> implements StringBufferizable {
|
||||
abstract boolean containsKey(final int key);
|
||||
|
||||
void forEachEntry(TIntObjectProcedure<Collection<V>> procedure);
|
||||
void flush(boolean memoryCachesOnly);
|
||||
abstract Collection<V> get(final int key);
|
||||
|
||||
abstract void put(final int key, final V value);
|
||||
|
||||
abstract void put(final int key, final Collection<V> value);
|
||||
|
||||
abstract void replace(final int key, final Collection<V> value);
|
||||
|
||||
abstract void putAll(IntObjectMultiMaplet<V> m);
|
||||
|
||||
abstract void replaceAll(IntObjectMultiMaplet<V> m);
|
||||
|
||||
abstract void remove(final int key);
|
||||
|
||||
abstract void removeFrom(final int key, final V value);
|
||||
|
||||
abstract void removeAll(final int key, final Collection<V> value);
|
||||
|
||||
abstract void close();
|
||||
|
||||
abstract void forEachEntry(TIntObjectProcedure<Collection<V>> procedure);
|
||||
|
||||
abstract void flush(boolean memoryCachesOnly);
|
||||
|
||||
public void toBuffer(final DependencyContext context, final StringBuffer buf) {
|
||||
forEachEntry(new TIntObjectProcedure<Collection<V>>() {
|
||||
@Override
|
||||
public boolean execute(final int a, final Collection<V> b) {
|
||||
buf.append(" Key: ");
|
||||
buf.append(context.getValue(a));
|
||||
buf.append("\n Values:\n");
|
||||
|
||||
for (final V value : b) {
|
||||
value.toBuffer(context, buf);
|
||||
}
|
||||
|
||||
buf.append(" End Of Values\n");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import java.util.Collections;
|
||||
* Time: 15:38
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
class IntObjectPersistentMultiMaplet<V> implements IntObjectMultiMaplet<V> {
|
||||
class IntObjectPersistentMultiMaplet<V extends StringBufferizable> extends IntObjectMultiMaplet<V> {
|
||||
private static final Collection NULL_COLLECTION = Collections.emptySet();
|
||||
private static final int CACHE_SIZE = 128;
|
||||
private final PersistentHashMap<Integer, Collection<V>> myMap;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Collection;
|
||||
* Time: 15:38
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
class IntObjectTransientMultiMaplet<V> implements IntObjectMultiMaplet<V> {
|
||||
class IntObjectTransientMultiMaplet<V extends StringBufferizable> extends IntObjectMultiMaplet<V> {
|
||||
|
||||
private final TIntObjectHashMap<Collection<V>> myMap = new TIntObjectHashMap<Collection<V>>();
|
||||
private final CollectionFactory<V> myCollectionFactory;
|
||||
|
||||
@@ -2049,4 +2049,36 @@ public class Mappings {
|
||||
private void debug(final String comment, final boolean s) {
|
||||
myDebugS.debug(comment, s);
|
||||
}
|
||||
|
||||
public void toBuffer(final StringBuffer buf) {
|
||||
final StringBufferizable[] data = {
|
||||
myClassToSubclasses,
|
||||
myClassToClassDependency,
|
||||
mySourceFileToClasses,
|
||||
mySourceFileToAnnotationUsages,
|
||||
mySourceFileToUsages,
|
||||
myClassToSourceFile
|
||||
};
|
||||
|
||||
final String[] info = {
|
||||
"ClassToSubclasses",
|
||||
"ClassToClassDependency",
|
||||
"SourceFileToClasses",
|
||||
"SourceFileToAnnotationUsages",
|
||||
"SourceFileToUsages",
|
||||
"ClassToSourceFile"
|
||||
};
|
||||
|
||||
for (int i = 0; i<data.length; i++) {
|
||||
buf.append("Begin Of ");
|
||||
buf.append(info[i]);
|
||||
buf.append("\n");
|
||||
|
||||
data[i].toBuffer(myContext, buf);
|
||||
|
||||
buf.append("End Of ");
|
||||
buf.append(info[i]);
|
||||
buf.append("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -19,7 +20,6 @@ import java.util.Set;
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
class MethodRepr extends ProtoMember {
|
||||
|
||||
interface Predicate {
|
||||
boolean satisfy(MethodRepr m);
|
||||
}
|
||||
@@ -107,7 +107,13 @@ class MethodRepr extends ProtoMember {
|
||||
}
|
||||
}
|
||||
|
||||
public MethodRepr(final DependencyContext context, final int a, final int n, final int s, final String d, final String[] e, final Object value) {
|
||||
public MethodRepr(final DependencyContext context,
|
||||
final int a,
|
||||
final int n,
|
||||
final int s,
|
||||
final String d,
|
||||
final String[] e,
|
||||
final Object value) {
|
||||
super(a, s, n, TypeRepr.getType(context, Type.getReturnType(d)), value);
|
||||
exceptions = (Set<TypeRepr.AbstractType>)TypeRepr.createClassType(context, e, new HashSet<TypeRepr.AbstractType>());
|
||||
argumentTypes = TypeRepr.getType(context, Type.getArgumentTypes(d));
|
||||
@@ -194,4 +200,29 @@ class MethodRepr extends ProtoMember {
|
||||
public UsageRepr.Usage createMetaUsage(final DependencyContext context, final int owner) {
|
||||
return UsageRepr.createMetaMethodUsage(context, name, owner, getDescr(context));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBuffer(final DependencyContext context, final StringBuffer buf) {
|
||||
super.toBuffer(context, buf);
|
||||
buf.append(" Arguments : ");
|
||||
for (TypeRepr.AbstractType t : argumentTypes) {
|
||||
buf.append(t.getDescr(context));
|
||||
buf.append("; ");
|
||||
}
|
||||
buf.append("\n");
|
||||
|
||||
final TypeRepr.AbstractType[] es = exceptions.toArray(new TypeRepr.AbstractType[exceptions.size()]);
|
||||
Arrays.sort(es, new Comparator<TypeRepr.AbstractType>() {
|
||||
@Override
|
||||
public int compare(final TypeRepr.AbstractType o1, final TypeRepr.AbstractType o2) {
|
||||
return o1.getDescr(context).compareTo(o2.getDescr(context));
|
||||
}
|
||||
});
|
||||
buf.append(" Exceptions: ");
|
||||
for (final TypeRepr.AbstractType e : es) {
|
||||
buf.append(e.getDescr(context));
|
||||
buf.append("; ");
|
||||
}
|
||||
buf.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
* Time: 17:57
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
class Proto implements RW.Savable {
|
||||
class Proto implements RW.Savable, StringBufferizable {
|
||||
public final int access;
|
||||
public final int signature;
|
||||
public final int name;
|
||||
@@ -101,4 +101,18 @@ class Proto implements RW.Savable {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void toBuffer (final DependencyContext context, final StringBuffer buf) {
|
||||
buf.append(" Access : ");
|
||||
buf.append(access);
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Signature: ");
|
||||
buf.append(context.getValue(signature));
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Name : ");
|
||||
buf.append(context.getValue(name));
|
||||
buf.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,4 +179,15 @@ abstract class ProtoMember extends Proto {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void toBuffer (final DependencyContext context, final StringBuffer buf) {
|
||||
super.toBuffer(context, buf);
|
||||
buf.append(" Type : ");
|
||||
buf.append(type.getDescr(context));
|
||||
buf.append("\n");
|
||||
|
||||
buf.append(" Value : ");
|
||||
buf.append(value == null ? "<null>" : value.toString());
|
||||
buf.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jetbrains.ether.dependencyView;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: db
|
||||
* Date: 24.04.12
|
||||
* Time: 0:44
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
|
||||
interface StringBufferizable {
|
||||
void toBuffer(DependencyContext context, StringBuffer buf);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class UsageRepr {
|
||||
|
||||
}
|
||||
|
||||
public static class Cluster implements RW.Savable {
|
||||
public static class Cluster implements RW.Savable, StringBufferizable {
|
||||
private final Map<Usage, TIntHashSet> myUsageToDependenciesMap = new HashMap<Usage, TIntHashSet>(DEFAULT_SET_CAPACITY, DEFAULT_SET_LOAD_FACTOR);
|
||||
|
||||
public Cluster() {
|
||||
@@ -126,10 +126,20 @@ class UsageRepr {
|
||||
public int hashCode() {
|
||||
return myUsageToDependenciesMap.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBuffer(DependencyContext context, StringBuffer buf) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Usage implements RW.Savable {
|
||||
public static abstract class Usage implements RW.Savable, StringBufferizable {
|
||||
public abstract int getOwner();
|
||||
|
||||
@Override
|
||||
public void toBuffer(DependencyContext context, StringBuffer buf) {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class FMUsage extends Usage {
|
||||
|
||||
Reference in New Issue
Block a user