Skip to content

Commit 82a09fc

Browse files
committed
j2s 4.2 Jmol removing StringBuffer, StringBuilder, and
AbstractStringBuilder Also removing java.util.regex as unnecessary for Jmol
1 parent 3a688e5 commit 82a09fc

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed
-2.43 KB
Binary file not shown.

sources/net.sf.j2s.java.core/site-resources_4.2/jsmol/j2s/java/util/AbstractMap.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Clazz.load(["java.util.Map"],"java.util.AbstractMap",["java.lang.StringBuilder","$.UnsupportedOperationException","java.util.AbstractCollection","$.AbstractSet","$.Iterator"],function(){
1+
Clazz.load(["java.util.Map"],"java.util.AbstractMap",["java.lang.UnsupportedOperationException","java.util.AbstractCollection","$.AbstractSet","$.Iterator"],function(){
22
var $fz,c$=Clazz.decorateAsClass(function(){
33
this.$keySet=null;
44
this.valuesCollection=null;
@@ -137,27 +137,26 @@ Clazz.overrideMethod(c$,"toString",
137137
function(){
138138
if(this.isEmpty()){
139139
return"{}";
140-
}var buffer=new StringBuilder(this.size()*28);
141-
buffer.append('{');
140+
}var buffer='{';
142141
var it=this.entrySet().iterator();
143142
while(it.hasNext()){
144143
var entry=it.next();
145144
var key=entry.getKey();
146145
if(key!==this){
147-
buffer.append(key);
146+
buffer += (key);
148147
}else{
149-
buffer.append("(this Map)");
150-
}buffer.append('=');
148+
buffer += ("(this Map)");
149+
}buffer += ('=');
151150
var value=entry.getValue();
152151
if(value!==this){
153-
buffer.append(value);
152+
buffer += (value);
154153
}else{
155-
buffer.append("(this Map)");
154+
buffer += ("(this Map)");
156155
}if(it.hasNext()){
157-
buffer.append(", ");
156+
buffer += (", ");
158157
}}
159-
buffer.append('}');
160-
return buffer.toString();
158+
buffer += ('}');
159+
return buffer;
161160
});
162161
Clazz.overrideMethod(c$,"values",
163162
function(){

sources/net.sf.j2s.java.core/site-resources_4.2/jsmol/j2s/java/util/Hashtable.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ return this.key+"="+this.value;
294294
////////////////////////////
295295

296296

297-
Clazz.load(["java.util.Dictionary","$.Enumeration","$.HashtableEnumerator","$.Iterator","$.Map","$.MapEntry","$.NoSuchElementException"],"java.util.Hashtable",["java.lang.IllegalArgumentException","$.IllegalStateException","$.NullPointerException","$.StringBuilder","java.util.AbstractCollection","$.AbstractSet","$.Arrays","$.Collections","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.HashtableEntry"],function(){
297+
Clazz.load(["java.util.Dictionary","$.Enumeration","$.HashtableEnumerator","$.Iterator","$.Map","$.MapEntry","$.NoSuchElementException"],"java.util.Hashtable",["java.lang.IllegalArgumentException","$.IllegalStateException","$.NullPointerException","java.util.AbstractCollection","$.AbstractSet","$.Arrays","$.Collections","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.HashtableEntry"],function(){
298298
c$=Clazz.decorateAsClass(function(){
299299
this.elementCount=0;
300300
this.elementData=null;
@@ -558,28 +558,27 @@ Clazz.overrideMethod(c$,"toString",
558558
function(){
559559
if(this.isEmpty()){
560560
return"{}";
561-
}var buffer=new StringBuilder(this.size()*28);
562-
buffer.append('{');
561+
}var buffer='{';
563562
for(var i=this.lastSlot;i>=this.firstSlot;i--){
564563
var entry=this.elementData[i];
565564
while(entry!=null){
566565
if(entry.key!==this){
567-
buffer.append(entry.key);
566+
buffer += (entry.key);
568567
}else{
569-
buffer.append("(this Map)");
570-
}buffer.append('=');
568+
buffer += ("(this Map)");
569+
}buffer += ('=');
571570
if(entry.value!==this){
572-
buffer.append(entry.value);
571+
buffer += (entry.value);
573572
}else{
574-
buffer.append("(this Map)");
575-
}buffer.append(", ");
573+
buffer += ("(this Map)");
574+
}buffer += (", ");
576575
entry=entry.next;
577576
}
578577
}
579578
if(this.elementCount>0){
580579
buffer.setLength(buffer.length()-2);
581-
}buffer.append('}');
582-
return buffer.toString();
580+
}buffer += ('}');
581+
return buffer;
583582
});
584583
Clazz.overrideMethod(c$,"values",
585584
function(){

0 commit comments

Comments
 (0)