Spelling fixes

This commit is contained in:
Jindra Petřík
2025-09-06 02:21:46 +02:00
parent 5e81e03dc6
commit 3b82db57ba
49 changed files with 150 additions and 148 deletions
@@ -879,8 +879,8 @@ public class IdentifiersDeobfuscation {
}
public static Map<String, String> getReplacementsFromDoc(String s) throws Exception {
ActionScriptDocParser asd = new ActionScriptDocParser();
List<AsDocComment> comments = asd.parse(s);
ActionScriptDocParser docParser = new ActionScriptDocParser();
List<AsDocComment> comments = docParser.parse(s);
Map<String, String> replacements = new LinkedHashMap<>();
for (AsDocComment comment : comments) {
for (AsDocTag tag : comment.tags) {
@@ -29,7 +29,7 @@ public abstract class ParseException extends Exception {
public long line;
/**
* Position in the code where the exception occured. -1 where unknown
* Position in the code where the exception occurred. -1 where unknown
*/
public long position = -1;
@@ -576,7 +576,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
private volatile Map<String, Map<String, com.jpexs.decompiler.flash.action.as2.Trait>> uninitializedAs2ClassTraits = null;
/**
* Detecting uninitilized class fields
* Detecting uninitialized class fields
*/
@Internal
private boolean detectingUninitializedClassFields = false;
@@ -761,7 +761,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
try {
SWF.initPlayer();
} catch (IOException ex) {
Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, "IOException during SWF.initplayer", ex);
Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, "IOException during SWF.initPlayer", ex);
} catch (InterruptedException ex) {
return new AbcIndexing();
}
@@ -3773,11 +3773,11 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
continue;
}
ip = code.adr2pos(addr);
long nextaddr = addr + size;
int nextip = code.adr2pos(nextaddr);
getVariables(swf, aLocalData.insideDoInitAction, variables, functions, strings, usageTypes, new ActionGraphSource(path, aLocalData.insideDoInitAction, code.getActions().subList(0, nextip), code.version, new HashMap<>(), new HashMap<>(), new HashMap<>(), code.getCharset(), ip), addr, path + (cntName == null ? "" : "/" + cntName));
ip = nextip;
addr = nextaddr;
long nextAddr = addr + size;
int nextIp = code.adr2pos(nextAddr);
getVariables(swf, aLocalData.insideDoInitAction, variables, functions, strings, usageTypes, new ActionGraphSource(path, aLocalData.insideDoInitAction, code.getActions().subList(0, nextIp), code.version, new HashMap<>(), new HashMap<>(), new HashMap<>(), code.getCharset(), ip), addr, path + (cntName == null ? "" : "/" + cntName));
ip = nextIp;
addr = nextAddr;
}
List<List<GraphTargetItem>> r = new ArrayList<>();
r.add(new ArrayList<>());
@@ -6306,7 +6306,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
* @return Map of class name to map of trait name to trait
*/
public Map<String, Map<String, com.jpexs.decompiler.flash.action.as2.Trait>> getUninitializedAs2ClassTraits() throws InterruptedException {
if (Configuration.skipDetectionOfUnitializedClassFields.get()) {
if (Configuration.skipDetectionOfUninitializedClassFields.get()) {
return new LinkedHashMap<>();
}
if (CancellableWorker.isInterrupted()) {
@@ -659,7 +659,7 @@ public class ActionGraph extends Graph {
if (insideDoInitAction && !insideFunction) {
ActionScript2ClassDetector detector = new ActionScript2ClassDetector();
detector.checkClass(uninitializedClassTraits, ret, ((ActionGraphSource) code).getVariables(), path);
if (needsUninitializedClassFieldsDetection && Configuration.skipDetectionOfUnitializedClassFields.get()) {
if (needsUninitializedClassFieldsDetection && Configuration.skipDetectionOfUninitializedClassFields.get()) {
ret.add(0, new CommentItem(AppResources.translate("decompilationWarning.as2.noUninitializedClassFieldsDetection")));
}
}
@@ -118,7 +118,7 @@ public class FunctionActionItem extends ActionItem implements BranchStackResista
private List<FunctionActionItem> innerFunctions;
/**
* Parameter positions in the codde
* Parameter positions in the code
*/
public List<Integer> paramPositions;
@@ -38,7 +38,7 @@ public class ActionParseException extends ParseException {
* Constructs a new parse exception.
* @param text Text of the exception
* @param line Line number where the exception occurred
* @param position Position where the exception occured
* @param position Position where the exception occurred
*/
public ActionParseException(String text, long line, long position) {
super(text, line, position);
@@ -922,7 +922,7 @@ public class ActionSourceGenerator implements SourceGenerator {
int whileJumpOffset = -(whileExprLen + whileBodyLen);
if (whileJumpOffset < -32768) {
throw new CompilationException("Generated offset for While is lower than mininum allowed for SI16.", item.line);
throw new CompilationException("Generated offset for While is lower than minimum allowed for SI16.", item.line);
}
whileajmp.setJumpOffset(whileJumpOffset);
whileaif.setJumpOffset(whileBodyLen);
@@ -954,7 +954,7 @@ public class ActionSourceGenerator implements SourceGenerator {
ret.add(doif);
int offset = doBodyLen + doExprLen + doif.getTotalActionLength();
if (-offset < -32768) {
throw new CompilationException("Generated offset for DoWhile is lower than mininum allowed for SI16.", item.line);
throw new CompilationException("Generated offset for DoWhile is lower than minimum allowed for SI16.", item.line);
}
doif.setJumpOffset(-offset);
@@ -980,7 +980,7 @@ public class ActionSourceGenerator implements SourceGenerator {
int jmpOffset = -(forExprLen + forBodyLen + forFinalLen + forajmpLen);
int ifOffset = forBodyLen + forFinalLen + forajmpLen;
if (jmpOffset < -32768) {
throw new CompilationException("Generated offset for For is lower than mininum allowed for SI16.", item.line);
throw new CompilationException("Generated offset for For is lower than minimum allowed for SI16.", item.line);
}
if (ifOffset > 32767) {
throw new CompilationException("Generated offset for For is larger than maximum allowed for SI16.", item.line);
@@ -1202,7 +1202,7 @@ public class ActionSourceGenerator implements SourceGenerator {
private int checkOffsetBounds(int offset, String errorItem, int errorLine) throws CompilationException {
if (offset < -32768) {
throw new CompilationException("Generated offset for " + errorItem + " is lower than mininum allowed for SI16.", errorLine);
throw new CompilationException("Generated offset for " + errorItem + " is lower than minimum allowed for SI16.", errorLine);
}
if (offset > 32767) {
throw new CompilationException("Generated offset for " + errorItem + " is larger than maximum allowed for SI16.", errorLine);
@@ -1148,7 +1148,7 @@ public final class Configuration {
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("script")
public static ConfigurationItem<Boolean> skipDetectionOfUnitializedClassFields = null;
public static ConfigurationItem<Boolean> skipDetectionOfUninitializedClassFields = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationInternal
@@ -1177,12 +1177,12 @@ public final class Configuration {
Configuration.configurationTitles = configurationTitles;
}
public static String getConfigurationTitle(String confirationName) {
return configurationTitles.get(confirationName);
public static String getConfigurationTitle(String configurationName) {
return configurationTitles.get(configurationName);
}
public static String getConfigurationDescription(String confirationName) {
return configurationDescriptions.get(confirationName);
public static String getConfigurationDescription(String configurationName) {
return configurationDescriptions.get(configurationName);
}
public static Font getSourceFont() {
@@ -50,7 +50,7 @@ import org.tomlj.TomlParseResult;
import org.tomlj.TomlTable;
/**
* TOML file confiraration storage.
* TOML file configuration storage.
* @author JPEXS
*/
public class TomlConfigurationStorage implements ConfigurationStorage {
@@ -113,7 +113,7 @@ public class AS2ScriptExporter {
@Override
public void status(String status) {
if (evl != null) {
evl.handleEvent("unitializedClassFields", status);
evl.handleEvent("uninitializedClassFields", status);
}
}
};
@@ -96,7 +96,7 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter {
* @param defaultColor Default color
* @param colorTransform Color transform
* @param zoom Zoom - shape zoom
* @param displayZoom Display zoom - overal SVG zoom
* @param displayZoom Display zoom - overall SVG zoom
* @param strokeTransformation Stroke transformation
*/
public SVGShapeExporter(int windingRule, int shapeNum, SWF swf, SHAPE shape, int id, SVGExporter exporter, Color defaultColor, ColorTransform colorTransform, double zoom, double displayZoom, Matrix strokeTransformation) {
@@ -38,7 +38,7 @@ public class SimpleParseException extends ParseException {
* Constructs a new parse exception.
* @param text Text of the exception
* @param line Line number where the exception occurred
* @param position Position where the exception occured
* @param position Position where the exception occurred
*/
public SimpleParseException(String text, long line, long position) {
super(text, line, position);
@@ -160,7 +160,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
actions = getActions();
}
return Action.actionsToSource(requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), this, actions, getScriptName(), writer, getCharset());
return Action.actionsToSource(requiresUninitializedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), this, actions, getScriptName(), writer, getCharset());
}
@Override
@@ -169,10 +169,10 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
actions = getActions();
}
return Action.actionsToSource(requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), this, actions, getScriptName(), writer, getCharset(), treeOperations);
return Action.actionsToSource(requiresUninitializedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), this, actions, getScriptName(), writer, getCharset(), treeOperations);
}
private boolean requiresUninitielizedClassTraitsDetection() {
private boolean requiresUninitializedClassTraitsDetection() {
return swf.needsCalculatingAS2UninitializeClassTraits(this);
}
@@ -301,7 +301,7 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource {
@Override
public List<GraphTargetItem> getActionsToTree() {
try {
return Action.actionsToTree(new LinkedHashSet<>(), requiresUninitielizedClassTraitsDetection(), requiresUninitielizedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), true, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
return Action.actionsToTree(new LinkedHashSet<>(), requiresUninitializedClassTraitsDetection(), requiresUninitializedClassTraitsDetection() ? swf.getUninitializedAs2ClassTraits() : new HashMap<>(), true, false, getActions(), swf.version, 0, getScriptName(), swf.getCharset());
} catch (InterruptedException ex) {
return new ArrayList<>();
}
@@ -87,6 +87,7 @@ public class TagStub extends Tag {
TagTypeInfo selectedTagTypeInfo = classes.get(id).get(0);
if (classes.get(id).size() > 1) {
for (TagTypeInfo tagTypeInfo : classes.get(id)) {
@SuppressWarnings("unchecked")
SWFVersion ver = (SWFVersion) tagTypeInfo.getCls().getAnnotation(SWFVersion.class);
if (swfVersion >= ver.from() && swfVersion <= ver.to()) {
selectedTagTypeInfo = tagTypeInfo;
@@ -87,7 +87,7 @@ public class RenderContext {
public int glyphPosUnderCursor = -1;
/**
* Bouding rect of the glyph under cursor
* Bounding rect of the glyph under cursor
*/
public Rectangle2D glyphUnderCursorRect = null;
@@ -57,7 +57,7 @@ public class AS3Package extends AS3ClassTreeItem {
*/
@SuppressWarnings("unchecked")
private final Map<String, AS3Package> subPackages = new TreeMap<>(new Comparator<String>() {
NaturalOrderComparator noc = new NaturalOrderComparator();
NaturalOrderComparator naturalOrderComparator = new NaturalOrderComparator();
@Override
@@ -71,7 +71,7 @@ public class AS3Package extends AS3ClassTreeItem {
if (DEFAULT_PACKAGE_NAME.equals(o2)) {
return 1;
}
return noc.compare(o1, o2);
return naturalOrderComparator.compare(o1, o2);
}
}
);
@@ -324,7 +324,7 @@ public class ColorMatrixConvertor {
double h;
double s;
//Magic formulas calculated long time ago with Wolphram Alpha.
//Magic formulas calculated long time ago with Wolfram Alpha.
b = (24872168661075.0 * a11 * a11 - 151430415740925.0 * a12 + 341095051289483.0 * a12 * a12 - 15302094789450.0 * a13 + 82428663495404.0 * a12 * a13
- 4592294873812.0 * a13 * a13 + 43556251470.0 * Math.sqrt(216225 * a11 * a11 + 332369 * a12 * a12 - 397828 * a12 * a13 + 281684 * a13 * a13
- 930 * a11 * (287 * a12 + 178 * a13)) + 2384730956550.0 * a12 * a41 + 240977870700.0 * a13 * a41
@@ -1698,12 +1698,12 @@ public class Graph {
for (Loop el : loops) {
el.backEdges.clear();
Set<GraphPart> uniqueRefs = new HashSet<>(el.loopContinue.refs);
loopr:
loopR:
for (GraphPart r : uniqueRefs) {
for (Loop el2 : loops) {
if (el2.phase == 1) {
if (el2.loopContinue == r) {
continue loopr;
continue loopR;
}
}
}
@@ -2849,22 +2849,22 @@ public class Graph {
}
//When some of breakcandidates pass through current stoppart,
//Remove other candidantes.
//When some of breakcandidates pass through current stopPart,
//Remove other candidates.
Set<GraphPart> removedX = new LinkedHashSet<>();
if (!currentLoop.stopParts.isEmpty()) {
List<Integer> bcsLeft = new ArrayList<>();
List<Integer> breakCandidatesLeft = new ArrayList<>();
for (int c = 0; c < currentLoop.breakCandidates.size(); c++) {
GraphPart cand = currentLoop.breakCandidates.get(c);
GraphPart sp = currentLoop.stopParts.get(currentLoop.stopParts.size() - 1);
if (cand == sp || cand.leadsTo(localData, this, code, sp, new ArrayList<>() /*ingore existing loop states*/, throwStates, false /* ?? */)) {
bcsLeft.add(c);
if (cand == sp || cand.leadsTo(localData, this, code, sp, new ArrayList<>() /*ignore existing loop states*/, throwStates, false /* ?? */)) {
breakCandidatesLeft.add(c);
}
}
if (!bcsLeft.isEmpty()) {
if (!breakCandidatesLeft.isEmpty()) {
for (int c = currentLoop.breakCandidates.size() - 1; c >= 0; c--) {
if (!bcsLeft.contains(c)) {
if (!breakCandidatesLeft.contains(c)) {
GraphPart cand = currentLoop.breakCandidates.get(c);
removedX.add(cand);
}
@@ -1152,7 +1152,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks set temporary at the end of output and expected dupSource, dup.
* Then removes the last output command when neccessary.
* Then removes the last output command when necessary.
*
* @param stack Stack
* @param output Output
@@ -1188,7 +1188,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
/**
* Checks whether items are result of dup instruction and removes
* SetTemportary from output when neccessary
* SetTemporary from output when necessary
*
* @param item1
* @param item2