diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..4a8dca2e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,6 @@
+# Handle line endings automatically for files detected as text
+# and leave all files detected as binary untouched.
+* text=auto
+
+# Never modify line endings of our bash scripts
+*.sh -crlf
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 9425ec19..527b2a4b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,4 @@
-/**/bin/**/*
-/./**/bin/**/*
-./**/bin/**/*
-**/bin/**/*
-*/bin/**/*
-bin/**/*
-/**/bin/*
-/bin/
+.project
+**/bin/
+**/target
+**/.tycho-consumer-pom.xml
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..99f26c02
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/ Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at https://www.eclipse.org/legal/epl-v10.html.
For purposes of the EPL, "Program" will mean the Content. Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
@@ -53,9 +53,9 @@ 
Usage Of Content
Applicable Licenses
Applicable Licenses
OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
Runtime.exec() on jad executable with selected
- * options.
- *
- * @see IDecompiler#decompile(String, String, String)
- */
- @Override
- public void decompile( String root, String packege, String className )
- {
- start = System.currentTimeMillis( );
- log = ""; //$NON-NLS-1$
- source = ""; //$NON-NLS-1$
- File workingDir = new File( root + "/" + packege ); //$NON-NLS-1$
-
- String classPathStr = new File( workingDir, className ).getAbsolutePath( );
-
- GetOptParser getOptParser = new GetOptParser( );
-
- try
- {
- Options options = getOptParser.parse( new String[]{
- classPathStr
- }, OptionsImpl.getFactory( ) );
- ClassFileSource classFileSource = new ClassFileSourceImpl( options );
- DCCommonState dcCommonState = new DCCommonState( options, classFileSource );
-
- IllegalIdentifierDump illegalIdentifierDump = IllegalIdentifierDump.Factory.get( options );
-
- ClassFile c = dcCommonState.getClassFileMaybePath( options.getOption( OptionsImpl.FILENAME ) );
- dcCommonState.configureWith( c );
- try
- {
- c = dcCommonState.getClassFile( c.getClassType( ) );
- }
- catch ( CannotLoadClassException e )
- {
- }
- if ( options.getOption( OptionsImpl.DECOMPILE_INNER_CLASSES ).booleanValue( ) )
- {
- c.loadInnerClasses( dcCommonState );
- }
-
- c.analyseTop( dcCommonState );
-
- TypeUsageCollector collectingDumper = new TypeUsageCollector( c );
- c.collectTypeUsages( collectingDumper );
-
- StringDumper dumper = new StringDumper( collectingDumper.getTypeUsageInformation( ),
- options,
- illegalIdentifierDump );
- c.dump( dumper );
-
- source = UnicodeUtil.decode( dumper.toString( ).trim( ) );
-
- Pattern wp = Pattern.compile( "/\\*.+?\\*/", Pattern.DOTALL ); //$NON-NLS-1$
- Matcher m = wp.matcher( source );
- while ( m.find( ) )
- {
- if ( m.group( ).matches( "/\\*\\s+\\d*\\s+\\*/" ) ) //$NON-NLS-1$
- continue;
- String group = m.group( );
- group = group.replace( "/*", "" ); //$NON-NLS-1$ //$NON-NLS-2$
- group = group.replace( "*/", "" ); //$NON-NLS-1$ //$NON-NLS-2$
- group = group.replace( "*", "" ); //$NON-NLS-1$ //$NON-NLS-2$
- if ( log.length( ) > 0 )
- log += "\n"; //$NON-NLS-1$
- log += group;
-
- source = source.replace( m.group( ), "" ).trim( ); //$NON-NLS-1$
- }
- dumper.close( );
- }
- catch ( Exception e )
- {
- JavaDecompilerPlugin.logError( e, e.getMessage( ) );
- }
-
- time = System.currentTimeMillis( ) - start;
- }
-
- /**
- * Jad doesn't support decompilation from archives. This methods extracts
- * request class file from the specified archive into temp directory and
- * then calls decompile.
- *
- * @see IDecompiler#decompileFromArchive(String, String, String)
- */
- @Override
- public void decompileFromArchive( String archivePath, String packege, String className )
- {
- start = System.currentTimeMillis( );
- File workingDir = new File(
- JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR )
- + "/" //$NON-NLS-1$
- + System.currentTimeMillis( ) );
-
- try
- {
- workingDir.mkdirs( );
- JarClassExtractor.extract( archivePath, packege, className, true, workingDir.getAbsolutePath( ) );
- decompile( workingDir.getAbsolutePath( ), "", className ); //$NON-NLS-1$
- }
- catch ( Exception e )
- {
- JavaDecompilerPlugin.logError( e, e.getMessage( ) );
- return;
- }
- finally
- {
- FileUtil.deltree( workingDir );
- }
- }
-
- @Override
- public long getDecompilationTime( )
- {
- return time;
- }
-
- @Override
- public List getExceptions( )
- {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @see IDecompiler#getLog()
- */
- @Override
- public String getLog( )
- {
- return log;
- }
-
- /**
- * @see IDecompiler#getSource()
- */
- @Override
- public String getSource( )
- {
- return source;
- }
-
- @Override
- public String getDecompilerType( )
- {
- return CfrDecompilerPlugin.decompilerType;
- }
-
- @Override
- public String removeComment( String source )
- {
- return source;
- }
-
- @Override
- public boolean supportLevel( int level )
- {
- return true;
- }
-
- @Override
- public boolean supportDebugLevel( int level )
- {
- return false;
- }
-
- @Override
- public boolean supportDebug( )
- {
- return false;
- }
+/*******************************************************************************
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.sf.feeling.decompiler.cfr.decompiler;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.commons.lang3.time.StopWatch;
+import org.benf.cfr.reader.apiunreleased.ClassFileSource2;
+import org.benf.cfr.reader.bytecode.analysis.parse.utils.Pair;
+import org.benf.cfr.reader.entities.ClassFile;
+import org.benf.cfr.reader.entities.Method;
+import org.benf.cfr.reader.state.ClassFileSourceImpl;
+import org.benf.cfr.reader.state.DCCommonState;
+import org.benf.cfr.reader.state.TypeUsageCollectingDumper;
+import org.benf.cfr.reader.state.TypeUsageInformation;
+import org.benf.cfr.reader.util.CannotLoadClassException;
+import org.benf.cfr.reader.util.getopt.GetOptParser;
+import org.benf.cfr.reader.util.getopt.Options;
+import org.benf.cfr.reader.util.getopt.OptionsImpl;
+import org.benf.cfr.reader.util.output.IllegalIdentifierDump;
+import org.benf.cfr.reader.util.output.MethodErrorCollector;
+import org.benf.cfr.reader.util.output.StringStreamDumper;
+import org.sf.feeling.decompiler.JavaDecompilerConstants;
+import org.sf.feeling.decompiler.JavaDecompilerPlugin;
+import org.sf.feeling.decompiler.cfr.CfrDecompilerPlugin;
+import org.sf.feeling.decompiler.editor.BaseDecompiler;
+import org.sf.feeling.decompiler.editor.IDecompiler;
+import org.sf.feeling.decompiler.util.CommentUtil;
+import org.sf.feeling.decompiler.util.FileUtil;
+import org.sf.feeling.decompiler.util.JarClassExtractor;
+import org.sf.feeling.decompiler.util.UnicodeUtil;
+
+public class CfrDecompiler extends BaseDecompiler {
+
+ private String source = ""; //$NON-NLS-1$
+ private long time;
+ private String log = ""; //$NON-NLS-1$
+
+ /**
+ * Performs a Runtime.exec() on CFR with selected options.
+ *
+ * @see IDecompiler#decompile(String, String, String)
+ */
+ @Override
+ public void decompile(String root, String packege, String className) {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ log = ""; //$NON-NLS-1$
+ source = ""; //$NON-NLS-1$
+ File workingDir = new File(root + "/" + packege); //$NON-NLS-1$
+
+ String classPathStr = new File(workingDir, className).getAbsolutePath();
+
+ GetOptParser getOptParser = new GetOptParser();
+
+ try {
+ Pairdecompile.
+ *
+ * @see IDecompiler#decompileFromArchive(String, String, String)
+ */
+ @Override
+ public void decompileFromArchive(String archivePath, String packege, String className) {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ String tempDir = JavaDecompilerPlugin.getDefault().getPreferenceStore()
+ .getString(JavaDecompilerConstants.TEMP_DIR);
+ File workingDir = new File(tempDir + "/ecd_cfr_" + System.currentTimeMillis()); //$NON-NLS-1$
+ try {
+ workingDir.mkdirs();
+ JarClassExtractor.extract(archivePath, packege, className, true, workingDir.getAbsolutePath());
+ decompile(workingDir.getAbsolutePath(), "", className); //$NON-NLS-1$
+ time = stopWatch.getTime();
+ } catch (Exception e) {
+ exceptions.add(e);
+ JavaDecompilerPlugin.logError(e, e.getMessage());
+ return;
+ } finally {
+ FileUtil.deltree(workingDir);
+ }
+ }
+
+ @Override
+ public long getDecompilationTime() {
+ return time;
+ }
+
+ /**
+ * @see IDecompiler#getLog()
+ */
+ @Override
+ public String getLog() {
+ return log;
+ }
+
+ /**
+ * @see IDecompiler#getSource()
+ */
+ @Override
+ public String getSource() {
+ return source;
+ }
+
+ @Override
+ public String getDecompilerType() {
+ return CfrDecompilerPlugin.decompilerType;
+ }
+
+ @Override
+ public String removeComment(String source) {
+ return source;
+ }
+
+ @Override
+ public boolean supportLevel(int level) {
+ return true;
+ }
+
+ @Override
+ public boolean supportDebugLevel(int level) {
+ return false; // CFR does not seem to have an option to create code that matches the original
+ // line numbers
+ }
+
+ @Override
+ public String getDecompilerName() {
+ return CfrDecompilerPlugin.decompilerType;
+ }
+
+ @Override
+ public String getDecompilerVersion() {
+ return CfrDecompilerPlugin.decompilerVersion;
+ }
}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrDecompilerDescriptor.java b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrDecompilerDescriptor.java
index 4692257a..b89304d6 100644
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrDecompilerDescriptor.java
+++ b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrDecompilerDescriptor.java
@@ -10,8 +10,7 @@
import org.sf.feeling.decompiler.editor.IDecompiler;
import org.sf.feeling.decompiler.editor.IDecompilerDescriptor;
-public class CfrDecompilerDescriptor implements IDecompilerDescriptor
-{
+public class CfrDecompilerDescriptor implements IDecompilerDescriptor {
private CfrDecompiler decompiler = null;
@@ -20,61 +19,52 @@ public class CfrDecompilerDescriptor implements IDecompilerDescriptor
private Action decompileAction = null;
@Override
- public String getDecompilerType( )
- {
+ public String getDecompilerType() {
return CfrDecompilerPlugin.decompilerType;
}
@Override
- public String getDecompilerPreferenceLabel( )
- {
- return Messages.getString( "CfrDecompilerDescriptor.PreferenceLabel" ); //$NON-NLS-1$
+ public String getDecompilerPreferenceLabel() {
+ return Messages.getString("CfrDecompilerDescriptor.PreferenceLabel"); //$NON-NLS-1$
}
@Override
- public IDecompiler getDecompiler( )
- {
- if ( decompiler == null )
- decompiler = new CfrDecompiler( );
+ public IDecompiler getDecompiler() {
+ if (decompiler == null) {
+ decompiler = new CfrDecompiler();
+ }
return decompiler;
}
@Override
- public BaseDecompilerSourceMapper getDecompilerSourceMapper( )
- {
- if ( sourceMapper == null )
- {
- sourceMapper = new CfrSourceMapper( );
+ public BaseDecompilerSourceMapper getDecompilerSourceMapper() {
+ if (sourceMapper == null) {
+ sourceMapper = new CfrSourceMapper();
}
return sourceMapper;
}
@Override
- public Action getDecompileAction( )
- {
- if ( decompileAction == null )
- {
- decompileAction = new DecompileWithCfrAction( );
+ public Action getDecompileAction() {
+ if (decompileAction == null) {
+ decompileAction = new DecompileWithCfrAction();
}
return decompileAction;
}
@Override
- public boolean isEnabled( )
- {
- return !( System.getProperty( "java.version" ).compareTo( "1.6" ) < 0 ); //$NON-NLS-1$ //$NON-NLS-2$
+ public boolean isEnabled() {
+ return true;
}
@Override
- public boolean isDefault( )
- {
- return false;
+ public int getDefaultPriority() {
+ return 0;
}
@Override
- public ImageDescriptor getDecompilerIcon( )
- {
- return CfrDecompilerPlugin.getImageDescriptor( "icons/cfr_16.gif" ); //$NON-NLS-1$ ;
+ public ImageDescriptor getDecompilerIcon() {
+ return CfrDecompilerPlugin.getImageDescriptor("icons/cfr_16.gif"); //$NON-NLS-1$ ;
}
}
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrSourceMapper.java b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrSourceMapper.java
index 5cd50d4f..ed64a118 100644
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrSourceMapper.java
+++ b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/CfrSourceMapper.java
@@ -1,75 +1,32 @@
/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
+ * https://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.sf.feeling.decompiler.cfr.decompiler;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Iterator;
-
import org.eclipse.core.runtime.Path;
+import org.sf.feeling.decompiler.cfr.CfrDecompilerPlugin;
import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
-public class CfrSourceMapper extends BaseDecompilerSourceMapper
-{
+public class CfrSourceMapper extends BaseDecompilerSourceMapper {
- public CfrSourceMapper( )
- {
- super( new Path( "." ), "" ); //$NON-NLS-1$ //$NON-NLS-2$
- origionalDecompiler = new CfrDecompiler( );
+ public CfrSourceMapper() {
+ super(new Path("."), ""); //$NON-NLS-1$ //$NON-NLS-2$
+ originalDecompiler = new CfrDecompiler();
}
@Override
- protected void printDecompileReport( StringBuffer source, String fileLocation, Collection exceptions,
- long decompilationTime )
- {
- String location = "\tDecompiled from: " //$NON-NLS-1$
- + fileLocation;
- source.append( "\n\n/*" ); //$NON-NLS-1$
- source.append( "\n\tDECOMPILATION REPORT\n\n" ); //$NON-NLS-1$
- source.append( location ).append( "\n" ); //$NON-NLS-1$
- source.append( "\tTotal time: " ) //$NON-NLS-1$
- .append( decompilationTime )
- .append( " ms\n" ); //$NON-NLS-1$
- source.append( "\t" //$NON-NLS-1$
- + origionalDecompiler.getLog( )
- .replaceAll( "\t", "" ) //$NON-NLS-1$ //$NON-NLS-2$
- .replaceAll( "\n\\s*", "\n\t" ) ); //$NON-NLS-1$ //$NON-NLS-2$
- exceptions.addAll( origionalDecompiler.getExceptions( ) );
- logExceptions( exceptions, source );
- source.append( "\n*/" ); //$NON-NLS-1$
+ protected String getDecompilerName() {
+ return CfrDecompilerPlugin.decompilerType;
}
- protected void logExceptions( Collection exceptions, StringBuffer buffer )
- {
- if ( !exceptions.isEmpty( ) )
- {
- buffer.append( "\n\tCaught exceptions:" ); //$NON-NLS-1$
- if ( exceptions == null || exceptions.size( ) == 0 )
- return; // nothing to do
- buffer.append( "\n" ); //$NON-NLS-1$
- StringWriter stackTraces = new StringWriter( );
- PrintWriter stackTracesP = new PrintWriter( stackTraces );
-
- Iterator i = exceptions.iterator( );
- while ( i.hasNext( ) )
- {
- ( (Exception) i.next( ) ).printStackTrace( stackTracesP );
- stackTracesP.println( "" ); //$NON-NLS-1$
- }
-
- stackTracesP.flush( );
- stackTracesP.close( );
- buffer.append( stackTraces.toString( ) );
- }
+ @Override
+ protected String getDecompilerVersion() {
+ return CfrDecompilerPlugin.decompilerVersion;
}
+
}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/StringDumper.java b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/StringDumper.java
deleted file mode 100644
index aa6611a7..00000000
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/decompiler/StringDumper.java
+++ /dev/null
@@ -1,54 +0,0 @@
-
-package org.sf.feeling.decompiler.cfr.decompiler;
-
-import java.io.IOException;
-import java.io.StringWriter;
-
-import org.benf.cfr.reader.entities.Method;
-import org.benf.cfr.reader.state.TypeUsageInformation;
-import org.benf.cfr.reader.util.getopt.Options;
-import org.benf.cfr.reader.util.output.IllegalIdentifierDump;
-import org.benf.cfr.reader.util.output.StreamDumper;
-
-public class StringDumper extends StreamDumper
-{
-
- private StringWriter sw = new StringWriter( );
-
- public StringDumper( TypeUsageInformation typeUsageInformation, Options options,
- IllegalIdentifierDump illegalIdentifierDump )
- {
- super( typeUsageInformation, options, illegalIdentifierDump );
- }
-
- @Override
- public void addSummaryError( Method paramMethod, String paramString )
- {
-
- }
-
- @Override
- public void close( )
- {
- try
- {
- sw.close( );
- }
- catch ( IOException e )
- {
- throw new RuntimeException( e );
- }
- }
-
- @Override
- protected void write( String source )
- {
- sw.write( source );
- }
-
- @Override
- public String toString( )
- {
- return sw.toString( );
- }
-}
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/Messages.java b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/Messages.java
index 8663770f..78cd64cb 100644
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/Messages.java
+++ b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/Messages.java
@@ -1,53 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
package org.sf.feeling.decompiler.cfr.i18n;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.sf.feeling.decompiler.i18n.EcdResouceBundle;
-public class Messages
-{
+public class Messages {
- private static final String BUNDLE_NAME = "org.sf.feeling.decompiler.cfr.i18n.messages"; //$NON-NLS-1$
+ private static final EcdResouceBundle RESOURCE_BUNDLE = new EcdResouceBundle(Messages.class);
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private Messages( )
- {
+ private Messages() {
}
- public static String getString( String key )
- {
-
- try
- {
- String result = RESOURCE_BUNDLE.getString( key );
- try
- {
- result = new String( result.getBytes( "ISO-8859-1" ), "utf-8" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch ( UnsupportedEncodingException e )
- {
- return '!' + key + '!';
- }
- return result;
- }
- catch ( MissingResourceException e )
- {
- return '!' + key + '!';
- }
+ public static String getString(String key) {
+ return RESOURCE_BUNDLE.getString(key);
}
/**
* Gets formatted translation for current local
*
- * @param key
- * the key
+ * @param key the key
* @return translated value string
*/
- public static String getFormattedString( String key, Object[] arguments )
- {
- return MessageFormat.format( getString( key ), arguments );
+ public static String getFormattedString(String key, Object[] arguments) {
+ return RESOURCE_BUNDLE.getFormattedString(key, arguments);
}
+
}
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages.properties b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages.properties
index 78454506..9bddb9ff 100644
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages.properties
+++ b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages.properties
@@ -1,13 +1,10 @@
###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
+# Copyright (c) 2017 Chen Chao and other ECD project contributors.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
+# https://www.eclipse.org/legal/epl-v10.html
###############################################################################
-CfrDecompilerDescriptor.PreferenceLabel=CFR (Support JDK8)
+CfrDecompilerDescriptor.PreferenceLabel=CFR (Support JDK14)
JavaDecompilerActionBarContributor.Action.DecompileWithCfr=C&FR
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_CN.properties b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_CN.properties
deleted file mode 100644
index af2182ae..00000000
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_CN.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-CfrDecompilerDescriptor.PreferenceLabel=CFR (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithCfr=C&FR
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_HK.properties b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_HK.properties
deleted file mode 100644
index af2182ae..00000000
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_HK.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-CfrDecompilerDescriptor.PreferenceLabel=CFR (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithCfr=C&FR
diff --git a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_TW.properties b/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_TW.properties
deleted file mode 100644
index af2182ae..00000000
--- a/org.sf.feeling.decompiler.cfr/src/org/sf/feeling/decompiler/cfr/i18n/messages_zh_TW.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-CfrDecompilerDescriptor.PreferenceLabel=CFR (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithCfr=C&FR
diff --git a/org.sf.feeling.decompiler.feature/.settings/org.eclipse.core.resources.prefs b/org.sf.feeling.decompiler.feature/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..4824b802
--- /dev/null
+++ b/org.sf.feeling.decompiler.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/January 28, 2005
- -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
- -Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.
- -Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").
- -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".
- -Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.
- -The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:
- -Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory.
- -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
- -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
- -Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.
- - + + + + + +Version 3, 29 June 2007
+ +Copyright © 2007 Free Software Foundation, Inc. + <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed.
+ +The GNU General Public License is a free, copyleft license for +software and other kinds of works.
+ +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too.
+ +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things.
+ +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others.
+ +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights.
+ +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it.
+ +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions.
+ +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users.
+ +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free.
+ +The precise terms and conditions for copying, distribution and +modification follow.
+ +“This License” refers to version 3 of the GNU General Public License.
+ +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks.
+ +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations.
+ +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work.
+ +A “covered work” means either the unmodified Program or a work based +on the Program.
+ +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well.
+ +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying.
+ +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion.
+ +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work.
+ +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language.
+ +The “System Libraries” of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it.
+ +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work.
+ +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source.
+ +The Corresponding Source for a work in source code form is that +same work.
+ +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law.
+ +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you.
+ +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary.
+ +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures.
+ +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures.
+ +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program.
+ +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee.
+ +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions:
+ +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate.
+ +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways:
+ +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work.
+ +A “User Product” is either (1) a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product.
+ +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made.
+ +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM).
+ +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network.
+ +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying.
+ +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions.
+ +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission.
+ +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms:
+ +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying.
+ +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms.
+ +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way.
+ +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11).
+ +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation.
+ +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice.
+ +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10.
+ +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so.
+ +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License.
+ +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts.
+ +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it.
+ +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”.
+ +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License.
+ +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version.
+ +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party.
+ +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid.
+ +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it.
+ +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007.
+ +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law.
+ +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program.
+ +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such.
+ +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns.
+ +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation.
+ +If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program.
+ +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version.
+ +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES.
+ +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee.
+ +END OF TERMS AND CONDITIONS
+ +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms.
+ +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found.
+ +<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. ++ +
Also add information on how to contact you by electronic and paper mail.
+ +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode:
+ +<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. ++ +
The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an “about box”.
+ +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>.
+ +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>.
+ + diff --git a/org.sf.feeling.decompiler.feature/pom.xml b/org.sf.feeling.decompiler.feature/pom.xml new file mode 100644 index 00000000..9fb8c282 --- /dev/null +++ b/org.sf.feeling.decompiler.feature/pom.xml @@ -0,0 +1,15 @@ +Eclipse Public License - v 1.0 -
- -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.
- -1. DEFINITIONS
- -"Contribution" means:
- -a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
i) -changes to the Program, and
- -ii) -additions to the Program;
- -where -such changes and/or additions to the Program originate from and are distributed -by that particular Contributor. A Contribution 'originates' from a Contributor -if it was added to the Program by such Contributor itself or anyone acting on -such Contributor's behalf. Contributions do not include additions to the -Program which: (i) are separate modules of software distributed in conjunction -with the Program under their own license agreement, and (ii) are not derivative -works of the Program.
- -"Contributor" means any person or -entity that distributes the Program.
- -"Licensed Patents " mean patent -claims licensable by a Contributor which are necessarily infringed by the use -or sale of its Contribution alone or when combined with the Program.
- -"Program" means the Contributions -distributed in accordance with this Agreement.
- -"Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.
- -2. GRANT OF RIGHTS
- -a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly -display, publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and object code -form.
- -b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free -patent license under Licensed Patents to make, use, sell, offer to sell, import -and otherwise transfer the Contribution of such Contributor, if any, in source -code and object code form. This patent license shall apply to the combination -of the Contribution and the Program if, at the time the Contribution is added -by the Contributor, such addition of the Contribution causes such combination -to be covered by the Licensed Patents. The patent license shall not apply to -any other combinations which include the Contribution. No hardware per se is -licensed hereunder.
- -c) -Recipient understands that although each Contributor grants the licenses to its -Contributions set forth herein, no assurances are provided by any Contributor -that the Program does not infringe the patent or other intellectual property -rights of any other entity. Each Contributor disclaims any liability to Recipient -for claims brought by any other entity based on infringement of intellectual -property rights or otherwise. As a condition to exercising the rights and -licenses granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For example, -if a third party patent license is required to allow Recipient to distribute -the Program, it is Recipient's responsibility to acquire that license before -distributing the Program.
- -d) -Each Contributor represents that to its knowledge it has sufficient copyright -rights in its Contribution, if any, to grant the copyright license set forth in -this Agreement.
- -3. REQUIREMENTS
- -A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -
- -a) -it complies with the terms and conditions of this Agreement; and
- -b) -its license agreement:
- -i) -effectively disclaims on behalf of all Contributors all warranties and -conditions, express and implied, including warranties or conditions of title -and non-infringement, and implied warranties or conditions of merchantability -and fitness for a particular purpose;
- -ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;
- -iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and
- -iv) -states that source code for the Program is available from such Contributor, and -informs licensees how to obtain it in a reasonable manner on or through a -medium customarily used for software exchange.
- -When the Program is made available in source -code form:
- -a) -it must be made available under this Agreement; and
- -b) a -copy of this Agreement must be included with each copy of the Program.
- -Contributors may not remove or alter any -copyright notices contained within the Program.
- -Each Contributor must identify itself as the -originator of its Contribution, if any, in a manner that reasonably allows -subsequent Recipients to identify the originator of the Contribution.
- -4. COMMERCIAL DISTRIBUTION
- -Commercial distributors of software may -accept certain responsibilities with respect to end users, business partners -and the like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a commercial -product offering should do so in a manner which does not create potential -liability for other Contributors. Therefore, if a Contributor includes the -Program in a commercial product offering, such Contributor ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") arising from claims, lawsuits and other -legal actions brought by a third party against the Indemnified Contributor to -the extent caused by the acts or omissions of such Commercial Contributor in -connection with its distribution of the Program in a commercial product -offering. The obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In order -to qualify, an Indemnified Contributor must: a) promptly notify the Commercial -Contributor in writing of such claim, and b) allow the Commercial Contributor -to control, and cooperate with the Commercial Contributor in, the defense and -any related settlement negotiations. The Indemnified Contributor may participate -in any such claim at its own expense.
- -For example, a Contributor might include the -Program in a commercial product offering, Product X. That Contributor is then a -Commercial Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance claims and -warranties are such Commercial Contributor's responsibility alone. Under this -section, the Commercial Contributor would have to defend claims against the -other Contributors related to those performance claims and warranties, and if a -court requires any other Contributor to pay any damages as a result, the -Commercial Contributor must pay those damages.
- -5. NO WARRANTY
- -EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, -WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and distributing the -Program and assumes all risks associated with its exercise of rights under this -Agreement , including but not limited to the risks and costs of program errors, -compliance with applicable laws, damage to or loss of data, programs or -equipment, and unavailability or interruption of operations.
- -6. DISCLAIMER OF LIABILITY
- -EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF -THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGES.
- -7. GENERAL
- -If any provision of this Agreement is invalid -or unenforceable under applicable law, it shall not affect the validity or -enforceability of the remainder of the terms of this Agreement, and without -further action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable.
- -If Recipient institutes patent litigation -against any entity (including a cross-claim or counterclaim in a lawsuit) -alleging that the Program itself (excluding combinations of the Program with -other software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of the date -such litigation is filed.
- -All Recipient's rights under this Agreement -shall terminate if it fails to comply with any of the material terms or -conditions of this Agreement and does not cure such failure in a reasonable -period of time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use and -distribution of the Program as soon as reasonably practicable. However, -Recipient's obligations under this Agreement and any licenses granted by -Recipient relating to the Program shall continue and survive.
- -Everyone is permitted to copy and distribute -copies of this Agreement, but in order to avoid inconsistency the Agreement is -copyrighted and may only be modified in the following manner. The Agreement -Steward reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement Steward has -the right to modify this Agreement. The Eclipse Foundation is the initial -Agreement Steward. The Eclipse Foundation may assign the responsibility to -serve as the Agreement Steward to a suitable separate entity. Each new version -of the Agreement will be given a distinguishing version number. The Program -(including Contributions) may always be distributed subject to the version of -the Agreement under which it was received. In addition, after a new version of -the Agreement is published, Contributor may elect to distribute the Program -(including its Contributions) under the new version. Except as expressly stated -in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to -the intellectual property of any Contributor under this Agreement, whether -expressly, by implication, estoppel or otherwise. All rights in the Program not -expressly granted under this Agreement are reserved.
- -This Agreement is governed by the laws of the -State of New York and the intellectual property laws of the United States of -America. No party to this Agreement will bring a legal action under this -Agreement more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation.
- -
Eclipse Public License - v 1.0 +
+ +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.
+ +1. DEFINITIONS
+ +"Contribution" means:
+ +a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
i) +changes to the Program, and
+ +ii) +additions to the Program;
+ +where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program.
+ +"Contributor" means any person or +entity that distributes the Program.
+ +"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program.
+ +"Program" means the Contributions +distributed in accordance with this Agreement.
+ +"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.
+ +2. GRANT OF RIGHTS
+ +a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.
+ +b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder.
+ +c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.
+ +d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement.
+ +3. REQUIREMENTS
+ +A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that: +
+ +a) +it complies with the terms and conditions of this Agreement; and
+ +b) +its license agreement:
+ +i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose;
+ +ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits;
+ +iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and
+ +iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.
+ +When the Program is made available in source +code form:
+ +a) +it must be made available under this Agreement; and
+ +b) a +copy of this Agreement must be included with each copy of the Program.
+ +Contributors may not remove or alter any +copyright notices contained within the Program.
+ +Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution.
+ +4. COMMERCIAL DISTRIBUTION
+ +Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.
+ +For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.
+ +5. NO WARRANTY
+ +EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations.
+ +6. DISCLAIMER OF LIABILITY
+ +EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.
+ +7. GENERAL
+ +If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.
+ +If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed.
+ +All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.
+ +Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.
+ +This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.
+ +
Version 3, 29 June 2007
+ +Copyright © 2007 Free Software Foundation, Inc. + <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed.
+ +The GNU General Public License is a free, copyleft license for +software and other kinds of works.
+ +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too.
+ +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things.
+ +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others.
+ +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights.
+ +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it.
+ +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions.
+ +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users.
+ +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free.
+ +The precise terms and conditions for copying, distribution and +modification follow.
+ +“This License” refers to version 3 of the GNU General Public License.
+ +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks.
+ +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations.
+ +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work.
+ +A “covered work” means either the unmodified Program or a work based +on the Program.
+ +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well.
+ +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying.
+ +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion.
+ +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work.
+ +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language.
+ +The “System Libraries” of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it.
+ +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work.
+ +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source.
+ +The Corresponding Source for a work in source code form is that +same work.
+ +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law.
+ +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you.
+ +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary.
+ +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures.
+ +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures.
+ +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program.
+ +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee.
+ +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions:
+ +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate.
+ +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways:
+ +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work.
+ +A “User Product” is either (1) a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product.
+ +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made.
+ +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM).
+ +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network.
+ +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying.
+ +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions.
+ +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission.
+ +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms:
+ +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying.
+ +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms.
+ +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way.
+ +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11).
+ +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation.
+ +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice.
+ +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10.
+ +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so.
+ +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License.
+ +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts.
+ +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it.
+ +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”.
+ +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License.
+ +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version.
+ +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party.
+ +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid.
+ +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it.
+ +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007.
+ +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law.
+ +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program.
+ +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such.
+ +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns.
+ +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation.
+ +If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program.
+ +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version.
+ +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES.
+ +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee.
+ +END OF TERMS AND CONDITIONS
+ +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms.
+ +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found.
+ +<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. ++ +
Also add information on how to contact you by electronic and paper mail.
+ +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode:
+ +<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. ++ +
The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an “about box”.
+ +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>.
+ +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>.
+ + diff --git a/org.sf.feeling.decompiler.fernflower.feature/pom.xml b/org.sf.feeling.decompiler.fernflower.feature/pom.xml new file mode 100644 index 00000000..110d5cf5 --- /dev/null +++ b/org.sf.feeling.decompiler.fernflower.feature/pom.xml @@ -0,0 +1,15 @@ +Runtime.exec() on FernFlower executable with selected
+ * options.
+ *
+ * @see IDecompiler#decompile(String, String, String)
+ */
+ @Override
+ public void decompile(String root, String packege, final String className) {
+ if (root == null || packege == null || className == null) {
+ return;
+ }
+
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+
+ exceptions.clear();
+ log = ""; //$NON-NLS-1$
+ source = ""; //$NON-NLS-1$
+
+ loggerStream = new ByteArrayOutputStream();
+
+ File workingDir = new File(root + "/" + packege); //$NON-NLS-1$
+
+ final Mapdecompile.
+ *
+ * @see IDecompiler#decompileFromArchive(String, String, String)
+ */
+ @Override
+ public void decompileFromArchive(String archivePath, String packege, String className) {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ File workingDir = new File(
+ JavaDecompilerPlugin.getDefault().getPreferenceStore().getString(JavaDecompilerConstants.TEMP_DIR) + "/" //$NON-NLS-1$
+ + System.currentTimeMillis());
+
+ try {
+ workingDir.mkdirs();
+ JarClassExtractor.extract(archivePath, packege, className, true, workingDir.getAbsolutePath());
+ decompile(workingDir.getAbsolutePath(), "", className); //$NON-NLS-1$
+ } catch (Exception e) {
+ exceptions.add(e);
+ JavaDecompilerPlugin.logError(e, e.getMessage());
+ return;
+ } finally {
+ FileUtil.deltree(workingDir);
+ }
+ time = stopWatch.getTime();
+ }
+
+ @Override
+ public long getDecompilationTime() {
+ return time;
+ }
+
+ /**
+ * @see IDecompiler#getLog()
+ */
+ @Override
+ public String getLog() {
+ if (loggerStream != null) {
+ return log + loggerStream.toString();
+ }
+ return log;
+ }
+
+ /**
+ * @see IDecompiler#getSource()
+ */
+ @Override
+ public String getSource() {
+ return source;
+ }
+
+ @Override
+ public String getDecompilerType() {
+ return decompilerType;
+ }
+
+ @Override
+ public String removeComment(String source) {
+ return source;
+ }
+
+ @Override
+ public boolean supportLevel(int level) {
+ return true;
+ }
+
+ @Override
+ public boolean supportDebugLevel(int level) {
+ return true;
+ }
+
+ @Override
+ public LineNumberOutputType getLineNumberOutputType() {
+ return LineNumberOutputType.SINGLE_LINE_COMMENT_END_OF_LINE;
+ }
+
+ @Override
+ public String getDecompilerName() {
+ return FernFlowerDecompiler.decompilerType;
+ }
+
+ @Override
+ public String getDecompilerVersion() {
+ return FernFlowerDecompiler.decompilerVersion;
+ }
+
+}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerDecompilerDescriptor.java b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerDecompilerDescriptor.java
new file mode 100644
index 00000000..07cb26e0
--- /dev/null
+++ b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerDecompilerDescriptor.java
@@ -0,0 +1,67 @@
+package org.sf.feeling.decompiler.fernflower.decompiler;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
+import org.sf.feeling.decompiler.editor.IDecompiler;
+import org.sf.feeling.decompiler.editor.IDecompilerDescriptor;
+import org.sf.feeling.decompiler.fernflower.FernFlowerDecompilerPlugin;
+import org.sf.feeling.decompiler.fernflower.actions.DecompileWithFernFlowerAction;
+import org.sf.feeling.decompiler.fernflower.i18n.Messages;
+
+public class FernFlowerDecompilerDescriptor implements IDecompilerDescriptor {
+ private FernFlowerDecompiler decompiler = null;
+ private FernFlowerSourceMapper sourceMapper = null;
+ private Action decompileAction;
+
+ @Override
+ public String getDecompilerType() {
+ return FernFlowerDecompilerPlugin.decompilerType;
+ }
+
+ @Override
+ public String getDecompilerPreferenceLabel() {
+ return Messages.getString("FernFlowerDecompilerDescriptor.PreferenceLabel"); //$NON-NLS-1$
+ }
+
+ @Override
+ public IDecompiler getDecompiler() {
+ if (decompiler == null) {
+ decompiler = new FernFlowerDecompiler();
+ }
+ return decompiler;
+
+ }
+
+ @Override
+ public BaseDecompilerSourceMapper getDecompilerSourceMapper() {
+ if (sourceMapper == null) {
+ sourceMapper = new FernFlowerSourceMapper();
+ }
+ return sourceMapper;
+ }
+
+ @Override
+ public Action getDecompileAction() {
+ if (decompileAction == null) {
+ decompileAction = new DecompileWithFernFlowerAction();
+ }
+ return decompileAction;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
+
+ @Override
+ public int getDefaultPriority() {
+ return 100;
+ }
+
+ @Override
+ public ImageDescriptor getDecompilerIcon() {
+ return FernFlowerDecompilerPlugin.getImageDescriptor("icons/fernflower_16.png"); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerSourceMapper.java b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerSourceMapper.java
new file mode 100644
index 00000000..c0215c25
--- /dev/null
+++ b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/decompiler/FernFlowerSourceMapper.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.sf.feeling.decompiler.fernflower.decompiler;
+
+import org.eclipse.core.runtime.Path;
+import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
+
+public class FernFlowerSourceMapper extends BaseDecompilerSourceMapper {
+
+ public FernFlowerSourceMapper() {
+ super(new Path("."), ""); //$NON-NLS-1$ //$NON-NLS-2$
+ originalDecompiler = new FernFlowerDecompiler();
+ }
+
+ @Override
+ protected String getDecompilerName() {
+ return FernFlowerDecompiler.decompilerType;
+ }
+
+ @Override
+ protected String getDecompilerVersion() {
+ return FernFlowerDecompiler.decompilerVersion;
+ }
+
+}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/Messages.java b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/Messages.java
new file mode 100644
index 00000000..519e3a59
--- /dev/null
+++ b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/Messages.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.sf.feeling.decompiler.fernflower.i18n;
+
+import org.sf.feeling.decompiler.i18n.EcdResouceBundle;
+
+public class Messages {
+
+ private static final EcdResouceBundle RESOURCE_BUNDLE = new EcdResouceBundle(Messages.class);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+
+ /**
+ * Gets formatted translation for current local
+ *
+ * @param key the key
+ * @return translated value string
+ */
+ public static String getFormattedString(String key, Object[] arguments) {
+ return RESOURCE_BUNDLE.getFormattedString(key, arguments);
+ }
+
+}
diff --git a/org.sf.feeling.decompiler.source.attach/plugin.properties b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/messages.properties
similarity index 59%
rename from org.sf.feeling.decompiler.source.attach/plugin.properties
rename to org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/messages.properties
index 96a4c23a..af197c02 100644
--- a/org.sf.feeling.decompiler.source.attach/plugin.properties
+++ b/org.sf.feeling.decompiler.fernflower/src/org/sf/feeling/decompiler/fernflower/i18n/messages.properties
@@ -1,12 +1,10 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-action.label=Download Source
\ No newline at end of file
+###############################################################################
+# Copyright (c) 2017 Chen Chao and other ECD project contributors.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+
+FernFlowerDecompilerDescriptor.PreferenceLabel=FernFlower
+JavaDecompilerActionBarContributor.Action.DecompileWithFernFlower=&FernFlower
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad.feature/feature.properties b/org.sf.feeling.decompiler.jad.feature/feature.properties
deleted file mode 100644
index a9ead388..00000000
--- a/org.sf.feeling.decompiler.jad.feature/feature.properties
+++ /dev/null
@@ -1,135 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Eclipse Class Decompiler Jad Extension (Optional)
-
-# "providerName" property - name of the company that provides the feature
-providerName=Chen Chao
-
-# "updateSiteName" property - label for the update site
-updateSiteName=Eclipse Class Decompiler Updates
-
-# "description" property - description of the feature
-description=Eclipse Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon with Eclipse seamlessly. \
-It allows Java developers to debug class files without source code directly.
-
-copyrightURL=http://www.cpupk.com/decompiler/update
-
-copyright=(c) Copyright 2017 Chen Chao(cnfree2000@hotmail.com). All rights reserved.\n
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "aboutURL" property - URL of the "About and Change log"
-# do not translate value - just change to point to a locale-specific HTML page
-aboutURL=about.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-January 28, 2004\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
-Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments\n\
-("Fragments"), and features ("Features"). A Feature is a bundle of one or\n\
-more Plug-ins and/or Fragments and associated material. Files named\n\
-"feature.xml" may contain a list of the names and version numbers of the\n\
-Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments\n\
-are located in directories named "plugins" and Features are located in\n\
-directories named "features".\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Subdirectories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE CPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n
-########### end of license property ##########################################
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad.feature/license.html b/org.sf.feeling.decompiler.jad.feature/license.html
deleted file mode 100644
index e2323dfc..00000000
--- a/org.sf.feeling.decompiler.jad.feature/license.html
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-January 28, 2005
- -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
- -Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.
- -Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").
- -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".
- -Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.
- -The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:
- -Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory.
- -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
- -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
- -Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.
- - diff --git a/org.sf.feeling.decompiler.jad/.gitignore b/org.sf.feeling.decompiler.jad/.gitignore deleted file mode 100644 index ae3c1726..00000000 --- a/org.sf.feeling.decompiler.jad/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/org.sf.feeling.decompiler.jad/.settings/org.eclipse.core.resources.prefs b/org.sf.feeling.decompiler.jad/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index d74f05b5..00000000 --- a/org.sf.feeling.decompiler.jad/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/org/sf/feeling/decompiler/jad/i18n/messages_zh_CN.properties=UTF-8 -encoding//src/org/sf/feeling/decompiler/jad/i18n/messages_zh_HK.properties=UTF-8 -encoding//src/org/sf/feeling/decompiler/jad/i18n/messages_zh_TW.properties=UTF-8 diff --git a/org.sf.feeling.decompiler.jad/.settings/org.eclipse.jdt.core.prefs b/org.sf.feeling.decompiler.jad/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 36413b06..00000000 --- a/org.sf.feeling.decompiler.jad/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,81 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=ignore -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.sf.feeling.decompiler.jad/META-INF/MANIFEST.MF b/org.sf.feeling.decompiler.jad/META-INF/MANIFEST.MF deleted file mode 100644 index 2e5b47ea..00000000 --- a/org.sf.feeling.decompiler.jad/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Eclipse Class Decompiler Jad Extension -Bundle-SymbolicName: org.sf.feeling.decompiler.jad;singleton:=true -Bundle-Version: 2.10.0.qualifier -Bundle-Activator: org.sf.feeling.decompiler.jad.JadDecompilerPlugin -Require-Bundle: org.eclipse.core.runtime, - org.sf.feeling.decompiler, - org.eclipse.core.resources, - org.eclipse.jface, - org.eclipse.jface.text, - org.eclipse.ui.editors, - org.eclipse.ui.workbench, - org.eclipse.ui.workbench.texteditor, - org.eclipse.jdt.core, - org.eclipse.jdt.ui, - org.eclipse.jdt.debug.ui, - org.eclipse.debug.ui, - org.eclipse.jdt.launching, - org.eclipse.core.expressions, - org.eclipse.ui.navigator, - org.eclipse.ui.ide;resolution:=optional, - org.eclipse.core.filesystem -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-ActivationPolicy: lazy -Bundle-Vendor: Chen Chao -Export-Package: org.sf.feeling.decompiler.jad.actions, - org.sf.feeling.decompiler.jad.decompiler diff --git a/org.sf.feeling.decompiler.jad/icons/jad_16.gif b/org.sf.feeling.decompiler.jad/icons/jad_16.gif deleted file mode 100644 index b44ac377..00000000 Binary files a/org.sf.feeling.decompiler.jad/icons/jad_16.gif and /dev/null differ diff --git a/org.sf.feeling.decompiler.jad/src/native/jad/linux/jad b/org.sf.feeling.decompiler.jad/src/native/jad/linux/jad deleted file mode 100644 index 981fa277..00000000 Binary files a/org.sf.feeling.decompiler.jad/src/native/jad/linux/jad and /dev/null differ diff --git a/org.sf.feeling.decompiler.jad/src/native/jad/macosx/jad b/org.sf.feeling.decompiler.jad/src/native/jad/macosx/jad deleted file mode 100644 index 3034bacf..00000000 Binary files a/org.sf.feeling.decompiler.jad/src/native/jad/macosx/jad and /dev/null differ diff --git a/org.sf.feeling.decompiler.jad/src/native/jad/win32/jad.exe b/org.sf.feeling.decompiler.jad/src/native/jad/win32/jad.exe deleted file mode 100644 index 983e2a93..00000000 Binary files a/org.sf.feeling.decompiler.jad/src/native/jad/win32/jad.exe and /dev/null differ diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/JadDecompilerPlugin.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/JadDecompilerPlugin.java deleted file mode 100644 index 51c1b78b..00000000 --- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/JadDecompilerPlugin.java +++ /dev/null @@ -1,118 +0,0 @@ - -package org.sf.feeling.decompiler.jad; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.sf.feeling.decompiler.JavaDecompilerPlugin; -import org.sf.feeling.decompiler.jad.decompiler.JadDecompiler; -import org.sf.feeling.decompiler.jad.decompiler.JadLoader; - -public class JadDecompilerPlugin extends AbstractUIPlugin implements IPropertyChangeListener -{ - - public static final String PLUGIN_ID = "org.sf.feeling.decompiler.jad"; //$NON-NLS-1$ - - public static final String CMD = "org.sf.feeling.decompiler.jad.cmd"; //$NON-NLS-1$ - - public static final String decompilerType = "Jad"; //$NON-NLS-1$ - - private static JadDecompilerPlugin plugin; - - private IPreferenceStore preferenceStore; - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext - * ) - */ - @Override - public void start( BundleContext context ) throws Exception - { - super.start( context ); - getPreferenceStore( ).addPropertyChangeListener( this ); - } - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop( BundleContext context ) throws Exception - { - super.stop( context ); - getPreferenceStore( ).removePropertyChangeListener( this ); - plugin = null; - } - - @Override - public void propertyChange( PropertyChangeEvent event ) - { - - } - - @Override - public IPreferenceStore getPreferenceStore( ) - { - if ( preferenceStore == null ) - { - preferenceStore = JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ); - - IPreferenceStore decompilerStore = preferenceStore; - String jad = JadLoader.loadJad( ); - if ( jad != null ) - decompilerStore.setDefault( CMD, jad ); - - decompilerStore.setDefault( JadDecompiler.OPTION_INDENT_SPACE, 4 ); - decompilerStore.setDefault( JadDecompiler.OPTION_IRADIX, 10 ); - decompilerStore.setDefault( JadDecompiler.OPTION_LRADIX, 10 ); - decompilerStore.setDefault( JadDecompiler.OPTION_SPLITSTR_MAX, 0 ); - decompilerStore.setDefault( JadDecompiler.OPTION_PI, 0 ); - decompilerStore.setDefault( JadDecompiler.OPTION_PV, 0 ); - decompilerStore.setDefault( JadDecompiler.OPTION_FIELDSFIRST, true ); - decompilerStore.setDefault( JadDecompiler.OPTION_NOCTOR, true ); - decompilerStore.setDefault( JadDecompiler.OPTION_ANSI, false ); - - } - return preferenceStore; - } - - public static JadDecompilerPlugin getDefault( ) - { - return plugin; - } - - public JadDecompilerPlugin( ) - { - plugin = this; - } - - public static ImageDescriptor getImageDescriptor( String path ) - { - URL base = JadDecompilerPlugin.getDefault( ).getBundle( ).getEntry( "/" ); //$NON-NLS-1$ - URL url = null; - try - { - url = new URL( base, path ); // $NON-NLS-1$ - } - catch ( MalformedURLException e ) - { - e.printStackTrace( ); - } - ImageDescriptor actionIcon = null; - if ( url != null ) - actionIcon = ImageDescriptor.createFromURL( url ); - return actionIcon; - } - -} diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/actions/DecompileWithJadAction.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/actions/DecompileWithJadAction.java deleted file mode 100644 index e9424fb6..00000000 --- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/actions/DecompileWithJadAction.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com). - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Chen Chao - initial API and implementation - *******************************************************************************/ - -package org.sf.feeling.decompiler.jad.actions; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.action.Action; -import org.sf.feeling.decompiler.jad.JadDecompilerPlugin; -import org.sf.feeling.decompiler.jad.i18n.Messages; -import org.sf.feeling.decompiler.util.UIUtil; - -public class DecompileWithJadAction extends Action -{ - - public DecompileWithJadAction( ) - { - super( Messages.getString( "JavaDecompilerActionBarContributor.Action.DecompileWithJad" ) ); //$NON-NLS-1$ - this.setImageDescriptor( JadDecompilerPlugin.getImageDescriptor( "icons/jad_16.gif" ) ); //$NON-NLS-1$ - } - - @Override - public void run( ) - { - try - { - new DecompileWithJadHandler( ).execute( null ); - } - catch ( ExecutionException e ) - { - } - } - - @Override - public boolean isEnabled( ) - { - return UIUtil.getActiveEditor( ) != null || UIUtil.getActiveSelection( ) != null; - } -} \ No newline at end of file diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompiler.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompiler.java deleted file mode 100644 index 7bfed870..00000000 --- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompiler.java +++ /dev/null @@ -1,497 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com). - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Chen Chao - initial API and implementation - *******************************************************************************/ - -package org.sf.feeling.decompiler.jad.decompiler; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.sf.feeling.decompiler.JavaDecompilerPlugin; -import org.sf.feeling.decompiler.editor.IDecompiler; -import org.sf.feeling.decompiler.jad.JadDecompilerPlugin; -import org.sf.feeling.decompiler.util.ClassUtil; -import org.sf.feeling.decompiler.util.FileUtil; -import org.sf.feeling.decompiler.util.JarClassExtractor; -import org.sf.feeling.decompiler.util.UnicodeUtil; - -/** - * This implementation ofIDecompiler uses Jad as the underlying
- * decompler.
- */
-public class JadDecompiler implements IDecompiler
-{
-
- public static final String OPTION_ANNOTATE = "-a"; // format //$NON-NLS-1$
- public static final String OPTION_ANNOTATE_FQ = "-af"; // format //$NON-NLS-1$
- public static final String OPTION_BRACES = "-b"; // format //$NON-NLS-1$
- public static final String OPTION_CLEAR = "-clear"; // format //$NON-NLS-1$
- public static final String OPTION_DIR = "-d"; // ? //$NON-NLS-1$
- public static final String OPTION_DEAD = "-dead"; // directives //$NON-NLS-1$
- public static final String OPTION_DISASSEMBLER = "-dis"; // directives //$NON-NLS-1$
- public static final String OPTION_FULLNAMES = "-f"; // format //$NON-NLS-1$
- public static final String OPTION_FIELDSFIRST = "-ff"; // format //$NON-NLS-1$
- public static final String OPTION_DEFINITS = "-i"; // format //$NON-NLS-1$
- public static final String OPTION_SPLITSTR_MAX = "-l"; // format //$NON-NLS-1$
- public static final String OPTION_LNC = JavaDecompilerPlugin.PREF_DISPLAY_LINE_NUMBERS;// "-lnc";
- // //
- // debug
- public static final String OPTION_LRADIX = "-lradix"; // format //$NON-NLS-1$
- public static final String OPTION_SPLITSTR_NL = "-nl"; // format //$NON-NLS-1$
- public static final String OPTION_NOCONV = "-noconv"; // directives //$NON-NLS-1$
- public static final String OPTION_NOCAST = "-nocast"; // directives //$NON-NLS-1$
- public static final String OPTION_NOCLASS = "-noclass"; // directives //$NON-NLS-1$
- public static final String OPTION_NOCODE = "-nocode"; // directives //$NON-NLS-1$
- public static final String OPTION_NOCTOR = "-noctor"; // directives //$NON-NLS-1$
- public static final String OPTION_NODOS = "-nodos"; // directives //$NON-NLS-1$
- public static final String OPTION_NOFLDIS = "-nofd"; // directives //$NON-NLS-1$
- public static final String OPTION_NOINNER = "-noinner"; // directives //$NON-NLS-1$
- public static final String OPTION_NOLVT = "-nolvt"; // directives //$NON-NLS-1$
- public static final String OPTION_NONLB = "-nonlb"; // format //$NON-NLS-1$
- public static final String OPTION_OVERWRITE = "-o"; // ? //$NON-NLS-1$
- public static final String OPTION_SENDSTDOUT = "-p"; // ? //$NON-NLS-1$
- public static final String OPTION_PA = "-pa"; // directives //$NON-NLS-1$
- public static final String OPTION_PC = "-pc"; // directives //$NON-NLS-1$
- public static final String OPTION_PE = "-pe"; // directives //$NON-NLS-1$
- public static final String OPTION_PF = "-pf"; // directives //$NON-NLS-1$
- public static final String OPTION_PI = "-pi"; // format //$NON-NLS-1$
- public static final String OPTION_PL = "-pl"; // directives //$NON-NLS-1$
- public static final String OPTION_PM = "-pm"; // directives //$NON-NLS-1$
- public static final String OPTION_PP = "-pp"; // directives //$NON-NLS-1$
- public static final String OPTION_PV = "-pv"; // format //$NON-NLS-1$
- public static final String OPTION_RESTORE = "-r"; // ? //$NON-NLS-1$
- public static final String OPTION_IRADIX = "-radix"; // format //$NON-NLS-1$
- public static final String OPTION_EXT = "-s"; // ? //$NON-NLS-1$
- public static final String OPTION_SAFE = "-safe"; // directives //$NON-NLS-1$
- public static final String OPTION_SPACE = "-space"; // format //$NON-NLS-1$
- public static final String OPTION_STAT = "-stat"; // misc //$NON-NLS-1$
- public static final String OPTION_INDENT_SPACE = "-t"; // format //$NON-NLS-1$
- public static final String OPTION_INDENT_TAB = "-t"; // ? //$NON-NLS-1$
- public static final String OPTION_VERBOSE = "-v"; // misc //$NON-NLS-1$
- public static final String OPTION_ANSI = "-8"; // misc //$NON-NLS-1$
- public static final String OPTION_REDSTDERR = "-&"; // ? //$NON-NLS-1$
-
- public static final String USE_TAB = "use tab"; //$NON-NLS-1$
-
- public static final String[] TOGGLE_OPTION = {
- OPTION_ANNOTATE,
- OPTION_ANNOTATE_FQ,
- OPTION_BRACES,
- OPTION_CLEAR,
- OPTION_DEAD,
- OPTION_DISASSEMBLER,
- OPTION_FULLNAMES,
- OPTION_FIELDSFIRST,
- OPTION_DEFINITS,
- OPTION_LNC,
- OPTION_SPLITSTR_NL,
- OPTION_NOCONV,
- OPTION_NOCAST,
- OPTION_NOCLASS,
- OPTION_NOCODE,
- OPTION_NOCTOR,
- OPTION_NODOS,
- OPTION_NOFLDIS,
- OPTION_NOINNER,
- OPTION_NOLVT,
- OPTION_NONLB,
- /* OPTION_OVERWRITE, */
- /* OPTION_SENDSTDOUT, */
- /* OPTION_RESTORE, */
- OPTION_SAFE,
- OPTION_SPACE,
- OPTION_STAT,
- OPTION_INDENT_TAB,
- OPTION_VERBOSE,
- OPTION_ANSI,
- /* OPTION_REDSTDERR */
- };
-
- public static final String[] VALUE_OPTION_STRING = {
- /* OPTION_DIR, */
- OPTION_PA, OPTION_PC, OPTION_PE, OPTION_PF, OPTION_PL, OPTION_PM, OPTION_PP,
- /* OPTION_EXT, */
- };
-
- public static final String[] VALUE_OPTION_INT = {
- /* OPTION_INDENT_SPACE, */
- OPTION_SPLITSTR_MAX, OPTION_LRADIX, OPTION_PI, OPTION_PV, OPTION_IRADIX,
- };
-
- private String source = "/* ERROR? */"; //$NON-NLS-1$
- private StringBuffer log;
- private List excList = new ArrayList( );
- private long time, start;
-
- private String[] buildCmdLine( String classFileName )
- {
- ArrayList cmdLine = new ArrayList( );
- IPreferenceStore settings = JavaDecompilerPlugin.getDefault( ).getPreferenceStore( );
-
- // command and special options
- cmdLine.add( settings.getString( JadDecompilerPlugin.CMD ) );
- cmdLine.add( OPTION_SENDSTDOUT );
-
- String indent = settings.getString( OPTION_INDENT_SPACE );
- if ( indent.equals( USE_TAB ) )
- cmdLine.add( OPTION_INDENT_TAB );
- else
- {
- try
- {
- Integer.parseInt( indent );
- cmdLine.add( OPTION_INDENT_SPACE + indent );
- }
- catch ( Exception e )
- {
- }
- }
-
- // toggles
- for ( int i = 0; i < TOGGLE_OPTION.length; i++ )
- {
- if ( settings.getBoolean( TOGGLE_OPTION[i] ) )
- {
- if ( OPTION_LNC.equals( TOGGLE_OPTION[i] ) )
- {
- // cmdLine.add( "-lnc" ); //$NON-NLS-1$
- }
- else
- cmdLine.add( TOGGLE_OPTION[i] );
- }
- }
-
- if ( ClassUtil.isDebug( ) )
- {
- cmdLine.add( "-lnc" ); //$NON-NLS-1$
- }
-
- // integers, 0 means disabled
- int iValue;
- for ( int i = 0; i < VALUE_OPTION_INT.length; i++ )
- {
- iValue = settings.getInt( VALUE_OPTION_INT[i] );
- if ( iValue > 0 )
- cmdLine.add( VALUE_OPTION_INT[i] + iValue );
- }
-
- // strings, "" means disabled
- String sValue;
- for ( int i = 0; i < VALUE_OPTION_STRING.length; i++ )
- {
- sValue = settings.getString( VALUE_OPTION_STRING[i] );
- if ( sValue != null && sValue.length( ) > 0 )
- cmdLine.add( VALUE_OPTION_STRING[i] + " " + sValue ); //$NON-NLS-1$
-
- }
-
- cmdLine.add( classFileName );
- // debugCmdLine(cmdLine);
- return (String[]) cmdLine.toArray( new String[cmdLine.size( )] );
-
- }
-
- void debugCmdLine( List segments )
- {
- StringBuffer cmdline = new StringBuffer( );
- for ( int i = 0; i < segments.size( ); i++ )
- cmdline.append( segments.get( i ) ).append( " " ); //$NON-NLS-1$
- System.err.println( "-> " + cmdline.toString( ) ); //$NON-NLS-1$
- }
-
- /**
- * Performs a Runtime.exec() on jad executable with selected
- * options.
- *
- * @see IDecompiler#decompile(String, String, String)
- */
- @Override
- public void decompile( String root, String packege, String className )
- {
- log = new StringBuffer( );
- source = ""; //$NON-NLS-1$
- File workingDir = new File( root + "/" + packege ); //$NON-NLS-1$
- ByteArrayOutputStream bos = new ByteArrayOutputStream( );
- ByteArrayOutputStream errors = new ByteArrayOutputStream( );
- PrintWriter errorsP = new PrintWriter( new OutputStreamWriter( errors ) );
- // errorsP.println("\n\n\n/***** DECOMPILE LOG *****\n");
- int status = 0;
-
- try
- {
- start = System.currentTimeMillis( );
- errorsP.println( "\tJad reported messages/errors:" ); //$NON-NLS-1$
- Process p = Runtime.getRuntime( ).exec( buildCmdLine( className ), new String[]{}, workingDir );
- StreamRedirectThread outRedirect = new StreamRedirectThread( "output_reader", //$NON-NLS-1$
- p.getInputStream( ),
- bos );
- StreamRedirectThread errRedirect = new StreamRedirectThread( "error_reader", //$NON-NLS-1$
- p.getErrorStream( ),
- errors );
- outRedirect.start( );
- errRedirect.start( );
- status = p.waitFor( ); // wait for jad to finish
- outRedirect.join( ); // wait until output stream content is fully
- // copied
- errRedirect.join( ); // wait until error stream content is fully
- // copied
- if ( outRedirect.getException( ) != null )
- excList.add( outRedirect.getException( ) );
- if ( errRedirect.getException( ) != null )
- excList.add( errRedirect.getException( ) );
- }
- catch ( Exception e )
- {
- excList.add( e );
- }
- finally
- {
- try
- {
- bos.flush( );
- bos.close( );
- errorsP.println( "\tExit status: " + status ); //$NON-NLS-1$
- // errorsP.print(" *************************/");
- errors.flush( );
- errorsP.close( );
- }
- catch ( Exception e )
- {
- excList.add( e ); // will never get here...
- }
- time = System.currentTimeMillis( ) - start;
- }
-
- source = UnicodeUtil.decode( bos.toString( ) );
-
- log = new StringBuffer( errors.toString( ) );
- // logExceptions();
- // result = new DecompiledClassFile(classFile, source.toString());
- }
-
- /**
- * Jad doesn't support decompilation from archives. This methods extracts
- * request class file from the specified archive into temp directory and
- * then calls decompile.
- *
- * @see IDecompiler#decompileFromArchive(String, String, String)
- */
- @Override
- public void decompileFromArchive( String archivePath, String packege, String className )
- {
- start = System.currentTimeMillis( );
- File workingDir = new File(
- JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR )
- + "/" //$NON-NLS-1$
- + System.currentTimeMillis( ) );
-
- try
- {
- workingDir.mkdirs( );
- JarClassExtractor.extract( archivePath, packege, className, true, workingDir.getAbsolutePath( ) );
- decompile( workingDir.getAbsolutePath( ), "", className ); //$NON-NLS-1$
- }
- catch ( Exception e )
- {
- excList.add( e );
- // logExceptions();
- return;
- }
- finally
- {
- FileUtil.deltree( workingDir );
- }
- }
-
- @Override
- public long getDecompilationTime( )
- {
- return time;
- }
-
- @Override
- public List getExceptions( )
- {
- return excList;
- }
-
- /**
- * @see IDecompiler#getLog()
- */
- @Override
- public String getLog( )
- {
- return log == null ? "" : log.toString( ); //$NON-NLS-1$
- }
-
- // private void logExceptions()
- // {
- // if (log == null) log = new StringBuffer();
- // log.append("\n\tCAUGHT EXCEPTIONS:\n");
- // if (excList.size() == 0) return;
- // StringWriter stackTraces = new StringWriter();
- // PrintWriter stackTracesP = new PrintWriter(stackTraces);
- //
- // for (int i = 0; i < excList.size(); i++)
- // {
- // ((Exception) excList.get(i)).printStackTrace(stackTracesP);
- // stackTracesP.println("");
- // }
- //
- // stackTracesP.flush();
- // stackTracesP.close();
- // log.append(stackTraces.toString());
- // }
-
- /**
- * @see IDecompiler#getSource()
- */
- @Override
- public String getSource( )
- {
- return source;
- }
-
- @Override
- public String getDecompilerType( )
- {
- return JadDecompilerPlugin.decompilerType;
- }
-
- @Override
- public String removeComment( String source )
- {
-
- String[] spilts = source.replaceAll( "\r\n", "\n" ).split( "\n" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- StringBuffer buffer = new StringBuffer( );
- for ( int i = 0; i < spilts.length; i++ )
- {
- if ( i > 0 && i < 5 )
- continue;
- String string = spilts[i];
- Pattern pattern = Pattern.compile( "\\s*/\\*\\s*\\S*\\*/", //$NON-NLS-1$
- Pattern.CASE_INSENSITIVE );
- Matcher matcher = pattern.matcher( string );
- if ( matcher.find( ) )
- {
- if ( matcher.start( ) == 0 )
- {
- buffer.append( string ).append( "\r\n" ); //$NON-NLS-1$
- continue;
- }
- }
-
- boolean refer = false;
-
- pattern = Pattern.compile( "\\s*// Referenced", //$NON-NLS-1$
- Pattern.CASE_INSENSITIVE );
- matcher = pattern.matcher( string );
- if ( matcher.find( ) )
- {
- refer = true;
-
- while ( true )
- {
- i++;
- if ( spilts[i].trim( ).startsWith( "//" ) ) //$NON-NLS-1$
- {
- continue;
- }
- else if ( i >= spilts.length )
- {
- break;
- }
- else
- {
- i--;
- break;
- }
- }
- }
-
- if ( !refer )
- buffer.append( string + "\r\n" ); //$NON-NLS-1$
- }
- return buffer.toString( );
-
- }
-
- @Override
- public boolean supportLevel( int level )
- {
- return level < 8;
- }
-
- @Override
- public boolean supportDebugLevel( int level )
- {
- return level < 8;
- }
-
- @Override
- public boolean supportDebug( )
- {
- return true;
- }
-}
-
-// OPTION_ANNOTATE,
-// OPTION_ANNOTATE_FQ,
-// OPTION_BRACES,
-// OPTION_CLEAR,
-// OPTION_DIR,
-// OPTION_DEAD,
-// OPTION_DISASSEMBLER,
-// OPTION_FULLNAMES,
-// OPTION_FIELDSFIRST,
-// OPTION_DEFINITS,
-// OPTION_SPLITSTR_MAX,
-// OPTION_LNC,
-// OPTION_LRADIX,
-// OPTION_SPLITSTR_NL,
-// OPTION_NOCONV,
-// OPTION_NOCAST,
-// OPTION_NOCLASS,
-// OPTION_NOCODE,
-// OPTION_NOCTOR,
-// OPTION_NODOS,
-// OPTION_NOFLDIS,
-// OPTION_NOINNER,
-// OPTION_NOLVT,
-// OPTION_NOLB,
-// OPTION_OVERWRITE,
-// OPTION_SENDSTDOUT,
-// OPTION_PA,
-// OPTION_PC,
-// OPTION_PE,
-// OPTION_PF,
-// OPTION_PI,
-// OPTION_PL,
-// OPTION_PM,
-// OPTION_PP,
-// OPTION_PV,
-// OPTION_RESTORE,
-// OPTION_IRADIX,
-// OPTION_EXT,
-// OPTION_SAFE,
-// OPTION_SPACE,
-// OPTION_STAT,
-// OPTION_INDENT_SPACE,
-// OPTION_INDENT_TAB,
-// OPTION_VERBOSE,
-// OPTION_ANSI,
-// OPTION_REDSTDERR
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompilerDescriptor.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompilerDescriptor.java
deleted file mode 100644
index 5f8502d7..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadDecompilerDescriptor.java
+++ /dev/null
@@ -1,80 +0,0 @@
-
-package org.sf.feeling.decompiler.jad.decompiler;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
-import org.sf.feeling.decompiler.editor.IDecompiler;
-import org.sf.feeling.decompiler.editor.IDecompilerDescriptor;
-import org.sf.feeling.decompiler.jad.JadDecompilerPlugin;
-import org.sf.feeling.decompiler.jad.actions.DecompileWithJadAction;
-import org.sf.feeling.decompiler.jad.i18n.Messages;
-
-public class JadDecompilerDescriptor implements IDecompilerDescriptor
-{
-
- private JadDecompiler decompiler = null;
-
- private BaseDecompilerSourceMapper sourceMapper = null;
-
- private Action decompileAction = null;
-
- @Override
- public String getDecompilerType( )
- {
- return JadDecompilerPlugin.decompilerType;
- }
-
- @Override
- public String getDecompilerPreferenceLabel( )
- {
- return Messages.getString( "JadDecompilerDescriptor.PreferenceLabel" ); //$NON-NLS-1$
- }
-
- @Override
- public IDecompiler getDecompiler( )
- {
- if ( decompiler == null )
- decompiler = new JadDecompiler( );
- return decompiler;
- }
-
- @Override
- public BaseDecompilerSourceMapper getDecompilerSourceMapper( )
- {
- if ( sourceMapper == null )
- {
- sourceMapper = new JadSourceMapper( );
- }
- return sourceMapper;
- }
-
- @Override
- public Action getDecompileAction( )
- {
- if ( decompileAction == null )
- {
- decompileAction = new DecompileWithJadAction( );
- }
- return decompileAction;
- }
-
- @Override
- public boolean isEnabled( )
- {
- return true;
- }
-
- @Override
- public boolean isDefault( )
- {
- return false;
- }
-
- @Override
- public ImageDescriptor getDecompilerIcon( )
- {
- return JadDecompilerPlugin.getImageDescriptor( "icons/jad_16.gif" ); //$NON-NLS-1$ ;
- }
-
-}
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadLoader.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadLoader.java
deleted file mode 100644
index c7e5d724..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadLoader.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
- *******************************************************************************/
-
-package org.sf.feeling.decompiler.jad.decompiler;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.Platform;
-import org.sf.feeling.decompiler.JavaDecompilerPlugin;
-
-public final class JadLoader
-{
-
- public static String loadJad( )
- {
- String jadFileName = null;
- String jadFilePath = null;
-
- if ( Platform.OS_WIN32.equalsIgnoreCase( Platform.getOS( ) ) )
- {
- jadFileName = "jad" + System.currentTimeMillis( ) + ".exe"; //$NON-NLS-1$ //$NON-NLS-2$
- jadFilePath = "/native/jad/win32/jad.exe"; //$NON-NLS-1$
- }
- else if ( Platform.OS_LINUX.equalsIgnoreCase( Platform.getOS( ) ) )
- {
- jadFileName = "jad" + System.currentTimeMillis( ); //$NON-NLS-1$
- jadFilePath = "/native/jad/linux/jad"; //$NON-NLS-1$
- }
- else if ( Platform.OS_MACOSX.equalsIgnoreCase( Platform.getOS( ) ) )
- {
- jadFileName = "jad" + System.currentTimeMillis( ); //$NON-NLS-1$
- jadFilePath = "/native/jad/macosx/jad"; //$NON-NLS-1$
- }
- else
- {
- throw new Error( "Can't obtain jad executable file." ); //$NON-NLS-1$
- }
-
- InputStream is = JadLoader.class.getResourceAsStream( jadFilePath ); // $NON-NLS-1$
- if ( is == null )
- {
- throw new Error( "Can't obtain jad executable file." ); //$NON-NLS-1$
- }
-
- FileOutputStream fos = null;
- try
- {
- File tempDir = new File(JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR ));
- if(!tempDir.exists( )) {
- tempDir.mkdirs( );
- }
- File jad = new File( tempDir, jadFileName );
- jad.createNewFile( );
- jad.deleteOnExit( );
- fos = new FileOutputStream( jad );
- int count;
- byte[] buf = new byte[1024];
- while ( ( count = is.read( buf, 0, buf.length ) ) > 0 )
- {
- fos.write( buf, 0, count );
- }
- fos.close( );
- fos = null;
-
- try
- {
- if ( Platform.OS_LINUX.equalsIgnoreCase( Platform.getOS( ) ) )
- {
- Runtime.getRuntime( )
- .exec( "chmod a+x " //$NON-NLS-1$
- + jad.getAbsolutePath( ) )
- .waitFor( );
- }
- else if ( Platform.OS_MACOSX.equalsIgnoreCase( Platform.getOS( ) ) )
- {
- Runtime.getRuntime( )
- .exec( "chmod a+x " //$NON-NLS-1$
- + jad.getAbsolutePath( ) )
- .waitFor( );
- }
- }
- catch ( InterruptedException e )
- {
- e.printStackTrace( );
- }
-
- // jad.setExecutable( true );
- return jad.getAbsolutePath( );
- }
- catch ( IOException e )
- {
- throw new Error( "Failed to create temporary file for jad.exe: " //$NON-NLS-1$
- + e );
- }
- finally
- {
- try
- {
- is.close( );
- }
- catch ( IOException e )
- {
- }
- if ( fos != null )
- {
- try
- {
- fos.close( );
- }
- catch ( IOException e )
- {
- }
- }
- }
- }
-}
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadSourceMapper.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadSourceMapper.java
deleted file mode 100644
index a64a4307..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/JadSourceMapper.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
- *******************************************************************************/
-
-package org.sf.feeling.decompiler.jad.decompiler;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Path;
-import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
-
-public class JadSourceMapper extends BaseDecompilerSourceMapper
-{
-
- public JadSourceMapper( )
- {
- super( new Path( "." ), "" ); //$NON-NLS-1$ //$NON-NLS-2$
- origionalDecompiler = new JadDecompiler( );
- }
-
- protected void logExceptions( Collection exceptions, StringBuffer buffer )
- {
- if ( !exceptions.isEmpty( ) )
- {
- buffer.append( "\n\tCaught exceptions:" ); //$NON-NLS-1$
- if ( exceptions == null || exceptions.size( ) == 0 )
- return; // nothing to do
- buffer.append( "\n" ); //$NON-NLS-1$
- StringWriter stackTraces = new StringWriter( );
- PrintWriter stackTracesP = new PrintWriter( stackTraces );
-
- Iterator i = exceptions.iterator( );
- while ( i.hasNext( ) )
- {
- ( (Exception) i.next( ) ).printStackTrace( stackTracesP );
- stackTracesP.println( "" ); //$NON-NLS-1$
- }
-
- stackTracesP.flush( );
- stackTracesP.close( );
- buffer.append( stackTraces.toString( ) );
- }
- }
-
- @Override
- protected void printDecompileReport( StringBuffer source, String fileLocation, Collection exceptions,
- long decompilationTime )
- {
- String location = "\tDecompiled from: " //$NON-NLS-1$
- + fileLocation;
- source.append( "\n\n/*" ); //$NON-NLS-1$
- source.append( "\n\tDECOMPILATION REPORT\n\n" ); //$NON-NLS-1$
- source.append( location ).append( "\n" ); //$NON-NLS-1$
- source.append( "\tTotal time: " ) //$NON-NLS-1$
- .append( decompilationTime )
- .append( " ms\n" ); //$NON-NLS-1$
- source.append( "\t" //$NON-NLS-1$
- + origionalDecompiler.getLog( ).replaceAll( "\t", "" ).replaceAll( "\n", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "\n\t" ) ); //$NON-NLS-1$
- logExceptions( exceptions, source );
- source.append( "\n*/" ); //$NON-NLS-1$
- }
-
-}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/StreamRedirectThread.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/StreamRedirectThread.java
deleted file mode 100644
index aebe8c5c..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/decompiler/StreamRedirectThread.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
- *******************************************************************************/
-
-package org.sf.feeling.decompiler.jad.decompiler;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-class StreamRedirectThread extends Thread
-{
-
- private final InputStream in;
- private final OutputStream out;
- private Exception ex;
-
- private static final int BUFFER_SIZE = 2048;
-
- StreamRedirectThread( String name, InputStream in, OutputStream out )
- {
- super( name );
- this.in = in;
- this.out = out;
- setPriority( Thread.MAX_PRIORITY - 1 );
- }
-
- public Exception getException( )
- {
- return ex;
- }
-
- /**
- * Copy.
- */
- @Override
- public void run( )
- {
- try
- {
- byte[] cbuf = new byte[BUFFER_SIZE];
- int count;
- while ( ( count = in.read( cbuf, 0, BUFFER_SIZE ) ) >= 0 )
- {
- out.write( cbuf, 0, count );
- out.flush( );
- }
- }
- catch ( IOException exc )
- {
- // System.err.println("Child I/O Transfer - " + exc);
- ex = exc;
- }
- }
-}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/Messages.java b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/Messages.java
deleted file mode 100644
index 1d415603..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/Messages.java
+++ /dev/null
@@ -1,53 +0,0 @@
-
-package org.sf.feeling.decompiler.jad.i18n;
-
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class Messages
-{
-
- private static final String BUNDLE_NAME = "org.sf.feeling.decompiler.jad.i18n.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private Messages( )
- {
- }
-
- public static String getString( String key )
- {
-
- try
- {
- String result = RESOURCE_BUNDLE.getString( key );
- try
- {
- result = new String( result.getBytes( "ISO-8859-1" ), "utf-8" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch ( UnsupportedEncodingException e )
- {
- return '!' + key + '!';
- }
- return result;
- }
- catch ( MissingResourceException e )
- {
- return '!' + key + '!';
- }
- }
-
- /**
- * Gets formatted translation for current local
- *
- * @param key
- * the key
- * @return translated value string
- */
- public static String getFormattedString( String key, Object[] arguments )
- {
- return MessageFormat.format( getString( key ), arguments );
- }
-}
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages.properties b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages.properties
deleted file mode 100644
index f92fbc57..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-JadDecompilerDescriptor.PreferenceLabel=Jad
-JavaDecompilerActionBarContributor.Action.DecompileWithJad=&Jad
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_CN.properties b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_CN.properties
deleted file mode 100644
index f92fbc57..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_CN.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-JadDecompilerDescriptor.PreferenceLabel=Jad
-JavaDecompilerActionBarContributor.Action.DecompileWithJad=&Jad
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_HK.properties b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_HK.properties
deleted file mode 100644
index f92fbc57..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_HK.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-JadDecompilerDescriptor.PreferenceLabel=Jad
-JavaDecompilerActionBarContributor.Action.DecompileWithJad=&Jad
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_TW.properties b/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_TW.properties
deleted file mode 100644
index f92fbc57..00000000
--- a/org.sf.feeling.decompiler.jad/src/org/sf/feeling/decompiler/jad/i18n/messages_zh_TW.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-JadDecompilerDescriptor.PreferenceLabel=Jad
-JavaDecompilerActionBarContributor.Action.DecompileWithJad=&Jad
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jd.feature/.settings/org.eclipse.core.resources.prefs b/org.sf.feeling.decompiler.jd.feature/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..4824b802
--- /dev/null
+++ b/org.sf.feeling.decompiler.jd.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/January 28, 2005
- -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.
- -Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.
- -Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS - modules ("Modules") and made available as downloadable archives ("Downloads").
- -Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories - named "plugins" and Features are located in directories named "features".
- -Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features.
- -The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:
- -Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties". -Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory.
- -THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):
- -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.
- -Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.
- - + + + + + +Version 3, 29 June 2007
+ +Copyright © 2007 Free Software Foundation, Inc. + <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed.
+ +The GNU General Public License is a free, copyleft license for +software and other kinds of works.
+ +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too.
+ +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things.
+ +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others.
+ +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights.
+ +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it.
+ +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions.
+ +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users.
+ +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free.
+ +The precise terms and conditions for copying, distribution and +modification follow.
+ +“This License” refers to version 3 of the GNU General Public License.
+ +“Copyright” also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks.
+ +“The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations.
+ +To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a “modified version” of the +earlier work or a work “based on” the earlier work.
+ +A “covered work” means either the unmodified Program or a work based +on the Program.
+ +To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well.
+ +To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying.
+ +An interactive user interface displays “Appropriate Legal Notices” +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion.
+ +The “source code” for a work means the preferred form of the work +for making modifications to it. “Object code” means any non-source +form of a work.
+ +A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language.
+ +The “System Libraries” of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it.
+ +The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work.
+ +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source.
+ +The Corresponding Source for a work in source code form is that +same work.
+ +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law.
+ +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you.
+ +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary.
+ +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures.
+ +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures.
+ +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program.
+ +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee.
+ +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions:
+ +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate.
+ +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways:
+ +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work.
+ +A “User Product” is either (1) a “consumer product”, which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, “normally used” refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product.
+ +“Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made.
+ +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM).
+ +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network.
+ +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying.
+ +“Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions.
+ +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission.
+ +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms:
+ +All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying.
+ +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms.
+ +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way.
+ +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11).
+ +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation.
+ +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice.
+ +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10.
+ +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so.
+ +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License.
+ +An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts.
+ +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it.
+ +A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”.
+ +A contributor's “essential patent claims” are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License.
+ +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version.
+ +In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party.
+ +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid.
+ +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it.
+ +A patent license is “discriminatory” if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007.
+ +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law.
+ +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program.
+ +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such.
+ +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns.
+ +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License “or any later version” applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation.
+ +If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program.
+ +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version.
+ +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES.
+ +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee.
+ +END OF TERMS AND CONDITIONS
+ +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms.
+ +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found.
+ +<one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. ++ +
Also add information on how to contact you by electronic and paper mail.
+ +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode:
+ +<program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. ++ +
The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an “about box”.
+ +You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>.
+ +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>.
+ + diff --git a/org.sf.feeling.decompiler.jd.feature/pom.xml b/org.sf.feeling.decompiler.jd.feature/pom.xml new file mode 100644 index 00000000..73643694 --- /dev/null +++ b/org.sf.feeling.decompiler.jd.feature/pom.xml @@ -0,0 +1,15 @@ +decompile.
+ * Our {@link JDCoreZipLoader} supports direct decompilation from within a JAR
+ * archive
*
* @see IDecompiler#decompileFromArchive(String, String, String)
*/
@Override
- public void decompileFromArchive( String archivePath, String packege, String className )
- {
- start = System.currentTimeMillis( );
- File workingDir = new File(
- JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR )
- + "/" //$NON-NLS-1$
- + System.currentTimeMillis( ) );
-
- try
- {
- workingDir.mkdirs( );
- JarClassExtractor.extract( archivePath, packege, className, true, workingDir.getAbsolutePath( ) );
- decompile( workingDir.getAbsolutePath( ), packege, className ); // $NON-NLS-1$
- }
- catch ( Exception e )
- {
- JavaDecompilerPlugin.logError( e, e.getMessage( ) );
- return;
+ public void decompileFromArchive(String archivePath, String packege, String className) {
+ long start = System.nanoTime();
+ Boolean displayNumber = null;
+
+ try {
+ if (UIUtil.isDebugPerspective() || JavaDecompilerPlugin.getDefault().isDebugMode()) {
+ displayNumber = JavaDecompilerPlugin.getDefault().isDisplayLineNumber();
+ JavaDecompilerPlugin.getDefault().displayLineNumber(Boolean.TRUE);
+ }
+
+ String decompileClassName = packege + "/" + className.replaceAll("(?i)\\.class$", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ source = mapper.decompile(archivePath, decompileClassName);
+ } catch (Exception e) {
+ JavaDecompilerPlugin.logError(e, e.getMessage());
}
- finally
- {
- FileUtil.deltree( workingDir );
+
+ if (displayNumber != null) {
+ JavaDecompilerPlugin.getDefault().displayLineNumber(displayNumber);
}
- }
- @Override
- public long getDecompilationTime( )
- {
- return time;
+ time = (System.nanoTime() - start) / 1000000;
}
@Override
- public List getExceptions( )
- {
- return Collections.EMPTY_LIST;
+ public long getDecompilationTime() {
+ return time;
}
/**
* @see IDecompiler#getLog()
*/
@Override
- public String getLog( )
- {
+ public String getLog() {
return log;
}
@@ -190,38 +135,43 @@ public String getLog( )
* @see IDecompiler#getSource()
*/
@Override
- public String getSource( )
- {
+ public String getSource() {
return source;
}
@Override
- public String getDecompilerType( )
- {
+ public String getDecompilerType() {
return JDCoreDecompilerPlugin.decompilerType;
}
@Override
- public String removeComment( String source )
- {
+ public String removeComment(String source) {
return source;
}
@Override
- public boolean supportLevel( int level )
- {
- return level < 8;
+ public boolean supportLevel(int level) {
+ return true;
}
@Override
- public boolean supportDebugLevel( int level )
- {
- return level < 8;
+ public boolean supportDebugLevel(int level) {
+ return true;
}
@Override
- public boolean supportDebug( )
- {
- return true;
+ public String getDecompilerName() {
+ return JDCoreDecompilerPlugin.decompilerType;
+ }
+
+ @Override
+ public String getDecompilerVersion() {
+ return JDCoreDecompilerPlugin.decompilerVersion;
}
+
+ @Override
+ public LineNumberOutputType getLineNumberOutputType() {
+ return LineNumberOutputType.BLOCK_COMMENT_BEGIN_OF_LINE;
+ }
+
}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreDecompilerDescriptor.java b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreDecompilerDescriptor.java
index 19a454c7..43a1254a 100644
--- a/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreDecompilerDescriptor.java
+++ b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreDecompilerDescriptor.java
@@ -3,7 +3,6 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
import org.sf.feeling.decompiler.editor.IDecompiler;
import org.sf.feeling.decompiler.editor.IDecompilerDescriptor;
import org.sf.feeling.decompiler.jd.JDCoreDecompilerPlugin;
@@ -12,70 +11,60 @@
import jd.ide.eclipse.editors.JDSourceMapper;
-public class JDCoreDecompilerDescriptor implements IDecompilerDescriptor
-{
+public class JDCoreDecompilerDescriptor implements IDecompilerDescriptor {
private JDCoreDecompiler decompiler = null;
- private BaseDecompilerSourceMapper sourceMapper = null;
+ private JDSourceMapper sourceMapper = null;
private Action decompileAction = null;
@Override
- public String getDecompilerType( )
- {
+ public String getDecompilerType() {
return JDCoreDecompilerPlugin.decompilerType;
}
@Override
- public String getDecompilerPreferenceLabel( )
- {
- return Messages.getString( "JDCoreDecompilerDescriptor.PreferenceLabel" ); //$NON-NLS-1$
+ public String getDecompilerPreferenceLabel() {
+ return Messages.getString("JDCoreDecompilerDescriptor.PreferenceLabel"); //$NON-NLS-1$
}
@Override
- public IDecompiler getDecompiler( )
- {
- if ( decompiler == null )
- decompiler = new JDCoreDecompiler( (JDSourceMapper) getDecompilerSourceMapper( ) );
+ public IDecompiler getDecompiler() {
+ if (decompiler == null) {
+ decompiler = new JDCoreDecompiler(getDecompilerSourceMapper());
+ }
return decompiler;
}
@Override
- public BaseDecompilerSourceMapper getDecompilerSourceMapper( )
- {
- if ( sourceMapper == null )
- {
- sourceMapper = new JDCoreSourceMapper( );
+ public JDSourceMapper getDecompilerSourceMapper() {
+ if (sourceMapper == null) {
+ sourceMapper = new JDCoreSourceMapper();
}
return sourceMapper;
}
@Override
- public Action getDecompileAction( )
- {
- if ( decompileAction == null )
- {
- decompileAction = new DecompileWithJDCoreAction( );
+ public Action getDecompileAction() {
+ if (decompileAction == null) {
+ decompileAction = new DecompileWithJDCoreAction();
}
return decompileAction;
}
@Override
- public boolean isEnabled( )
- {
+ public boolean isEnabled() {
return true;
}
@Override
- public boolean isDefault( )
- {
- return true;
+ public int getDefaultPriority() {
+ return 0;
}
@Override
- public ImageDescriptor getDecompilerIcon( )
- {
- return JDCoreDecompilerPlugin.getImageDescriptor( "icons/jd_16.png" ); //$NON-NLS-1$
+ public ImageDescriptor getDecompilerIcon() {
+ return JDCoreDecompilerPlugin.getImageDescriptor("icons/jd_16.png"); //$NON-NLS-1$
}
}
diff --git a/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCorePrinter.java b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCorePrinter.java
new file mode 100644
index 00000000..824eab3b
--- /dev/null
+++ b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCorePrinter.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2008, 2019 Emmanuel Dupuy.
+ * This project is distributed under the GPLv3 license.
+ * This is a Copyleft license that gives the user the right to use,
+ * copy and modify the code freely for non-commercial purposes.
+ */
+
+package org.sf.feeling.decompiler.jd.decompiler;
+
+import org.jd.core.v1.api.printer.Printer;
+
+public class JDCorePrinter implements Printer {
+
+ protected static final String TAB = " ";
+ protected static final String NEWLINE = "\n";
+
+ protected final StringBuilder sb = new StringBuilder(4096);
+
+ protected int indentationCount;
+ protected int realLineNumber = 0;
+ protected String lineNumberFormat;
+ protected int lineNumberWidth;
+
+ protected final boolean escapeUnicodeCharacters;
+ protected final boolean printLineNumbers;
+
+ public JDCorePrinter(boolean escapeUnicodeCharacters, boolean printLineNumbers) {
+ super();
+ this.escapeUnicodeCharacters = escapeUnicodeCharacters;
+ this.printLineNumbers = printLineNumbers;
+ }
+
+ public void init() {
+ sb.setLength(0);
+ realLineNumber = 0;
+ indentationCount = 0;
+ }
+
+ public String toString() {
+ return sb.toString();
+ }
+
+ // --- Printer --- //
+ public void start(int maxLineNumber, int majorVersion, int minorVersion) {
+ this.indentationCount = 0;
+
+ if (printLineNumbers) {
+ if (maxLineNumber == Printer.UNKNOWN_LINE_NUMBER) {
+ lineNumberFormat = "%4d";
+ } else {
+ int width = 1;
+
+ while (maxLineNumber >= 10) {
+ width++;
+ maxLineNumber /= 10;
+ }
+
+ lineNumberFormat = "%" + width + "d";
+ lineNumberWidth = width;
+ }
+ }
+ }
+
+ public void end() {
+ }
+
+ public void printText(String text) {
+ if (escapeUnicodeCharacters) {
+ for (int i = 0, len = text.length(); i < len; i++) {
+ char c = text.charAt(i);
+
+ if (c < 127) {
+ sb.append(c);
+ } else {
+ int h = (c >> 12);
+
+ sb.append("\\u");
+ sb.append((char) ((h <= 9) ? (h + '0') : (h + ('A' - 10))));
+ h = (c >> 8) & 15;
+ sb.append((char) ((h <= 9) ? (h + '0') : (h + ('A' - 10))));
+ h = (c >> 4) & 15;
+ sb.append((char) ((h <= 9) ? (h + '0') : (h + ('A' - 10))));
+ h = (c) & 15;
+ sb.append((char) ((h <= 9) ? (h + '0') : (h + ('A' - 10))));
+ }
+ }
+ } else {
+ sb.append(text);
+ }
+ }
+
+ public void printNumericConstant(String constant) {
+ sb.append(constant);
+ }
+
+ public void printStringConstant(String constant, String ownerInternalName) {
+ printText(constant);
+ }
+
+ public void printKeyword(String keyword) {
+ sb.append(keyword);
+ }
+
+ public void printDeclaration(int type, String internalTypeName, String name, String descriptor) {
+ printText(name);
+ }
+
+ public void printReference(int type, String internalTypeName, String name, String descriptor,
+ String ownerInternalName) {
+ printText(name);
+ }
+
+ public void indent() {
+ this.indentationCount++;
+ }
+
+ public void unindent() {
+ if (this.indentationCount > 0)
+ this.indentationCount--;
+ }
+
+ public void startLine(int lineNumber) {
+ printLineNumber(lineNumber);
+
+ for (int i = 0; i < indentationCount; i++)
+ sb.append(TAB);
+ }
+
+ public void endLine() {
+ sb.append(NEWLINE);
+ }
+
+ public void extraLine(int count) {
+ while (count-- > 0) {
+ printLineNumber(0);
+ sb.append(NEWLINE);
+ }
+ }
+
+ public void startMarker(int type) {
+ }
+
+ public void endMarker(int type) {
+ }
+
+ protected void printLineNumber(int lineNumber) {
+ if (!printLineNumbers) {
+ return;
+ }
+ sb.append("/* ");
+ if (lineNumber > 0) {
+ sb.append(String.format(lineNumberFormat, lineNumber));
+ } else {
+ for (int i = 0; i < lineNumberWidth; i++) {
+ sb.append(' ');
+ }
+ }
+ sb.append(" */ ");
+ }
+}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreSourceMapper.java b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreSourceMapper.java
index 98224860..51d2c845 100644
--- a/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreSourceMapper.java
+++ b/org.sf.feeling.decompiler.jd/src/org/sf/feeling/decompiler/jd/decompiler/JDCoreSourceMapper.java
@@ -1,86 +1,36 @@
/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
+ * https://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.sf.feeling.decompiler.jd.decompiler;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Iterator;
+import java.io.File;
+import java.util.Collections;
import org.eclipse.core.runtime.Path;
-import org.sf.feeling.decompiler.JavaDecompilerPlugin;
+import org.sf.feeling.decompiler.jd.JDCoreDecompilerPlugin;
import jd.ide.eclipse.editors.JDSourceMapper;
-public class JDCoreSourceMapper extends JDSourceMapper
-{
+public class JDCoreSourceMapper extends JDSourceMapper {
- public JDCoreSourceMapper( )
- {
- super( new Path( "." ), "" ); //$NON-NLS-1$ //$NON-NLS-2$
- try
- {
- loadLibrary( );
- }
- catch ( IOException e )
- {
- JavaDecompilerPlugin.logError( e, e.getMessage( ) );
- }
- origionalDecompiler = new JDCoreDecompiler( this );
+ public JDCoreSourceMapper() {
+ super(new File("."), new Path("."), "", Collections.Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + ("EPL"). A copy of the EPL is provided with this Content and is also available at https://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" will mean the Content.
Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS @@ -53,9 +53,9 @@
LineNumberFormatter is used to rewrite an existing .java file,
+ * introducing line number information. It can handle either, or both, of the
+ * following jobs:
+ *
+ * Runtime.exec() on jad executable with selected
- * options.
- *
* @see IDecompiler#decompile(String, String, String)
*/
@Override
- public void decompile( String root, String packege, String className )
- {
- start = System.currentTimeMillis( );
+ public void decompile(String root, String packege, String className) {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
log = ""; //$NON-NLS-1$
source = ""; //$NON-NLS-1$
- File workingDir = new File( root + "/" + packege ); //$NON-NLS-1$
+ File workingDir = new File(root + "/" + packege); //$NON-NLS-1$
- final String classPathStr = new File( workingDir, className ).getAbsolutePath( );
+ final String classPathStr = new File(workingDir, className).getAbsolutePath();
boolean includeLineNumbers = false;
boolean stretchLines = false;
- if ( ClassUtil.isDebug( ) )
- {
+ if (ClassUtil.isDebug()) {
includeLineNumbers = true;
stretchLines = true;
}
- DecompilationOptions decompilationOptions = new DecompilationOptions( );
+ DecompilationOptions decompilationOptions = new DecompilationOptions();
- DecompilerSettings settings = DecompilerSettings.javaDefaults( );
- settings.setTypeLoader( new com.strobel.assembler.InputTypeLoader( ) );
- settings.setForceExplicitImports( true );
+ DecompilerSettings settings = DecompilerSettings.javaDefaults();
+ settings.setTypeLoader(new com.strobel.assembler.InputTypeLoader());
+ settings.setForceExplicitImports(true);
- decompilationOptions.setSettings( settings );
- decompilationOptions.setFullDecompilation( true );
+ decompilationOptions.setSettings(settings);
+ decompilationOptions.setFullDecompilation(true);
- MetadataSystem metadataSystem = new NoRetryMetadataSystem(
- decompilationOptions.getSettings( ).getTypeLoader( ) );
- metadataSystem.setEagerMethodLoadingEnabled( false );
+ MetadataSystem metadataSystem = new NoRetryMetadataSystem(decompilationOptions.getSettings().getTypeLoader());
+ metadataSystem.setEagerMethodLoadingEnabled(false);
- TypeReference type = metadataSystem.lookupType( classPathStr );
+ TypeReference type = metadataSystem.lookupType(classPathStr);
TypeDefinition resolvedType;
- if ( ( type == null ) || ( ( resolvedType = type.resolve( ) ) == null ) )
- {
- System.err.printf( "!!! ERROR: Failed to load class %s.\n", //$NON-NLS-1$
- new Object[]{
- classPathStr
- } );
+ if ((type == null) || ((resolvedType = type.resolve()) == null)) {
+ System.err.printf("!!! ERROR: Failed to load class %s.\n", //$NON-NLS-1$
+ new Object[] { classPathStr });
return;
}
- DeobfuscationUtilities.processType( resolvedType );
+ DeobfuscationUtilities.processType(resolvedType);
String property = "java.io.tmpdir"; //$NON-NLS-1$
- String tempDir = System.getProperty( property );
- File classFile = new File( tempDir, System.currentTimeMillis( ) + className );
- Writer writer = null;
- try
- {
- writer = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( classFile ) ) );
-
- PlainTextOutput output = new PlainTextOutput( writer );
+ String tempDir = System.getProperty(property);
+ File classFile = new File(tempDir, System.currentTimeMillis() + className);
+ try {
+ TypeDecompilationResults results;
+ try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(classFile)))) {
- output.setUnicodeOutputEnabled( decompilationOptions.getSettings( ).isUnicodeOutputEnabled( ) );
+ PlainTextOutput output = new PlainTextOutput(writer);
- TypeDecompilationResults results = decompilationOptions.getSettings( )
- .getLanguage( )
- .decompileType( resolvedType, output, decompilationOptions );
+ output.setUnicodeOutputEnabled(decompilationOptions.getSettings().isUnicodeOutputEnabled());
- writer.flush( );
- writer.close( );
+ Language lang = decompilationOptions.getSettings().getLanguage();
- writer = null;
+ // perform the actual decompilation
+ results = lang.decompileType(resolvedType, output, decompilationOptions);
+ }
- List lineNumberPositions = results.getLineNumberPositions( );
+ Listdecompile.
+ * request class file from the specified archive into temp directory and then
+ * calls decompile.
*
* @see IDecompiler#decompileFromArchive(String, String, String)
*/
@Override
- public void decompileFromArchive( String archivePath, String packege, String className )
- {
- start = System.currentTimeMillis( );
+ public void decompileFromArchive(String archivePath, String packege, String className) {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
File workingDir = new File(
- JavaDecompilerPlugin.getDefault( ).getPreferenceStore( ).getString( JavaDecompilerPlugin.TEMP_DIR )
- + "/" //$NON-NLS-1$
- + System.currentTimeMillis( ) );
-
- try
- {
- workingDir.mkdirs( );
- JarClassExtractor.extract( archivePath, packege, className, true, workingDir.getAbsolutePath( ) );
- decompile( workingDir.getAbsolutePath( ), "", className ); //$NON-NLS-1$
- }
- catch ( Exception e )
- {
- JavaDecompilerPlugin.logError( e, e.getMessage( ) );
+ JavaDecompilerPlugin.getDefault().getPreferenceStore().getString(JavaDecompilerConstants.TEMP_DIR) + "/" //$NON-NLS-1$
+ + System.currentTimeMillis());
+
+ try {
+ workingDir.mkdirs();
+ JarClassExtractor.extract(archivePath, packege, className, true, workingDir.getAbsolutePath());
+ decompile(workingDir.getAbsolutePath(), "", className); //$NON-NLS-1$
+ time = stopWatch.getTime();
+ } catch (Exception e) {
+ exceptions.add(e);
+ JavaDecompilerPlugin.logError(e, e.getMessage());
return;
- }
- finally
- {
- FileUtil.deltree( workingDir );
+ } finally {
+ FileUtil.deltree(workingDir);
}
}
@Override
- public long getDecompilationTime( )
- {
+ public long getDecompilationTime() {
return time;
}
- @Override
- public List getExceptions( )
- {
- return Collections.EMPTY_LIST;
- }
-
/**
* @see IDecompiler#getLog()
*/
@Override
- public String getLog( )
- {
+ public String getLog() {
return log;
}
@@ -244,38 +190,46 @@ public String getLog( )
* @see IDecompiler#getSource()
*/
@Override
- public String getSource( )
- {
+ public String getSource() {
return source;
}
@Override
- public String getDecompilerType( )
- {
+ public String getDecompilerType() {
return ProcyonDecompilerPlugin.decompilerType;
}
@Override
- public String removeComment( String source )
- {
+ public String removeComment(String source) {
return source;
}
@Override
- public boolean supportLevel( int level )
- {
+ public boolean supportLevel(int level) {
return true;
}
@Override
- public boolean supportDebugLevel( int level )
- {
+ public boolean supportDebugLevel(int level) {
return true;
}
@Override
- public boolean supportDebug( )
- {
- return true;
+ public String getDecompilerName() {
+ return ProcyonDecompilerPlugin.decompilerType;
}
+
+ @Override
+ public String getDecompilerVersion() {
+ return ProcyonDecompilerPlugin.decompilerVersion;
+ }
+
+ @Override
+ public LineNumberOutputType getLineNumberOutputType() {
+ // Procyon generates line number comments at the beginning of the line but only
+ // for those lines source line information is present. The other lines are just
+ // indented by spaces.
+ return LineNumberOutputType.BLOCK_COMMENT_BEGIN_OF_LINE;
+ }
+
}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonDecompilerDescriptor.java b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonDecompilerDescriptor.java
index fb5c8dfc..b08b45c1 100644
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonDecompilerDescriptor.java
+++ b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonDecompilerDescriptor.java
@@ -10,8 +10,7 @@
import org.sf.feeling.decompiler.procyon.actions.DecompileWithProcyonAction;
import org.sf.feeling.decompiler.procyon.i18n.Messages;
-public class ProcyonDecompilerDescriptor implements IDecompilerDescriptor
-{
+public class ProcyonDecompilerDescriptor implements IDecompilerDescriptor {
private ProcyonDecompiler decompiler = null;
@@ -20,60 +19,50 @@ public class ProcyonDecompilerDescriptor implements IDecompilerDescriptor
private Action decompileAction = null;
@Override
- public String getDecompilerType( )
- {
+ public String getDecompilerType() {
return ProcyonDecompilerPlugin.decompilerType;
}
@Override
- public String getDecompilerPreferenceLabel( )
- {
- return Messages.getString( "ProcyonDecompilerDescriptor.PreferenceLabel" ); //$NON-NLS-1$
+ public String getDecompilerPreferenceLabel() {
+ return Messages.getString("ProcyonDecompilerDescriptor.PreferenceLabel"); //$NON-NLS-1$
}
@Override
- public IDecompiler getDecompiler( )
- {
- if ( decompiler == null )
- decompiler = new ProcyonDecompiler( );
+ public IDecompiler getDecompiler() {
+ if (decompiler == null)
+ decompiler = new ProcyonDecompiler();
return decompiler;
}
@Override
- public BaseDecompilerSourceMapper getDecompilerSourceMapper( )
- {
- if ( sourceMapper == null )
- {
- sourceMapper = new ProcyonSourceMapper( );
+ public BaseDecompilerSourceMapper getDecompilerSourceMapper() {
+ if (sourceMapper == null) {
+ sourceMapper = new ProcyonSourceMapper();
}
return sourceMapper;
}
@Override
- public Action getDecompileAction( )
- {
- if ( decompileAction == null )
- {
- decompileAction = new DecompileWithProcyonAction( );
+ public Action getDecompileAction() {
+ if (decompileAction == null) {
+ decompileAction = new DecompileWithProcyonAction();
}
return decompileAction;
}
@Override
- public boolean isEnabled( )
- {
- return !( System.getProperty( "java.version" ).compareTo( "1.7" ) < 0 ); //$NON-NLS-1$ //$NON-NLS-2$
+ public boolean isEnabled() {
+ return true;
}
@Override
- public boolean isDefault( )
- {
- return false;
+ public int getDefaultPriority() {
+ return 2;
}
@Override
- public ImageDescriptor getDecompilerIcon( )
- {
- return ProcyonDecompilerPlugin.getImageDescriptor( "icons/procyon_16.png" ); //$NON-NLS-1$ ;
+ public ImageDescriptor getDecompilerIcon() {
+ return ProcyonDecompilerPlugin.getImageDescriptor("icons/procyon_16.png"); //$NON-NLS-1$ ;
}
}
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonSourceMapper.java b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonSourceMapper.java
index 91f8c1ef..21a04fb9 100644
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonSourceMapper.java
+++ b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/decompiler/ProcyonSourceMapper.java
@@ -1,80 +1,32 @@
/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
+ * Copyright (c) 2017 Chen Chao and other ECD project contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
+ * https://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.sf.feeling.decompiler.procyon.decompiler;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Iterator;
-
import org.eclipse.core.runtime.Path;
import org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper;
+import org.sf.feeling.decompiler.procyon.ProcyonDecompilerPlugin;
-import com.strobel.Procyon;
-
-public class ProcyonSourceMapper extends BaseDecompilerSourceMapper
-{
+public class ProcyonSourceMapper extends BaseDecompilerSourceMapper {
- public ProcyonSourceMapper( )
- {
- super( new Path( "." ), "" ); //$NON-NLS-1$ //$NON-NLS-2$
- origionalDecompiler = new ProcyonDecompiler( );
+ public ProcyonSourceMapper() {
+ super(new Path("."), ""); //$NON-NLS-1$ //$NON-NLS-2$
+ originalDecompiler = new ProcyonDecompiler();
}
@Override
- protected void printDecompileReport( StringBuffer source, String fileLocation, Collection exceptions,
- long decompilationTime )
- {
- String location = "\tDecompiled from: " //$NON-NLS-1$
- + fileLocation;
- source.append( "\n\n/*" ); //$NON-NLS-1$
- source.append( "\n\tDECOMPILATION REPORT\n\n" ); //$NON-NLS-1$
- source.append( location ).append( "\n" ); //$NON-NLS-1$
- source.append( "\tTotal time: " ) //$NON-NLS-1$
- .append( decompilationTime )
- .append( " ms\n" ); //$NON-NLS-1$
- source.append( "\t" //$NON-NLS-1$
- + origionalDecompiler.getLog( )
- .replaceAll( "\t", "" ) //$NON-NLS-1$ //$NON-NLS-2$
- .replaceAll( "\n\\s*", "\n\t" ) ); //$NON-NLS-1$ //$NON-NLS-2$
- exceptions.addAll( origionalDecompiler.getExceptions( ) );
- logExceptions( exceptions, source );
- source.append( "\n\tDecompiled with Procyon " //$NON-NLS-1$
- + Procyon.version( )
- + "." ); //$NON-NLS-1$
- source.append( "\n*/" ); //$NON-NLS-1$
+ protected String getDecompilerName() {
+ return ProcyonDecompilerPlugin.decompilerType;
}
- protected void logExceptions( Collection exceptions, StringBuffer buffer )
- {
- if ( !exceptions.isEmpty( ) )
- {
- buffer.append( "\n\tCaught exceptions:" ); //$NON-NLS-1$
- if ( exceptions == null || exceptions.size( ) == 0 )
- return; // nothing to do
- buffer.append( "\n" ); //$NON-NLS-1$
- StringWriter stackTraces = new StringWriter( );
- PrintWriter stackTracesP = new PrintWriter( stackTraces );
-
- Iterator i = exceptions.iterator( );
- while ( i.hasNext( ) )
- {
- ( (Exception) i.next( ) ).printStackTrace( stackTracesP );
- stackTracesP.println( "" ); //$NON-NLS-1$
- }
-
- stackTracesP.flush( );
- stackTracesP.close( );
- buffer.append( stackTraces.toString( ) );
- }
+ @Override
+ protected String getDecompilerVersion() {
+ return ProcyonDecompilerPlugin.decompilerVersion;
}
+
}
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/Messages.java b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/Messages.java
index fc296b9e..a2ea7fc2 100644
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/Messages.java
+++ b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/Messages.java
@@ -1,53 +1,27 @@
package org.sf.feeling.decompiler.procyon.i18n;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.sf.feeling.decompiler.i18n.EcdResouceBundle;
-public class Messages
-{
+public class Messages {
- private static final String BUNDLE_NAME = "org.sf.feeling.decompiler.procyon.i18n.messages"; //$NON-NLS-1$
+ private static final EcdResouceBundle RESOURCE_BUNDLE = new EcdResouceBundle(Messages.class);
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private Messages( )
- {
+ private Messages() {
}
- public static String getString( String key )
- {
-
- try
- {
- String result = RESOURCE_BUNDLE.getString( key );
- try
- {
- result = new String( result.getBytes( "ISO-8859-1" ), "utf-8" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
- catch ( UnsupportedEncodingException e )
- {
- return '!' + key + '!';
- }
- return result;
- }
- catch ( MissingResourceException e )
- {
- return '!' + key + '!';
- }
+ public static String getString(String key) {
+ return RESOURCE_BUNDLE.getString(key);
}
/**
* Gets formatted translation for current local
*
- * @param key
- * the key
+ * @param key the key
* @return translated value string
*/
- public static String getFormattedString( String key, Object[] arguments )
- {
- return MessageFormat.format( getString( key ), arguments );
+ public static String getFormattedString(String key, Object[] arguments) {
+ return RESOURCE_BUNDLE.getFormattedString(key, arguments);
}
+
}
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages.properties b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages.properties
index 460b14a1..a5ad0296 100644
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages.properties
+++ b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages.properties
@@ -1,13 +1,10 @@
###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
+# Copyright (c) 2017 Chen Chao and other ECD project contributors.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
+# https://www.eclipse.org/legal/epl-v10.html
###############################################################################
-ProcyonDecompilerDescriptor.PreferenceLabel=Procyon (Support JDK8)
+ProcyonDecompilerDescriptor.PreferenceLabel=Procyon (Support JDK9+)
JavaDecompilerActionBarContributor.Action.DecompileWithProcyon=&Procyon
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_CN.properties b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_CN.properties
deleted file mode 100644
index 1d1eab93..00000000
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_CN.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-ProcyonDecompilerDescriptor.PreferenceLabel=Procyon (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithProcyon=&Procyon
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_HK.properties b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_HK.properties
deleted file mode 100644
index 1d1eab93..00000000
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_HK.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-ProcyonDecompilerDescriptor.PreferenceLabel=Procyon (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithProcyon=&Procyon
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_TW.properties b/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_TW.properties
deleted file mode 100644
index 1d1eab93..00000000
--- a/org.sf.feeling.decompiler.procyon/src/org/sf/feeling/decompiler/procyon/i18n/messages_zh_TW.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Chen Chao - initial API and implementation
-###############################################################################
-
-ProcyonDecompilerDescriptor.PreferenceLabel=Procyon (支æŒJDK8)
-JavaDecompilerActionBarContributor.Action.DecompileWithProcyon=&Procyon
\ No newline at end of file
diff --git a/org.sf.feeling.decompiler.source.attach/.classpath b/org.sf.feeling.decompiler.source.attach/.classpath
deleted file mode 100644
index 4903274d..00000000
--- a/org.sf.feeling.decompiler.source.attach/.classpath
+++ /dev/null
@@ -1,34 +0,0 @@
-
-- * While this interface method is declared to throw {@code - * Exception}, implementers are strongly encouraged to declare - * concrete implementations of the {@code close} method to throw more - * specific exceptions, or to throw no exception at all if the close - * operation cannot fail. - * - *
- * Implementers of this interface are also strongly advised to not have - * the {@code close} method throw {@link InterruptedException}. - * - * This exception interacts with a thread's interrupted status, and runtime - * misbehavior is likely to occur if an {@code - * InterruptedException} is {@linkplain Throwable#addSuppressed suppressed}. - * - * More generally, if it would cause problems for an exception to be - * suppressed, the {@code AutoCloseable.close} method should not throw it. - * - *
- * Note that unlike the {@link java.io.Closeable#close close} method of
- * {@link java.io.Closeable}, this {@code close} method is not
- * required to be idempotent. In other words, calling this {@code close}
- * method more than once may have some visible side effect, unlike
- * {@code Closeable.close} which is required to have no effect if called
- * more than once.
- *
- * However, implementers of this interface are strongly encouraged to make
- * their {@code close} methods idempotent.
- *
- * @throws Exception
- * if this resource cannot be closed
- */
- void close( ) throws Exception;
-}
diff --git a/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/JGitScmProvider.java b/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/JGitScmProvider.java
deleted file mode 100644
index 4665b5cf..00000000
--- a/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/JGitScmProvider.java
+++ /dev/null
@@ -1,209 +0,0 @@
-
-package org.apache.maven.scm.provider.git.jgit;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-
-import org.apache.maven.scm.ScmException;
-import org.apache.maven.scm.ScmFileSet;
-import org.apache.maven.scm.command.info.InfoScmResult;
-import org.apache.maven.scm.provider.git.AbstractGitScmProvider;
-import org.apache.maven.scm.provider.git.command.GitCommand;
-import org.apache.maven.scm.provider.git.command.info.GitInfoItem;
-import org.apache.maven.scm.provider.git.jgit.command.add.JGitAddCommand;
-import org.apache.maven.scm.provider.git.jgit.command.blame.JGitBlameCommand;
-import org.apache.maven.scm.provider.git.jgit.command.branch.JGitBranchCommand;
-import org.apache.maven.scm.provider.git.jgit.command.changelog.JGitChangeLogCommand;
-import org.apache.maven.scm.provider.git.jgit.command.checkin.JGitCheckInCommand;
-import org.apache.maven.scm.provider.git.jgit.command.checkout.JGitCheckOutCommand;
-import org.apache.maven.scm.provider.git.jgit.command.diff.JGitDiffCommand;
-import org.apache.maven.scm.provider.git.jgit.command.list.JGitListCommand;
-import org.apache.maven.scm.provider.git.jgit.command.remoteinfo.JGitRemoteInfoCommand;
-import org.apache.maven.scm.provider.git.jgit.command.status.JGitStatusCommand;
-import org.apache.maven.scm.provider.git.jgit.command.tag.JGitTagCommand;
-import org.apache.maven.scm.repository.ScmRepositoryException;
-
-/**
- * @author Mark Struberg
- * @author Dominik Bartholdi (imod)
- * @plexus.component role="org.apache.maven.scm.provider.ScmProvider"
- * role-hint="jgit"
- * @since 1.9
- */
-public class JGitScmProvider extends AbstractGitScmProvider
-{
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getAddCommand( )
- {
- return new JGitAddCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getBranchCommand( )
- {
- return new JGitBranchCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getChangeLogCommand( )
- {
- return new JGitChangeLogCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getCheckInCommand( )
- {
- return new JGitCheckInCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getCheckOutCommand( )
- {
- return new JGitCheckOutCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getDiffCommand( )
- {
- return new JGitDiffCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getExportCommand( )
- {
- throw new UnsupportedOperationException( "getExportCommand" ); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getRemoveCommand( )
- {
- throw new UnsupportedOperationException( "getRemoveCommand" ); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getStatusCommand( )
- {
- return new JGitStatusCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getTagCommand( )
- {
- return new JGitTagCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getUpdateCommand( )
- {
- throw new UnsupportedOperationException( "getUpdateCommand" ); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getListCommand( )
- {
- return new JGitListCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GitCommand getInfoCommand( )
- {
- throw new UnsupportedOperationException( "getInfoCommand" ); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getRepositoryURL( File path ) throws ScmException
- {
- // Note: I need to supply just 1 absolute path, but ScmFileSet won't let
- // me without
- // a basedir (which isn't used here anyway), so use a dummy file.
- InfoScmResult result = info( null, new ScmFileSet( new File( "" ), path ), null ); //$NON-NLS-1$
-
- if ( result.getInfoItems( ).size( ) != 1 )
- {
- throw new ScmRepositoryException( "Cannot find URL: " //$NON-NLS-1$
- + ( result.getInfoItems( ).size( ) == 0 ? "no" : "multiple" ) //$NON-NLS-1$ //$NON-NLS-2$
- + " items returned by the info command" ); //$NON-NLS-1$
- }
-
- return ( (GitInfoItem) result.getInfoItems( ).get( 0 ) ).getURL( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getBlameCommand( )
- {
- return new JGitBlameCommand( );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected GitCommand getRemoteInfoCommand( )
- {
- return new JGitRemoteInfoCommand( );
- }
-}
diff --git a/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java b/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java
deleted file mode 100644
index 4d6fff0d..00000000
--- a/org.sf.feeling.decompiler.source.attach/src/org/apache/maven/scm/provider/git/jgit/command/JGitUtils.java
+++ /dev/null
@@ -1,483 +0,0 @@
-
-package org.apache.maven.scm.provider.git.jgit.command;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.scm.ScmFile;
-import org.apache.maven.scm.ScmFileSet;
-import org.apache.maven.scm.ScmFileStatus;
-import org.apache.maven.scm.log.ScmLogger;
-import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
-import org.apache.maven.scm.util.FilenameUtils;
-import org.codehaus.plexus.util.StringUtils;
-import org.eclipse.jgit.api.AddCommand;
-import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.Status;
-import org.eclipse.jgit.api.errors.GitAPIException;
-import org.eclipse.jgit.api.errors.InvalidRemoteException;
-import org.eclipse.jgit.api.errors.NoFilepatternException;
-import org.eclipse.jgit.api.errors.TransportException;
-import org.eclipse.jgit.diff.DiffEntry;
-import org.eclipse.jgit.diff.DiffEntry.ChangeType;
-import org.eclipse.jgit.diff.DiffFormatter;
-import org.eclipse.jgit.diff.RawTextComparator;
-import org.eclipse.jgit.errors.CorruptObjectException;
-import org.eclipse.jgit.errors.IncorrectObjectTypeException;
-import org.eclipse.jgit.errors.MissingObjectException;
-import org.eclipse.jgit.errors.StopWalkException;
-import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.ProgressMonitor;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.StoredConfig;
-import org.eclipse.jgit.lib.TextProgressMonitor;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.jgit.revwalk.RevFlag;
-import org.eclipse.jgit.revwalk.RevSort;
-import org.eclipse.jgit.revwalk.RevWalk;
-import org.eclipse.jgit.revwalk.filter.CommitTimeRevFilter;
-import org.eclipse.jgit.revwalk.filter.RevFilter;
-import org.eclipse.jgit.transport.CredentialsProvider;
-import org.eclipse.jgit.transport.PushResult;
-import org.eclipse.jgit.transport.RefSpec;
-import org.eclipse.jgit.transport.RemoteRefUpdate;
-import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
-import org.eclipse.jgit.treewalk.TreeWalk;
-import org.eclipse.jgit.util.io.DisabledOutputStream;
-import org.sf.feeling.decompiler.util.ReflectionUtils;
-
-/**
- * JGit utility functions.
- *
- * @author Mark Struberg
- * @author Dominik Bartholdi (imod)
- * @since 1.9
- */
-public class JGitUtils
-{
-
- private JGitUtils( )
- {
- // no op
- }
-
- /**
- * Closes the repository wrapped by the passed git object
- *
- * @param git
- */
- public static void closeRepo( Git git )
- {
- if ( git != null && git.getRepository( ) != null )
- {
- git.getRepository( ).close( );
- }
- }
-
- /**
- * Construct a logging ProgressMonitor for all JGit operations.
- *
- * @param logger
- * @return a ProgressMonitor for use
- */
- public static ProgressMonitor getMonitor( ScmLogger logger )
- {
- // X TODO write an own ProgressMonitor which logs to ScmLogger!
- return new TextProgressMonitor( );
- }
-
- /**
- * Prepares the in memory configuration of git to connect to the configured
- * repository. It configures the following settings in memory:
- *
null if there is not enough info to create a
- * provider with
- */
- public static CredentialsProvider getCredentials( GitScmProviderRepository repository )
- {
- if ( StringUtils.isNotBlank( repository.getUser( ) ) && StringUtils.isNotBlank( repository.getPassword( ) ) )
- {
- return new UsernamePasswordCredentialsProvider( repository.getUser( ).trim( ),
- repository.getPassword( ).trim( ) );
- }
- return null;
- }
-
- public static Iterablenull
- * @throws IOException
- * @throws MissingObjectException
- * @throws IncorrectObjectTypeException
- */
- public static Listgit config --global maven-scm.maildomain mycomp.com git config --global maven-scm.forceUsername true - * Note that this is broken when this class is deployed via a shared - * classloader in a container, as the warning message will be emitted only - * once, not once per webapp. However making the warning appear once per - * webapp means having a map keyed by context classloader which introduces - * nasty memory-leak problems. As this warning is really optional we can - * ignore this problem; only one of the webapps will get the warning in its - * logs but that should be good enough. - */ - private static boolean loggedAccessibleWarning = false; - - /** - * Indicates whether methods should be cached for improved performance. - *
- * Note that when this class is deployed via a shared classloader in a - * container, this will affect all webapps. However making this configurable - * per webapp would mean having a map keyed by context classloader which may - * introduce memory-leak problems. - */ - private static boolean CACHE_METHODS = true; - - /** An empty class array */ - private static final Class[] EMPTY_CLASS_PARAMETERS = new Class[0]; - /** An empty object array */ - private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; - - /** - * Stores a cache of MethodDescriptor -> Method in a WeakHashMap. - *
- * The keys into this map only ever exist as temporary variables within - * methods of this class, and are never exposed to users of this class. This - * means that the WeakHashMap is used only as a mechanism for limiting the - * size of the cache, ie a way to tell the garbage collector that the - * contents of the cache can be completely garbage-collected whenever it - * needs the memory. Whether this is a good approach to this problem is - * doubtful; something like the commons-collections LRUMap may be more - * appropriate (though of course selecting an appropriate size is an issue). - *
- * This static variable is safe even when this code is deployed via a shared
- * classloader because it is keyed via a MethodDescriptor object which has a
- * Class as one of its members and that member is used in the
- * MethodDescriptor.equals method. So two components that load the same
- * class via different classloaders will generate non-equal MethodDescriptor
- * objects and hence end up with different entries in the map.
- */
- private static final HashMap cache = new HashMap( );
-
- /**
- * Set whether methods should be cached for greater performance or not,
- * default is true.
- *
- * @param cacheMethods
- * true if methods should be cached for greater
- * performance, otherwise false
- */
- public static synchronized void setCacheMethods( boolean cacheMethods )
- {
- CACHE_METHODS = cacheMethods;
- if ( !CACHE_METHODS )
- {
- clearCache( );
- }
- }
-
- /**
- * Clear the method cache.
- *
- * @return the number of cached methods cleared
- */
- public static synchronized int clearCache( )
- {
- int size = cache.size( );
- cache.clear( );
- return size;
- }
-
- /**
- *
- * Invoke a named method whose parameter type matches the object type. - *
- * - *
- * The behaviour of this method is less deterministic than
- * invokeExactMethod(). It loops through all methods with names
- * that match and then executes the first it finds with compatable
- * parameters.
- *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * This is a convenient wrapper for - * {@link #invokeMethod(Object object,String methodName,Object [] args)}. - *
- * - * @param object - * invoke method on this object - * @param methodName - * get method with this name - * @param arg - * use this argument - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeMethod( Object object, String methodName, Object arg ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - Object[] args = { - arg - }; - return invokeMethod( object, methodName, args ); - - } - - /** - *- * Invoke a named method whose parameter type matches the object type. - *
- * - *- * The behaviour of this method is less deterministic than - * {@link #invokeExactMethod(Object object,String methodName,Object [] args)} - * . It loops through all methods with names that match and then executes - * the first it finds with compatable parameters. - *
- * - *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * This is a convenient wrapper for - * {@link #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)} - * . - *
- * - * @param object - * invoke method on this object - * @param methodName - * get method with this name - * @param args - * use these arguments - treat null as empty array - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeMethod( Object object, String methodName, Object[] args ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - if ( args == null ) - { - args = EMPTY_OBJECT_ARRAY; - } - int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; - for ( int i = 0; i < arguments; i++ ) - { - parameterTypes[i] = args[i].getClass( ); - } - return invokeMethod( object, methodName, args, parameterTypes ); - - } - - /** - *- * Invoke a named method whose parameter type matches the object type. - *
- * - *- * The behaviour of this method is less deterministic than - * {@link #invokeExactMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)} - * . It loops through all methods with names that match and then executes - * the first it finds with compatable parameters. - *
- * - *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * Invoke a method whose parameter type matches exactly the object type. - *
- * - *- * This is a convenient wrapper for - * {@link #invokeExactMethod(Object object,String methodName,Object [] args)} - * . - *
- * - * @param object - * invoke method on this object - * @param methodName - * get method with this name - * @param arg - * use this argument - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeExactMethod( Object object, String methodName, Object arg ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - Object[] args = { - arg - }; - return invokeExactMethod( object, methodName, args ); - - } - - /** - *- * Invoke a method whose parameter types match exactly the object types. - *
- * - *
- * This uses reflection to invoke the method obtained from a call to
- * getAccessibleMethod().
- *
- * Invoke a method whose parameter types match exactly the parameter types - * given. - *
- * - *
- * This uses reflection to invoke the method obtained from a call to
- * getAccessibleMethod().
- *
- * Invoke a static method whose parameter types match exactly the parameter - * types given. - *
- * - *- * This uses reflection to invoke the method obtained from a call to - * {@link #getAccessibleMethod(Class, String, Class[])}. - *
- * - * @param objectClass - * invoke static method on this class - * @param methodName - * get method with this name - * @param args - * use these arguments - treat null as empty array - * @param parameterTypes - * match these parameters - treat null as empty array - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeExactStaticMethod( Class objectClass, String methodName, Object[] args, - Class[] parameterTypes ) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - if ( args == null ) - { - args = EMPTY_OBJECT_ARRAY; - } - - if ( parameterTypes == null ) - { - parameterTypes = EMPTY_CLASS_PARAMETERS; - } - - Method method = getAccessibleMethod( objectClass, methodName, parameterTypes ); - if ( method == null ) - { - throw new NoSuchMethodException( - "No such accessible method: " + methodName + "() on class: " + objectClass.getName( ) ); //$NON-NLS-1$ //$NON-NLS-2$ - } - return method.invoke( null, args ); - - } - - /** - *- * Invoke a named static method whose parameter type matches the object - * type. - *
- * - *- * The behaviour of this method is less deterministic than - * {@link #invokeExactMethod(Object, String, Object[], Class[])}. It loops - * through all methods with names that match and then executes the first it - * finds with compatable parameters. - *
- * - *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * This is a convenient wrapper for - * {@link #invokeStaticMethod(Class objectClass,String methodName,Object [] args)} - * . - *
- * - * @param objectClass - * invoke static method on this class - * @param methodName - * get method with this name - * @param arg - * use this argument - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeStaticMethod( Class objectClass, String methodName, Object arg ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - Object[] args = { - arg - }; - return invokeStaticMethod( objectClass, methodName, args ); - - } - - /** - *- * Invoke a named static method whose parameter type matches the object - * type. - *
- * - *- * The behaviour of this method is less deterministic than - * {@link #invokeExactMethod(Object object,String methodName,Object [] args)} - * . It loops through all methods with names that match and then executes - * the first it finds with compatable parameters. - *
- * - *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * This is a convenient wrapper for - * {@link #invokeStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)} - * . - *
- * - * @param objectClass - * invoke static method on this class - * @param methodName - * get method with this name - * @param args - * use these arguments - treat null as empty array - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeStaticMethod( Class objectClass, String methodName, Object[] args ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - if ( args == null ) - { - args = EMPTY_OBJECT_ARRAY; - } - int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; - for ( int i = 0; i < arguments; i++ ) - { - parameterTypes[i] = args[i].getClass( ); - } - return invokeStaticMethod( objectClass, methodName, args, parameterTypes ); - - } - - /** - *- * Invoke a named static method whose parameter type matches the object - * type. - *
- * - *- * The behaviour of this method is less deterministic than - * {@link #invokeExactStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)} - * . It loops through all methods with names that match and then executes - * the first it finds with compatable parameters. - *
- * - *
- * This method supports calls to methods taking primitive parameters via
- * passing in wrapping classes. So, for example, a Boolean
- * class would match a boolean primitive.
- *
- * Invoke a static method whose parameter type matches exactly the object - * type. - *
- * - *- * This is a convenient wrapper for - * {@link #invokeExactStaticMethod(Class objectClass,String methodName,Object [] args)} - * . - *
- * - * @param objectClass - * invoke static method on this class - * @param methodName - * get method with this name - * @param arg - * use this argument - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeExactStaticMethod( Class objectClass, String methodName, Object arg ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - - Object[] args = { - arg - }; - return invokeExactStaticMethod( objectClass, methodName, args ); - - } - - /** - *- * Invoke a static method whose parameter types match exactly the object - * types. - *
- * - *- * This uses reflection to invoke the method obtained from a call to - * {@link #getAccessibleMethod(Class, String, Class[])}. - *
- * - * @param objectClass - * invoke static method on this class - * @param methodName - * get method with this name - * @param args - * use these arguments - treat null as empty array - * @return The value returned by the invoked method - * - * @throws NoSuchMethodException - * if there is no such accessible method - * @throws InvocationTargetException - * wraps an exception thrown by the method invoked - * @throws IllegalAccessException - * if the requested method is not accessible via reflection - */ - public static Object invokeExactStaticMethod( Class objectClass, String methodName, Object[] args ) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - if ( args == null ) - { - args = EMPTY_OBJECT_ARRAY; - } - int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; - for ( int i = 0; i < arguments; i++ ) - { - parameterTypes[i] = args[i].getClass( ); - } - return invokeExactStaticMethod( objectClass, methodName, args, parameterTypes ); - - } - - /** - *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) with given name and a single parameter. If no such method can
- * be found, return null. Basically, a convenience wrapper that
- * constructs a Class array for you.
- *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) with given name and parameters. If no such method can be
- * found, return null. This is just a convenient wrapper for
- * {@link #getAccessibleMethod(Method method)}.
- *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) that implements the specified Method. If no such method can
- * be found, return null.
- *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) that implements the specified Method. If no such method can
- * be found, return null.
- *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) by scanning through the superclasses. If no such method can
- * be found, return null.
- *
- * Return an accessible method (that is, one that can be invoked via
- * reflection) that implements the specified method, by scanning through all
- * implemented interfaces and subinterfaces. If no such method can be found,
- * return null.
- *
- * There isn't any good reason why this method must be private. It is - * because there doesn't seem any reason why other classes should call this - * rather than the higher level methods. - *
- * - * @param clazz - * Parent class for the interfaces to be checked - * @param methodName - * Method name of the method we wish to call - * @param parameterTypes - * The parameter type signatures - */ - private static Method getAccessibleMethodFromInterfaceNest( Class clazz, String methodName, Class[] parameterTypes ) - { - - Method method = null; - - // Search up the superclass chain - for ( ; clazz != null; clazz = clazz.getSuperclass( ) ) - { - - // Check the implemented interfaces of the parent class - Class[] interfaces = clazz.getInterfaces( ); - for ( int i = 0; i < interfaces.length; i++ ) - { - - // Is this interface public? - if ( !Modifier.isPublic( interfaces[i].getModifiers( ) ) ) - { - continue; - } - - // Does the method exist on this interface? - try - { - method = interfaces[i].getDeclaredMethod( methodName, parameterTypes ); - } - catch ( NoSuchMethodException e ) - { - /* - * Swallow, if no method is found after the loop then this - * method returns null. - */ - } - if ( method != null ) - { - return method; - } - - // Recursively check our parent interfaces - method = getAccessibleMethodFromInterfaceNest( interfaces[i], methodName, parameterTypes ); - if ( method != null ) - { - return method; - } - - } - - } - - return method; - } - - /** - *- * Find an accessible method that matches the given name and has compatible - * parameters. Compatible parameters mean that every method parameter is - * assignable from the given parameters. In other words, it finds a method - * with the given name that will take the parameters given. - *
- * - *
- * This method is slightly undeterminstic since it loops through methods - * names and return the first matching method. - *
- * - *- * This method is used by - * {@link #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)}. - * - *
- * This method can match primitive parameter by passing in wrapper classes.
- * For example, a Boolean will match a primitive
- * boolean parameter.
- *
- * @param clazz
- * find method in this class
- * @param methodName
- * find method with this name
- * @param parameterTypes
- * find method with compatible parameters
- * @return The accessible method
- */
- public static Method getMatchingAccessibleMethod( Class clazz, String methodName, Class[] parameterTypes )
- {
- MethodDescriptor md = new MethodDescriptor( clazz, methodName, parameterTypes, false );
-
- // see if we can find the method directly
- // most of the time this works and it's much faster
- try
- {
- // Check the cache first
- Method method = getCachedMethod( md );
- if ( method != null )
- {
- return method;
- }
-
- method = clazz.getMethod( methodName, parameterTypes );
-
- setMethodAccessible( method ); // Default access superclass
- // workaround
-
- cacheMethod( md, method );
- return method;
-
- }
- catch ( NoSuchMethodException e )
- { /* SWALLOW */
- }
-
- // search through all methods
- int paramSize = parameterTypes.length;
- Method bestMatch = null;
- Method[] methods = clazz.getMethods( );
- float bestMatchCost = Float.MAX_VALUE;
- float myCost = Float.MAX_VALUE;
- for ( int i = 0, size = methods.length; i < size; i++ )
- {
- if ( methods[i].getName( ).equals( methodName ) )
- {
-
- // compare parameters
- Class[] methodsParams = methods[i].getParameterTypes( );
- int methodParamSize = methodsParams.length;
- if ( methodParamSize == paramSize )
- {
- boolean match = true;
- for ( int n = 0; n < methodParamSize; n++ )
- {
-
- if ( !isAssignmentCompatible( methodsParams[n], parameterTypes[n] ) )
- {
-
- match = false;
- break;
- }
- }
-
- if ( match )
- {
- // get accessible version of method
- Method method = getAccessibleMethod( clazz, methods[i] );
- if ( method != null )
- {
-
- setMethodAccessible( method ); // Default access
- // superclass
- // workaround
- myCost = getTotalTransformationCost( parameterTypes, method.getParameterTypes( ) );
- if ( myCost < bestMatchCost )
- {
- bestMatch = method;
- bestMatchCost = myCost;
- }
- }
-
- }
- }
- }
- }
- if ( bestMatch != null )
- {
- cacheMethod( md, bestMatch );
- }
- else
- {
- // didn't find a match
-
- }
-
- return bestMatch;
- }
-
- /**
- * Try to make the method accessible
- *
- * @param method
- * The source arguments
- */
- private static void setMethodAccessible( Method method )
- {
- try
- {
- //
- // XXX Default access superclass workaround
- //
- // When a public class has a default access superclass
- // with public methods, these methods are accessible.
- // Calling them from compiled code works fine.
- //
- // Unfortunately, using reflection to invoke these methods
- // seems to (wrongly) to prevent access even when the method
- // modifer is public.
- //
- // The following workaround solves the problem but will only
- // work from sufficiently privilages code.
- //
- // Better workarounds would be greatfully accepted.
- //
- method.setAccessible( true );
-
- }
- catch ( SecurityException se )
- {
- // log but continue just in case the method.invoke works anyway
- if ( !loggedAccessibleWarning )
- {
- boolean vulnerableJVM = false;
- try
- {
- String specVersion = System.getProperty( "java.specification.version" ); //$NON-NLS-1$
- if ( specVersion.charAt( 0 ) == '1'
- && ( specVersion.charAt( 2 ) == '0'
- || specVersion.charAt( 2 ) == '1'
- || specVersion.charAt( 2 ) == '2'
- || specVersion.charAt( 2 ) == '3' ) )
- {
-
- vulnerableJVM = true;
- }
- }
- catch ( SecurityException e )
- {
- // don't know - so display warning
- vulnerableJVM = true;
- }
- if ( vulnerableJVM )
- {
-
- }
- loggedAccessibleWarning = true;
- }
-
- }
- }
-
- /**
- * Returns the sum of the object transformation cost for each class in the
- * source argument list.
- *
- * @param srcArgs
- * The source arguments
- * @param destArgs
- * The destination arguments
- * @return The total transformation cost
- */
- private static float getTotalTransformationCost( Class[] srcArgs, Class[] destArgs )
- {
-
- float totalCost = 0.0f;
- for ( int i = 0; i < srcArgs.length; i++ )
- {
- Class srcClass, destClass;
- srcClass = srcArgs[i];
- destClass = destArgs[i];
- totalCost += getObjectTransformationCost( srcClass, destClass );
- }
-
- return totalCost;
- }
-
- /**
- * Gets the number of steps required needed to turn the source class into
- * the destination class. This represents the number of steps in the object
- * hierarchy graph.
- *
- * @param srcClass
- * The source class
- * @param destClass
- * The destination class
- * @return The cost of transforming an object
- */
- private static float getObjectTransformationCost( Class srcClass, Class destClass )
- {
- float cost = 0.0f;
- while ( destClass != null && !destClass.equals( srcClass ) )
- {
- if ( destClass.isInterface( ) && isAssignmentCompatible( destClass, srcClass ) )
- {
- // slight penalty for interface match.
- // we still want an exact match to override an interface match,
- // but
- // an interface match should override anything where we have to
- // get a
- // superclass.
- cost += 0.25f;
- break;
- }
- cost++;
- destClass = destClass.getSuperclass( );
- }
-
- /*
- * If the destination class is null, we've travelled all the way up to
- * an Object match. We'll penalize this by adding 1.5 to the cost.
- */
- if ( destClass == null )
- {
- cost += 1.5f;
- }
-
- return cost;
- }
-
- /**
- *
- * Determine whether a type can be used as a parameter in a method - * invocation. This method handles primitive conversions correctly. - *
- * - *
- * In order words, it will match a January 28, 2005 THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT. Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.
- For purposes of the EPL, "Program" will mean the Content. Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
- modules ("Modules") and made available as downloadable archives ("Downloads"). Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features"). A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins and/or Fragments associated with a Feature. Plug-ins and Fragments are located in directories
- named "plugins" and Features are located in directories named "features". Features may also include other Features ("Included Features"). Files named "feature.xml" may contain a list of the names and version numbers of Included Features. The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
-Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations: Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties".
-Such Abouts, Feature Licenses and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory. THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO): IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content. Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.Boolean to a
- * boolean, a Long to a long, a
- * Float to a float, a Integer to a
- * int, and a Double to a double. Now
- * logic widening matches are allowed. For example, a Long will
- * not match a int.
- *
- * @param parameterType
- * the type of parameter accepted by the method
- * @param parameterization
- * the type of parameter being tested
- *
- * @return true if the assignement is compatible.
- */
- public static final boolean isAssignmentCompatible( Class parameterType, Class parameterization )
- {
- // try plain assignment
- if ( parameterType.isAssignableFrom( parameterization ) )
- {
- return true;
- }
-
- if ( parameterType.isPrimitive( ) )
- {
- // this method does *not* do widening - you must specify exactly
- // is this the right behaviour?
- Class parameterWrapperClazz = getPrimitiveWrapper( parameterType );
- if ( parameterWrapperClazz != null )
- {
- return parameterWrapperClazz.equals( parameterization );
- }
- }
-
- return false;
- }
-
- /**
- * Gets the wrapper object class for the given primitive type class. For
- * example, passing boolean.class returns
- * Boolean.class
- *
- * @param primitiveType
- * the primitive type class for which a match is to be found
- * @return the wrapper type associated with the given primitive or null if
- * no match is found
- */
- public static Class getPrimitiveWrapper( Class primitiveType )
- {
- // does anyone know a better strategy than comparing names?
- if ( boolean.class.equals( primitiveType ) )
- {
- return Boolean.class;
- }
- else if ( float.class.equals( primitiveType ) )
- {
- return Float.class;
- }
- else if ( long.class.equals( primitiveType ) )
- {
- return Long.class;
- }
- else if ( int.class.equals( primitiveType ) )
- {
- return Integer.class;
- }
- else if ( short.class.equals( primitiveType ) )
- {
- return Short.class;
- }
- else if ( byte.class.equals( primitiveType ) )
- {
- return Byte.class;
- }
- else if ( double.class.equals( primitiveType ) )
- {
- return Double.class;
- }
- else if ( char.class.equals( primitiveType ) )
- {
- return Character.class;
- }
- else
- {
-
- return null;
- }
- }
-
- /**
- * Gets the class for the primitive type corresponding to the primitive
- * wrapper class given. For example, an instance of
- * Boolean.class returns a boolean.class.
- *
- * @param wrapperType
- * the
- * @return the primitive type class corresponding to the given wrapper
- * class, null if no match is found
- */
- public static Class getPrimitiveType( Class wrapperType )
- {
- // does anyone know a better strategy than comparing names?
- if ( Boolean.class.equals( wrapperType ) )
- {
- return boolean.class;
- }
- else if ( Float.class.equals( wrapperType ) )
- {
- return float.class;
- }
- else if ( Long.class.equals( wrapperType ) )
- {
- return long.class;
- }
- else if ( Integer.class.equals( wrapperType ) )
- {
- return int.class;
- }
- else if ( Short.class.equals( wrapperType ) )
- {
- return short.class;
- }
- else if ( Byte.class.equals( wrapperType ) )
- {
- return byte.class;
- }
- else if ( Double.class.equals( wrapperType ) )
- {
- return double.class;
- }
- else if ( Character.class.equals( wrapperType ) )
- {
- return char.class;
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Find a non primitive representation for given primitive class.
- *
- * @param clazz
- * the class to find a representation for, not null
- * @return the original class if it not a primitive. Otherwise the wrapper
- * class. Not null
- */
- public static Class toNonPrimitiveClass( Class clazz )
- {
- if ( clazz.isPrimitive( ) )
- {
- Class primitiveClazz = MethodUtils.getPrimitiveWrapper( clazz );
- // the above method returns
- if ( primitiveClazz != null )
- {
- return primitiveClazz;
- }
- else
- {
- return clazz;
- }
- }
- else
- {
- return clazz;
- }
- }
-
- /**
- * Return the method from the cache, if present.
- *
- * @param md
- * The method descriptor
- * @return The cached method
- */
- private static Method getCachedMethod( MethodDescriptor md )
- {
- if ( CACHE_METHODS )
- {
- Reference methodRef = (Reference) cache.get( md );
- if ( methodRef != null )
- {
- return (Method) methodRef.get( );
- }
- }
- return null;
- }
-
- /**
- * Add a method to the cache.
- *
- * @param md
- * The method descriptor
- * @param method
- * The method to cache
- */
- private static void cacheMethod( MethodDescriptor md, Method method )
- {
- if ( CACHE_METHODS )
- {
- if ( method != null )
- {
- cache.put( md, new WeakReference( method ) );
- }
- }
- }
-
- /**
- * Represents the key to looking up a Method by reflection.
- */
- private static class MethodDescriptor
- {
-
- private Class cls;
- private String methodName;
- private Class[] paramTypes;
- private boolean exact;
- private int hashCode;
-
- /**
- * The sole constructor.
- *
- * @param cls
- * the class to reflect, must not be null
- * @param methodName
- * the method name to obtain
- * @param paramTypes
- * the array of classes representing the paramater types
- * @param exact
- * whether the match has to be exact.
- */
- public MethodDescriptor( Class cls, String methodName, Class[] paramTypes, boolean exact )
- {
- if ( cls == null )
- {
- throw new IllegalArgumentException( "Class cannot be null" ); //$NON-NLS-1$
- }
- if ( methodName == null )
- {
- throw new IllegalArgumentException( "Method Name cannot be null" ); //$NON-NLS-1$
- }
- if ( paramTypes == null )
- {
- paramTypes = EMPTY_CLASS_PARAMETERS;
- }
-
- this.cls = cls;
- this.methodName = methodName;
- this.paramTypes = paramTypes;
- this.exact = exact;
-
- this.hashCode = methodName.length( );
- }
-
- /**
- * Checks for equality.
- *
- * @param obj
- * object to be tested for equality
- * @return true, if the object describes the same Method.
- */
- @Override
- public boolean equals( Object obj )
- {
- if ( !( obj instanceof MethodDescriptor ) )
- {
- return false;
- }
- MethodDescriptor md = (MethodDescriptor) obj;
-
- return ( exact == md.exact
- && methodName.equals( md.methodName )
- && cls.equals( md.cls )
- && java.util.Arrays.equals( paramTypes, md.paramTypes ) );
- }
-
- /**
- * Returns the string length of method name. I.e. if the hashcodes are
- * different, the objects are different. If the hashcodes are the same,
- * need to use the equals method to determine equality.
- *
- * @return the string length of method name.
- */
- @Override
- public int hashCode( )
- {
- return hashCode;
- }
- }
-}
diff --git a/org.sf.feeling.decompiler.source.attach/src/org/sf/feeling/decompiler/source/attach/utils/SourceAttachUtil.java b/org.sf.feeling.decompiler.source.attach/src/org/sf/feeling/decompiler/source/attach/utils/SourceAttachUtil.java
deleted file mode 100644
index acdb1bc4..00000000
--- a/org.sf.feeling.decompiler.source.attach/src/org/sf/feeling/decompiler/source/attach/utils/SourceAttachUtil.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2017 Chen Chao(cnfree2000@hotmail.com).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chen Chao - initial API and implementation
- *******************************************************************************/
-
-package org.sf.feeling.decompiler.source.attach.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.apache.commons.io.FilenameUtils;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
-import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport;
-import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement;
-import org.sf.feeling.decompiler.source.attach.handler.JavaSourceAttacherHandler;
-import org.sf.feeling.decompiler.util.FileUtil;
-import org.sf.feeling.decompiler.util.HashUtils;
-import org.sf.feeling.decompiler.util.Logger;
-import org.sf.feeling.decompiler.util.ReflectionUtils;
-
-@SuppressWarnings("restriction")
-public class SourceAttachUtil
-{
-
- public static File getBinFile( IPackageFragmentRoot root )
- {
- File binFile;
- if ( !root.isExternal( ) )
- {
- binFile = root.getResource( ).getLocation( ).toFile( );
- }
- else
- {
- binFile = root.getPath( ).toFile( );
- }
- return binFile;
- }
-
- public static boolean reattchSource( final IPackageFragmentRoot pkgRoot, File sourceFile, File tempSourceFile,
- String downloadUrl )
- {
- try
- {
- IPath sourcePath = pkgRoot.getSourceAttachmentPath( );
- File tempfile = new File( sourcePath.toOSString( ) );
- File tempFile;
-
- if ( !tempfile.getAbsolutePath( ).equals( tempSourceFile.getAbsolutePath( ) ) )
- {
- tempFile = tempSourceFile;
- }
- else
- {
- String suffix = "-" + System.currentTimeMillis( ) + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$
- tempFile = new File( SourceConstants.SourceTempDir,
- sourceFile.getName( )
- .replaceAll( "(?i)(\\-)*(\\d)*(\\.)jar", suffix ) //$NON-NLS-1$
- .replaceAll( "(?i)(\\-)*(\\d)*(\\.)zip", suffix ) ); //$NON-NLS-1$
- }
-
- if ( !tempFile.exists( ) )
- {
- if ( tempSourceFile.exists( ) )
- {
- tempSourceFile.renameTo( tempFile );
- }
- else
- {
- FileUtil.copyFile( sourceFile.getAbsolutePath( ), tempFile.getAbsolutePath( ) );
- }
- }
- JavaSourceAttacherHandler.attachSource( pkgRoot, tempFile );
- tempFile.deleteOnExit( );
- String sha = HashUtils.sha1Hash( SourceAttachUtil.getBinFile( pkgRoot ) );
- SourceBindingUtil.saveSourceBindingRecord( sourceFile, sha, downloadUrl, tempFile );
- return true;
- }
- catch ( Exception e )
- {
- Logger.debug( e );
- }
- return false;
- }
-
- public static boolean refreshSourceAttachStatus( final IPackageFragmentRoot root )
- {
- try
- {
- String sha = HashUtils.sha1Hash( getBinFile( root ) );
- String[] files = SourceBindingUtil.getSourceFileBySha( sha );
- if ( files != null && files[0] != null )
- {
- File sourceFile = new File( files[0] );
- if ( !sourceFile.exists( ) )
- {
- return false;
- }
- File tempFile = new File( files[1] );
- if ( files[1] != null && tempFile.exists( ) )
- {
- JavaSourceAttacherHandler.attachSource( root, tempFile );
- SourceBindingUtil.saveSourceBindingRecord( sourceFile, sha, null, tempFile );
-
- if ( sourceFile.getName( ).startsWith( "jre_" ) ) //$NON-NLS-1$
- {
- refreshJRELibrarySources( root );
- }
-
- if ( sourceFile.getName( ).startsWith( "eclipse_" ) ) //$NON-NLS-1$
- {
- ListEclipse Foundation Software User Agreement
-Usage Of Content
-
-Applicable Licenses
-
-
-
-
-
-
-
-Cryptography
-
-