Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8b20d72
Another way to get current directory
ydanila Feb 25, 2015
060bd16
Test for annotations renaming
ydanila Feb 27, 2015
82cbaf9
Support for method params annotations
ydanila Feb 27, 2015
ee965b8
Fix for the generics with attributes
ydanila Feb 27, 2015
442fbb1
Fix for the enum with instance fields
ydanila Feb 27, 2015
fa673fe
More flexible behaviour for the Sharpen with new extra CLI switches
ydanila Feb 28, 2015
c7dbb53
Test for conversion Java interface to C# class
ydanila Mar 2, 2015
fa701bb
Support for multiple variable declarations in for cycle init section
ydanila Mar 2, 2015
cc1abfc
Test resources moved to the new project structure
ydanila Mar 3, 2015
d5b30fd
Fixed static field import detection
ydanila Mar 11, 2015
4d755ca
Wrong sharpen.core references replaced by src
ydanila Mar 11, 2015
e2c46ec
Now block comments keeps original indentation
ydanila Mar 11, 2015
64ebfba
Fix for char autocasting
ydanila Mar 12, 2015
07f0f12
Autocasting for conditional expression
ydanila Mar 12, 2015
0f63199
Unchecked casts type mapping
ydanila Mar 12, 2015
4977bda
Declaration expression autocasting
ydanila Mar 12, 2015
fb4aa7f
Nested class invocation fix
ydanila Mar 13, 2015
2aa0b79
Collection<> also is generic collection
ydanila Mar 13, 2015
6860fb2
Do not add unchecked cast if cast already defined
ydanila Mar 14, 2015
1a327d9
Removed excessive casting like (short)(unchecked(short))
ydanila Mar 15, 2015
eac7640
Better support for wildcards conversion
ydanila Mar 16, 2015
cdaa787
Autocasting support for double? with test
ydanila Mar 29, 2015
782d5ec
Better support for double? casting to double
ydanila Mar 29, 2015
0d8dd09
Fixed duplication of casting expression
ydanila Mar 30, 2015
f8ae480
Fixed side-effect with adding excessive usings
ydanila Mar 30, 2015
84b1c59
Refactoring
ydanila Mar 30, 2015
0b2a85d
Support for other nullable types with tests
ydanila Mar 30, 2015
fdb91c5
Better support for value types casting including constructor invocation
ydanila Mar 30, 2015
fd53e9f
Support for safe casting of some value types
ydanila Mar 30, 2015
129fadb
Support for nullable autocasting to value type
ydanila Mar 30, 2015
58bb4c0
Tests for constructor invocation
ydanila Mar 31, 2015
9b21999
Tests for safe casts and safe casts replacements
ydanila Mar 31, 2015
08a8a86
Support for unchecked cast long -> int with test
ydanila Mar 31, 2015
c818e87
Fox for nullable boolean support
ydanila Mar 31, 2015
916087c
Support for long? -> double casting
ydanila Apr 1, 2015
291761a
Fix for the wrong casting conversion - introduced implicit conversion…
ydanila Apr 3, 2015
8816774
Merge remote-tracking branch 'ydanila2/develop' into develop
lilith Apr 29, 2015
2fab358
Merge remote-tracking branch 'upstream/master' into develop
lilith Apr 29, 2015
8ab6096
pom.xml fix for newer java version use by maven
moljac Aug 27, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[imazen/sharpen](https://github.com/imazen/sharpen) [![master](https://img.shields.io/travis/imazen/sharpen/master.svg?label=imazen%20master)](https://travis-ci.org/imazen/sharpen/builds)[![imazen master - AppVeyor](https://ci.appveyor.com/api/projects/status/qxrbmyx70iuoev0x/branch/master?svg=true&passingText=imazen%20master%20-%20passing&failingText=imazen%20master%20-%20failed)](https://ci.appveyor.com/project/imazen/sharpen/branch/master) [![develop](https://img.shields.io/travis/imazen/sharpen/develop.svg?label=imazen%20develop)](https://travis-ci.org/imazen/sharpen/builds)
[![imazen develop - AppVeyor](https://ci.appveyor.com/api/projects/status/qxrbmyx70iuoev0x/branch/develop?svg=true&passingText=imazen%20develop%20-%20passing&failingText=imazen%20develop%20-%20failed)](https://ci.appveyor.com/project/imazen/sharpen/branch/develop)

[slluis/sharpen](https://github.com/imazen/sharpen) [![master](https://img.shields.io/travis/slluis/sharpen/master.svg?label=slluis%20master)](https://travis-ci.org/slluis/sharpen/builds)[![slluis master - AppVeyor](https://ci.appveyor.com/api/projects/status/[projectid]/branch/master?svg=true&passingText=slluis%20master%20-%20passing&failingText=slluis%20master%20-%20failed)](https://ci.appveyor.com/project/slluis/sharpen/branch/master) [![develop](https://img.shields.io/travis/slluis/sharpen/develop.svg?label=slluis%20develop)](https://travis-ci.org/slluis/sharpen/builds)
[![slluis develop - AppVeyor](https://ci.appveyor.com/api/projects/status/[projectid]/branch/develop?svg=true&passingText=slluis%20develop%20-%20passing&failingText=slluis%20develop%20-%20failed)](https://ci.appveyor.com/project/slluis/sharpen/branch/develop)
[mono/sharpen](https://github.com/mono/sharpen) [![master](https://img.shields.io/travis/mono/sharpen/master.svg?label=mono%20master)](https://travis-ci.org/mono/sharpen/builds)[![mono master - AppVeyor (permissions issue)](https://ci.appveyor.com/api/projects/status/[projectid]/branch/master?svg=true&passingText=slluis%20master%20-%20passing&failingText=slluis%20master%20-%20failed)](https://ci.appveyor.com/project/imazen/imazen/branch/master) [![develop](https://img.shields.io/travis/mono/sharpen/develop.svg?label=mono%20develop)](https://travis-ci.org/mono/sharpen/builds)
[![mono develop - AppVeyor (permissions issue)](https://ci.appveyor.com/api/projects/status/[projectid]/branch/develop?svg=true&passingText=mono%20develop%20-%20passing&failingText=mono%20develop%20-%20failed)](https://ci.appveyor.com/project/mono/sharpen/branch/develop)



Expand All @@ -22,7 +22,7 @@ Sharpen was originally created by db40 [svn source here](https://source.db4o.com
1. Clone this repository
2. Install Java 7 and maven. Java 6 and 8 aren’t supported.
3. Run ‘mvn clean test’ to test
4. Run ‘mvn install ’ to generate .jar files in /sharpen.core/target
4. Run ‘mvn install ’ to generate .jar files in /src/target

### Running sharpen

Expand All @@ -38,7 +38,7 @@ Sharpen’s command-line options don’t let you fully override all conversion o
#### Creating external config class

Your external configuration class must:
* inherit [Configuration](sharpen.core/src/sharpen/core/Configuration.java) class;
* inherit [Configuration](src/main/sharpen/core/Configuration.java) class;
* must be publicly visible;
* must have a public constructor;

Expand Down
54 changes: 54 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,60 @@
</testResources>

<plugins>
<!--
==============================================================================================
begin FIX
moljac/moljac++/moljacsharp

by default maven uses sorde 1.3 (java 3???) thus missing a lot of modern
java features.
Following errors might occur:

error: generics are not supported in -source 1.3
error: for-each loops are not supported in -source 1.3
error: annotations are not supported in -source 1.3
error: variable-arity methods are not supported in -source 1.3

[ERROR] sharpen/src/main/sharpen/core/csharp/ast/CSAbstractInvocation.java:[28,15]
error: generics are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] sharpen/src/main/sharpen/core/csharp/ast/CSAbstractInvocation.java:[34,24]
error: for-each loops are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable for-each loops)
[ERROR] sharpen/src/main/sharpen/core/framework/DynamicVariable.java:[26,28]
error: generics are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] sharpen/src/main/sharpen/core/csharp/ast/CSForStatement.java:[30,13]
error: generics are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] sharpen/src/main/sharpen/core/csharp/ast/CSField.java:[29,12]
error: generics are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] sharpen/src/main/sharpen/core/framework/ConversionBatch.java:[25,3]
error: annotations are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable annotations)
[ERROR] sharpen/src/main/sharpen/core/framework/ConversionBatch.java:[26,5]
error: generics are not supported in -source 1.3
[ERROR] (use -source 5 or higher to enable generics)
[ERROR] sharpen/src/main/sharpen/core/framework/ConversionBatch.java:[48,34]
error: variable-arity methods are not supported in -source 1.3


Added this into pom.xml:
//build/plugins
-->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!--
end FIX
==============================================================================================
-->

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down
6 changes: 4 additions & 2 deletions src/main/sharpen/core/AbstractNestedClassBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
*/
public abstract class AbstractNestedClassBuilder extends CSharpBuilder {

private boolean _usesEnclosingMember;
public static final String ENCLOSING_FIELD = "_enclosing";

private boolean _usesEnclosingMember;

public AbstractNestedClassBuilder(CSharpBuilder other) {
super(other);
Expand Down Expand Up @@ -145,7 +147,7 @@ private ITypeBinding getDeclaringClass(Name reference) {
}

protected CSField createEnclosingField() {
return CSharpCode.newPrivateReadonlyField("_enclosing", enclosingTypeReference());
return CSharpCode.newPrivateReadonlyField(ENCLOSING_FIELD, enclosingTypeReference());
}

private CSTypeReference enclosingTypeReference() {
Expand Down
Loading