Reformating to fix checkstyle.

This commit is contained in:
Jindra Petřík
2024-08-07 18:33:17 +02:00
parent a5d3ce4f9b
commit f3da12e032
2432 changed files with 39110 additions and 44808 deletions

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.ClassPath;
/**
* ActionScript 3 class TreeItem.
*
* @author JPEXS
*/
public abstract class AS3ClassTreeItem implements TreeItem {
@@ -42,6 +43,7 @@ public abstract class AS3ClassTreeItem implements TreeItem {
/**
* Constructs AS3ClassTreeItem.
*
* @param name Name
* @param namespaceSuffix Namespace suffix
* @param path Class path
@@ -54,7 +56,8 @@ public abstract class AS3ClassTreeItem implements TreeItem {
/**
* Gets name with namespace suffix.
* @return
*
* @return
*/
public String getNameWithNamespaceSuffix() {
String ret = name;
@@ -66,7 +69,8 @@ public abstract class AS3ClassTreeItem implements TreeItem {
/**
* Gets name with namespace suffix but printable.
* @return
*
* @return
*/
public String getPrintableNameWithNamespaceSuffix() {
String ret = IdentifiersDeobfuscation.printIdentifier(true, name);
@@ -78,7 +82,8 @@ public abstract class AS3ClassTreeItem implements TreeItem {
/**
* Gets class path as string.
* @return
*
* @return
*/
public String getPath() {
return path.toString();
@@ -86,7 +91,8 @@ public abstract class AS3ClassTreeItem implements TreeItem {
/**
* ToString.
* @return
*
* @return
*/
@Override
public String toString() {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -22,6 +22,7 @@ import java.util.List;
/**
* A folder TreeItem - container for items.
*
* @author JPEXS
*/
public class FolderItem implements TreeItem {
@@ -48,6 +49,7 @@ public class FolderItem implements TreeItem {
/**
* Constructs FolderItem
*
* @param str ToString name
* @param name Name
* @param swf SWF
@@ -62,7 +64,8 @@ public class FolderItem implements TreeItem {
/**
* Gets name.
* @return
*
* @return
*/
public String getName() {
return name;
@@ -70,7 +73,8 @@ public class FolderItem implements TreeItem {
/**
* Gets openable.
* @return
*
* @return
*/
@Override
public Openable getOpenable() {
@@ -79,7 +83,8 @@ public class FolderItem implements TreeItem {
/**
* ToString.
* @return
*
* @return
*/
@Override
public String toString() {
@@ -88,7 +93,8 @@ public class FolderItem implements TreeItem {
/**
* Gets modified flag.
* @return
*
* @return
*/
@Override
public boolean isModified() {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF;
/**
* SWF header TreeItem
*
* @author JPEXS
*/
public class HeaderItem implements TreeItem {
@@ -33,7 +34,7 @@ public class HeaderItem implements TreeItem {
* Name for toString
*/
private final String name;
public HeaderItem(SWF swf, String name) {
this.swf = swf;
this.name = name;
@@ -41,7 +42,8 @@ public class HeaderItem implements TreeItem {
/**
* Gets openable.
* @return
*
* @return
*/
@Override
public Openable getOpenable() {
@@ -50,7 +52,8 @@ public class HeaderItem implements TreeItem {
/**
* ToString.
* @return
*
* @return
*/
@Override
public String toString() {
@@ -59,7 +62,8 @@ public class HeaderItem implements TreeItem {
/**
* Gets modified flag.
* @return
*
* @return
*/
@Override
public boolean isModified() {

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -20,70 +20,79 @@ import java.io.IOException;
import java.io.OutputStream;
/**
* An item that can be loaded(opened) in FFDec.
* For example SWF or ABC.
* An item that can be loaded(opened) in FFDec. For example SWF or ABC.
*
* @author JPEXS
*/
public interface Openable extends TreeItem {
/**
* Gets file title.
* @return
*
* @return
*/
public String getFileTitle();
/**
* Gets title with path from root (like in nested SWFs)
* @return
*
* @return
*/
public String getShortPathTitle();
/**
* Gets short file name based on file title and file.
* @return
*
* @return
*/
public String getShortFileName();
/**
* Gets opened file.
*
* @return File or null
*/
public String getFile();
/**
*
* @return
* @return
*/
public String getTitleOrShortFileName();
/**
* Gets title of the file or short filename.
* @return file title or base file name when file title is null or "_" when file is null too
*
* @return file title or base file name when file title is null or "_" when
* file is null too
*/
public String getFullPathTitle();
/**
* Sets OpenableList which this Openable resides.
* @param openableList
*
* @param openableList
*/
public void setOpenableList(OpenableList openableList);
/**
* Gets OpenableList which this Openable resides.
* @return
*
* @return
*/
public OpenableList getOpenableList();
/**
* Saves Openable to stream.
* Saves Openable to stream.
*
* @param os
* @throws IOException
* @throws IOException
*/
public void saveTo(OutputStream os) throws IOException;
/**
* Sets file.
* @param file
*
* @param file
*/
public void setFile(String file);

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -29,6 +29,7 @@ import java.util.ListIterator;
/**
* List of openable items.
*
* @author JPEXS
*/
public class OpenableList implements List<Openable>, SWFContainerItem {
@@ -39,8 +40,7 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
public String name;
/**
* Bundle.
* Can be null.
* Bundle. Can be null.
*/
public Bundle bundle;
@@ -56,15 +56,17 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Checks whether it is bundle.
* @return
*
* @return
*/
public boolean isBundle() {
return bundle != null;
}
/**
* Gets openable.
* @return
*
* @return
*/
@Override
public Openable getOpenable() {
@@ -73,8 +75,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* ToString.
* @return
*/
*
* @return
*/
@Override
public String toString() {
if (isBundle()) {
@@ -86,7 +89,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Iterator.
* @return
*
* @return
*/
@Override
public Iterator<Openable> iterator() {
@@ -95,7 +99,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Gets item count.
* @return
*
* @return
*/
@Override
public int size() {
@@ -104,7 +109,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Checks whether items are empty.
* @return
*
* @return
*/
@Override
public boolean isEmpty() {
@@ -113,8 +119,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Checks whether list contains specific openable.
*
* @param o
* @return
* @return
*/
@Override
public boolean contains(Object o) {
@@ -123,7 +130,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Converts to array.
* @return
*
* @return
*/
@Override
public Object[] toArray() {
@@ -132,9 +140,10 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Converts to array.
*
* @param <T>
* @param ts
* @return
* @return
*/
@Override
public <T> T[] toArray(T[] ts) {
@@ -143,8 +152,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Contains all.
*
* @param clctn
* @return
* @return
*/
@Override
public boolean containsAll(Collection<?> clctn) {
@@ -153,8 +163,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Removes all.
*
* @param clctn
* @return
* @return
*/
@Override
public boolean removeAll(Collection<?> clctn) {
@@ -163,8 +174,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Retains all.
*
* @param clctn
* @return
* @return
*/
@Override
public boolean retainAll(Collection<?> clctn) {
@@ -181,8 +193,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Adds all items.
*
* @param clctn
* @return
* @return
*/
@Override
public boolean addAll(Collection<? extends Openable> clctn) {
@@ -191,9 +204,10 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Adds all items at index.
*
* @param i
* @param clctn
* @return
* @return
*/
@Override
public boolean addAll(int i, Collection<? extends Openable> clctn) {
@@ -202,8 +216,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Gets item at index.
*
* @param i
* @return
* @return
*/
@Override
public Openable get(int i) {
@@ -215,9 +230,10 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Sets item at index.
*
* @param i
* @param e
* @return
* @return
*/
@Override
public Openable set(int i, Openable e) {
@@ -226,8 +242,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Adds item.
*
* @param e
* @return
* @return
*/
@Override
public boolean add(Openable e) {
@@ -236,8 +253,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Adds item at index.
*
* @param i
* @param e
* @param e
*/
@Override
public void add(int i, Openable e) {
@@ -246,8 +264,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Removes item.
*
* @param o
* @return
* @return
*/
@Override
public boolean remove(Object o) {
@@ -256,8 +275,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Removes item at index.
*
* @param i
* @return
* @return
*/
@Override
public Openable remove(int i) {
@@ -266,8 +286,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Index of item.
*
* @param o
* @return
* @return
*/
@Override
public int indexOf(Object o) {
@@ -276,8 +297,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Last index of item.
*
* @param o
* @return
* @return
*/
@Override
public int lastIndexOf(Object o) {
@@ -286,7 +308,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* List iterator.
* @return
*
* @return
*/
@Override
public ListIterator<Openable> listIterator() {
@@ -295,8 +318,9 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* List iterator.
*
* @param i
* @return
* @return
*/
@Override
public ListIterator<Openable> listIterator(int i) {
@@ -305,9 +329,10 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Sublist.
*
* @param i
* @param i1
* @return
* @return
*/
@Override
public List<Openable> subList(int i, int i1) {
@@ -316,7 +341,8 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
/**
* Gets modified flag.
* @return
*
* @return
*/
@Override
public boolean isModified() {
@@ -327,17 +353,16 @@ public class OpenableList implements List<Openable>, SWFContainerItem {
}
return false;
}
/**
* Sets modified flag.
* It marks all items inside as modified.
* Sets modified flag. It marks all items inside as modified.
*/
public void setModified() {
for (Openable openable : this) {
if (openable instanceof SWF) {
SWF swf = (SWF) openable;
swf.setModified(true);
}
}
if (openable instanceof ABC) {
ABC abc = (ABC) openable;
abc.getSwf().setModified(true);

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -18,19 +18,22 @@ package com.jpexs.decompiler.flash.treeitems;
/**
* Basic interface for an item in the tag tree.
*
* @author JPEXS
*/
public interface TreeItem {
/**
* Gets openable which this item resides.
* @return
*
* @return
*/
public Openable getOpenable();
/**
* Gets modified flag.
* @return
*
* @return
*/
public boolean isModified();
}

View File

@@ -1,4 +1,4 @@
/**
* Tree items.
*/
package com.jpexs.decompiler.flash.treeitems;
package com.jpexs.decompiler.flash.treeitems;