diff --git a/Makefile.in b/Makefile.in
index b419fadcd2..dad2e1f88f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -85,7 +85,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/config.h.in mkinstalldirs \
$(srcdir)/mono-core.spec.in $(srcdir)/mono-uninstalled.pc.in \
AUTHORS COPYING.LIB ChangeLog NEWS compile config.guess \
- config.rpath config.sub depcomp install-sh missing ltmain.sh
+ config.rpath config.sub install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
diff --git a/README.md b/README.md
index d600ce4ad1..609b9fa466 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
Mono is a software platform designed to allow developers to easily create cross platform applications.
Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.
-[![Build Status](http://monojenkins.cloudapp.net/job/Mono/badge/icon)](http://monojenkins.cloudapp.net/job/Mono/)
+[![Build Status](http://jenkins.mono-project.com/job/test-mono-mainline/badge/icon/)](http://jenkins.mono-project.com/job/test-mono-mainline/)
1. [Installation](#compilation-and-installation)
2. [Using Mono](#using-mono)
diff --git a/autogen.sh b/autogen.sh
index 5213ecffd3..d4a6ecaccb 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -123,7 +123,6 @@ if test x$has_ext_mod = xtrue; then
popd
else
cat mono/mini/Makefile.am.in > mono/mini/Makefile.am
- cat mono/metadata/Makefile.am.in > mono/metadata/Makefile.am
fi
diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id
index d901c34140..5526f189a3 100644
--- a/configure.REMOVED.git-id
+++ b/configure.REMOVED.git-id
@@ -1 +1 @@
-e2d46ae5f394ada396886d241225ad895d4fa194
\ No newline at end of file
+f98bd1e8bf7b203688329a408624ecaaf8192c9a
\ No newline at end of file
diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id
index aefe5b6d2e..c4a1fd294d 100644
--- a/configure.ac.REMOVED.git-id
+++ b/configure.ac.REMOVED.git-id
@@ -1 +1 @@
-9ad91a3e3e9b4a437dedfc1a32a3c9092d967f5e
\ No newline at end of file
+6792b0c1cb1e40049a4610645db04eb603741561
\ No newline at end of file
diff --git a/docs/deploy/mono-api-class.html b/docs/deploy/mono-api-class.html
index f6320d90c9..287cba06d0 100644
--- a/docs/deploy/mono-api-class.html
+++ b/docs/deploy/mono-api-class.html
@@ -377,7 +377,7 @@ mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_c
Parameters
-
klass:
where to look for the method
name_space:
name of the method
param_count:
number of parameters. -1 for any number.
+
klass:
where to look for the method
name:
name of the method
param_count:
number of parameters. -1 for any number.
Remarks
Obtains a MonoMethod with a given name and number of parameters.
diff --git a/docs/deploy/mono-api-wapi.html b/docs/deploy/mono-api-wapi.html
index b1b8fe8dc8..778f9f9731 100644
--- a/docs/deploy/mono-api-wapi.html
+++ b/docs/deploy/mono-api-wapi.html
@@ -283,15 +283,8 @@
-Remarks
- currently used.
-
- Initialises a critical section and sets the spin count. This
- implementation just calls InitializeCriticalSection().
-
- Return value: %TRUE on success, %FALSE otherwise. (%FALSE never
- happens).
-Remarks
- currently used.
-
- Sets the spin count for the critical section section. The spin
- count is currently ignored, and set to zero.
-
- Return value: The previous spin count. (Currently always zero).
-Remarks
-
- Attempts to enter a critical section without blocking. If
- successful the calling thread takes ownership of the critical
- section.
-
- A thread can recursively call EnterCriticalSection() and
- TryEnterCriticalSection(), but must call LeaveCriticalSection() an
- equal number of times.
-
- Return value: %TRUE if the thread successfully locked the critical
- section, %FALSE otherwise.
diff --git a/eglib/src/eglib-remap.h b/eglib/src/eglib-remap.h
index 9b4ecf1aeb..5c918d25da 100644
--- a/eglib/src/eglib-remap.h
+++ b/eglib/src/eglib-remap.h
@@ -273,3 +273,9 @@
#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
#define g_utf8_prev_char monoeg_utf8_prev_char
#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
+
+
+#define g_log_default_handler monoeg_log_default_handler
+#define g_log_set_default_handler monoeg_log_set_default_handler
+#define g_set_print_handler monoeg_set_print_handler
+#define g_set_printerr_handler monoeg_set_printerr_handler
diff --git a/eglib/src/glib.h b/eglib/src/glib.h
index 7cb8e6179c..533c84116c 100644
--- a/eglib/src/glib.h
+++ b/eglib/src/glib.h
@@ -603,10 +603,14 @@ void g_assertion_message (const gchar *format, ...) G_GNUC_NORETURN
#define g_message(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
#endif /* ndef HAVE_C99_SUPPORT */
-#define g_log_set_handler(a,b,c,d)
-#define G_GNUC_INTERNAL
+typedef void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
+typedef void (*GPrintFunc) (const gchar *string);
+void g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data);
+GLogFunc g_log_set_default_handler (GLogFunc log_func, gpointer user_data);
+GPrintFunc g_set_print_handler (GPrintFunc func);
+GPrintFunc g_set_printerr_handler (GPrintFunc func);
/*
* Conversions
*/
diff --git a/eglib/src/goutput.c b/eglib/src/goutput.c
index 73ef1f383d..1dc8bd6faf 100644
--- a/eglib/src/goutput.c
+++ b/eglib/src/goutput.c
@@ -35,85 +35,47 @@
/* The current fatal levels, error is always fatal */
static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
+static GLogFunc default_log_func;
+static gpointer default_log_func_user_data;
+static GPrintFunc stdout_handler, stderr_handler;
-#if PLATFORM_ANDROID
-#include
-
-static android_LogPriority
-to_android_priority (GLogLevelFlags log_level)
-{
- switch (log_level & G_LOG_LEVEL_MASK)
- {
- case G_LOG_LEVEL_ERROR: return ANDROID_LOG_FATAL;
- case G_LOG_LEVEL_CRITICAL: return ANDROID_LOG_ERROR;
- case G_LOG_LEVEL_WARNING: return ANDROID_LOG_WARN;
- case G_LOG_LEVEL_MESSAGE: return ANDROID_LOG_INFO;
- case G_LOG_LEVEL_INFO: return ANDROID_LOG_DEBUG;
- case G_LOG_LEVEL_DEBUG: return ANDROID_LOG_VERBOSE;
- }
- return ANDROID_LOG_UNKNOWN;
-}
-
-static void
-out_vfprintf (FILE *ignore, const gchar *format, va_list args)
-{
- /* TODO: provide a proper app name */
- __android_log_vprint (ANDROID_LOG_ERROR, "mono", format, args);
-}
-#elif MONOTOUCH && defined(__arm__)
-#include
-
-static int
-to_asl_priority (GLogLevelFlags log_level)
-{
- switch (log_level & G_LOG_LEVEL_MASK)
- {
- case G_LOG_LEVEL_ERROR: return ASL_LEVEL_CRIT;
- case G_LOG_LEVEL_CRITICAL: return ASL_LEVEL_ERR;
- case G_LOG_LEVEL_WARNING: return ASL_LEVEL_WARNING;
- case G_LOG_LEVEL_MESSAGE: return ASL_LEVEL_NOTICE;
- case G_LOG_LEVEL_INFO: return ASL_LEVEL_INFO;
- case G_LOG_LEVEL_DEBUG: return ASL_LEVEL_DEBUG;
- }
- return ASL_LEVEL_ERR;
-}
-
-static void
-out_vfprintf (FILE *ignore, const gchar *format, va_list args)
-{
- asl_vlog (NULL, NULL, ASL_LEVEL_WARNING, format, args);
-}
-
-#else
-static void
-out_vfprintf (FILE *file, const gchar *format, va_list args)
-{
- vfprintf (file, format, args);
-}
-#endif
+static void default_stdout_handler (const gchar *string);
+static void default_stderr_handler (const gchar *string);
void
g_print (const gchar *format, ...)
{
+ char *msg;
va_list args;
va_start (args, format);
-
- out_vfprintf (stdout, format, args);
-
+ if (vasprintf (&msg, format, args) < 0)
+ return;
va_end (args);
+
+ if (!stdout_handler)
+ stdout_handler = default_stdout_handler;
+
+ stdout_handler (msg);
+ free (msg);
}
void
g_printerr (const gchar *format, ...)
{
+ char *msg;
va_list args;
va_start (args, format);
-
- out_vfprintf (stderr, format, args);
-
+ if (vasprintf (&msg, format, args) < 0)
+ return;
va_end (args);
+
+ if (!stderr_handler)
+ stderr_handler = default_stderr_handler;
+
+ stderr_handler (msg);
+ free (msg);
}
GLogLevelFlags
@@ -140,42 +102,16 @@ g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask)
void
g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
{
-#if PLATFORM_ANDROID
- __android_log_vprint (to_android_priority (log_level), log_domain, format, args);
-#elif MONOTOUCH && defined(__arm__)
- asl_vlog (NULL, NULL, to_asl_priority (log_level), format, args);
-#else
char *msg;
+
+ if (!default_log_func)
+ default_log_func = g_log_default_handler;
if (vasprintf (&msg, format, args) < 0)
return;
-#ifdef G_OS_WIN32
- printf ("%s%s%s\n",
- log_domain != NULL ? log_domain : "",
- log_domain != NULL ? ": " : "",
- msg);
-#else
-#if MONOTOUCH
- FILE *target = stderr;
-#else
- FILE *target = stdout;
-#endif
-
- fprintf (target, "%s%s%s\n",
- log_domain != NULL ? log_domain : "",
- log_domain != NULL ? ": " : "",
- msg);
-#endif
+ default_log_func (log_domain, log_level, msg, default_log_func_user_data);
free (msg);
- if (log_level & fatal){
- fflush (stdout);
- fflush (stderr);
- }
-#endif
- if (log_level & fatal){
- abort ();
- }
}
void
@@ -196,6 +132,143 @@ g_assertion_message (const gchar *format, ...)
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
- abort ();
+}
+
+
+#if PLATFORM_ANDROID
+#include
+
+static android_LogPriority
+to_android_priority (GLogLevelFlags log_level)
+{
+ switch (log_level & G_LOG_LEVEL_MASK)
+ {
+ case G_LOG_LEVEL_ERROR: return ANDROID_LOG_FATAL;
+ case G_LOG_LEVEL_CRITICAL: return ANDROID_LOG_ERROR;
+ case G_LOG_LEVEL_WARNING: return ANDROID_LOG_WARN;
+ case G_LOG_LEVEL_MESSAGE: return ANDROID_LOG_INFO;
+ case G_LOG_LEVEL_INFO: return ANDROID_LOG_DEBUG;
+ case G_LOG_LEVEL_DEBUG: return ANDROID_LOG_VERBOSE;
+ }
+ return ANDROID_LOG_UNKNOWN;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ __android_log_write (to_android_priority (log_level), log_domain, message);
+ if (log_level & fatal)
+ abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+ /* TODO: provide a proper app name */
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+ /* TODO: provide a proper app name */
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+
+#elif MONOTOUCH
+#include
+
+static int
+to_asl_priority (GLogLevelFlags log_level)
+{
+ switch (log_level & G_LOG_LEVEL_MASK)
+ {
+ case G_LOG_LEVEL_ERROR: return ASL_LEVEL_CRIT;
+ case G_LOG_LEVEL_CRITICAL: return ASL_LEVEL_ERR;
+ case G_LOG_LEVEL_WARNING: return ASL_LEVEL_WARNING;
+ case G_LOG_LEVEL_MESSAGE: return ASL_LEVEL_NOTICE;
+ case G_LOG_LEVEL_INFO: return ASL_LEVEL_INFO;
+ case G_LOG_LEVEL_DEBUG: return ASL_LEVEL_DEBUG;
+ }
+ return ASL_LEVEL_ERR;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ asl_log (NULL, NULL, to_asl_priority (log_level), "%s", message);
+ if (log_level & fatal)
+ abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+ asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+ asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+#else
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ FILE *target = stdout;
+
+ fprintf (target, "%s%s%s\n",
+ log_domain != NULL ? log_domain : "",
+ log_domain != NULL ? ": " : "",
+ message);
+
+ if (log_level & fatal) {
+ fflush (stdout);
+ fflush (stderr);
+ abort ();
+ }
+}
+
+static void
+default_stdout_handler (const gchar *string)
+{
+ fprintf (stdout, "%s", string);
+}
+
+static void
+default_stderr_handler (const gchar *string)
+{
+ fprintf (stderr, "%s", string);
+}
+
+#endif
+
+GLogFunc
+g_log_set_default_handler (GLogFunc log_func, gpointer user_data)
+{
+ GLogFunc old = default_log_func;
+ default_log_func = log_func;
+ default_log_func_user_data = user_data;
+ return old;
+}
+
+GPrintFunc
+g_set_print_handler (GPrintFunc func)
+{
+ GPrintFunc old = stdout_handler;
+ stdout_handler = func;
+ return old;
+}
+
+GPrintFunc
+g_set_printerr_handler (GPrintFunc func)
+{
+ GPrintFunc old = stderr_handler;
+ stderr_handler = func;
+ return old;
}
diff --git a/external/cecil/Mono.Cecil.PE/Image.cs b/external/cecil/Mono.Cecil.PE/Image.cs
index a11cf1c404..fdecbbeb40 100644
--- a/external/cecil/Mono.Cecil.PE/Image.cs
+++ b/external/cecil/Mono.Cecil.PE/Image.cs
@@ -150,6 +150,11 @@ namespace Mono.Cecil.PE {
PointerToRawData = buffer.ReadInt32 (),
};
+ if (directory.SizeOfData == 0 || directory.PointerToRawData == 0) {
+ header = Empty.Array;
+ return directory;
+ }
+
buffer.position = (int) (directory.PointerToRawData - section.PointerToRawData);
header = new byte [directory.SizeOfData];
diff --git a/external/cecil/Mono.Cecil/AssemblyReader.cs b/external/cecil/Mono.Cecil/AssemblyReader.cs
index a9f0b6a1d0..569475b573 100644
--- a/external/cecil/Mono.Cecil/AssemblyReader.cs
+++ b/external/cecil/Mono.Cecil/AssemblyReader.cs
@@ -3099,9 +3099,29 @@ namespace Mono.Cecil {
}
}
+ string UnescapeTypeName (string name)
+ {
+ StringBuilder sb = new StringBuilder (name.Length);
+ for (int i = 0; i < name.Length; i++) {
+ char c = name [i];
+ if (name [i] == '\\') {
+ if ((i < name.Length - 1) && (name [i + 1] == '\\')) {
+ sb.Append (c);
+ i++;
+ }
+ } else {
+ sb.Append (c);
+ }
+ }
+ return sb.ToString ();
+ }
+
public TypeReference ReadTypeReference ()
{
- return TypeParser.ParseType (reader.module, ReadUTF8String ());
+ string s = ReadUTF8String ();
+ if (s != null && s.IndexOf ('\\') != -1)
+ s = UnescapeTypeName (s);
+ return TypeParser.ParseType (reader.module, s);
}
object ReadCustomAttributeEnum (TypeReference enum_type)
diff --git a/external/cecil/Mono.Cecil/AssemblyWriter.cs b/external/cecil/Mono.Cecil/AssemblyWriter.cs
index 0597bc0b5d..f1026eed0d 100644
--- a/external/cecil/Mono.Cecil/AssemblyWriter.cs
+++ b/external/cecil/Mono.Cecil/AssemblyWriter.cs
@@ -1164,9 +1164,14 @@ namespace Mono.Cecil {
MetadataToken GetTypeRefToken (TypeReference type)
{
+ MetadataToken token;
+ if (module.CustomMetadataWriter != null) {
+ if (module.CustomMetadataWriter.CreateTypeRefToken (ref type, out token))
+ return token;
+ }
+
var row = CreateTypeRefRow (type);
- MetadataToken token;
if (type_ref_map.TryGetValue (row, out token))
return token;
diff --git a/external/cecil/Mono.Cecil/Import.cs b/external/cecil/Mono.Cecil/Import.cs
index a32eb3c241..93040101c9 100644
--- a/external/cecil/Mono.Cecil/Import.cs
+++ b/external/cecil/Mono.Cecil/Import.cs
@@ -437,7 +437,7 @@ namespace Mono.Cecil {
}
#endif
- public TypeReference ImportType (TypeReference type, ImportGenericContext context)
+ public virtual TypeReference ImportType (TypeReference type, ImportGenericContext context)
{
if (type.IsTypeSpecification ())
return ImportTypeSpecification (type, context);
@@ -466,6 +466,7 @@ namespace Mono.Cecil {
case MetadataScopeType.AssemblyNameReference:
return ImportAssemblyName ((AssemblyNameReference) scope);
case MetadataScopeType.ModuleDefinition:
+ if (scope == module) return scope;
return ImportAssemblyName (((ModuleDefinition) scope).Assembly.Name);
case MetadataScopeType.ModuleReference:
throw new NotImplementedException ();
@@ -474,7 +475,7 @@ namespace Mono.Cecil {
throw new NotSupportedException ();
}
- AssemblyNameReference ImportAssemblyName (AssemblyNameReference name)
+ protected virtual AssemblyNameReference ImportAssemblyName (AssemblyNameReference name)
{
AssemblyNameReference reference;
if (TryGetAssemblyNameReference (name, out reference))
diff --git a/external/cecil/Mono.Cecil/ModuleDefinition.cs b/external/cecil/Mono.Cecil/ModuleDefinition.cs
index 7f75cbd17e..61870cdbb5 100644
--- a/external/cecil/Mono.Cecil/ModuleDefinition.cs
+++ b/external/cecil/Mono.Cecil/ModuleDefinition.cs
@@ -157,6 +157,22 @@ namespace Mono.Cecil {
}
}
+ interface ICustomMetadataWriter
+ {
+ /*
+ * Remap TypeReference or create custom TypeRef token.
+ *
+ * Return true to use the returned custom 'token'.
+ *
+ * Return false to create a TypeRef token for 'type'
+ * (which may have been replaced with a different TypeReference).
+ *
+ * This is necessary when types are moved from one assembly to another
+ * to either adjust the scope or replace a TypeRef with a TypeDef token.
+ */
+ bool CreateTypeRefToken (ref TypeReference type, out MetadataToken token);
+ }
+
public sealed class WriterParameters {
Stream symbol_stream;
@@ -216,6 +232,7 @@ namespace Mono.Cecil {
#if !READ_ONLY
MetadataImporter importer;
+ ICustomMetadataWriter custom_writer;
#endif
Collection custom_attributes;
Collection references;
@@ -286,6 +303,18 @@ namespace Mono.Cecil {
internal MetadataImporter MetadataImporter {
get { return importer ?? (importer = new MetadataImporter (this)); }
}
+
+ internal void SetMetadataImporter (MetadataImporter importer)
+ {
+ if (this.importer != null)
+ throw new InvalidOperationException ();
+ this.importer = importer;
+ }
+
+ internal ICustomMetadataWriter CustomMetadataWriter {
+ get { return custom_writer; }
+ set { custom_writer = value; }
+ }
#endif
public IAssemblyResolver AssemblyResolver {
diff --git a/external/ikvm/awt/graphics.cs b/external/ikvm/awt/graphics.cs
index 2d4f05398b..11b1ed89d6 100644
--- a/external/ikvm/awt/graphics.cs
+++ b/external/ikvm/awt/graphics.cs
@@ -1,7 +1,7 @@
/*
Copyright (C) 2002, 2004, 2005, 2006, 2007 Jeroen Frijters
Copyright (C) 2006 Active Endpoints, Inc.
- Copyright (C) 2006 - 2013 Volker Berlin (i-net software)
+ Copyright (C) 2006 - 2014 Volker Berlin (i-net software)
Copyright (C) 2011 Karsten Heinrich (i-net software)
This software is provided 'as-is', without any express or implied
@@ -40,17 +40,29 @@ namespace ikvm.awt
internal class BitmapGraphics : NetGraphics
{
private readonly Bitmap bitmap;
+ private readonly BufferedImage image;
- internal BitmapGraphics(Bitmap bitmap, java.awt.Font font, Color fgcolor, Color bgcolor)
- : base(createGraphics(bitmap), font, fgcolor, bgcolor)
+ internal BitmapGraphics(Bitmap bitmap, Object destination, java.awt.Font font, Color fgcolor, Color bgcolor)
+ : base(createGraphics(bitmap), destination, font, fgcolor, bgcolor)
{
this.bitmap = bitmap;
+ image = destination as BufferedImage;
}
- internal BitmapGraphics(Bitmap bitmap)
- : base(createGraphics(bitmap), null, Color.White, Color.Black)
+ internal BitmapGraphics(Bitmap bitmap, Object destination)
+ : this(bitmap, destination, null, Color.White, Color.Black)
{
- this.bitmap = bitmap;
+ }
+
+ internal override Graphics g
+ {
+ get {
+ if (image != null)
+ {
+ image.toBitmap();
+ }
+ return base.g;
+ }
}
protected override SizeF GetSize() {
@@ -89,8 +101,8 @@ namespace ikvm.awt
{
private readonly Control control;
- internal ComponentGraphics(Control control, java.awt.Color fgColor, java.awt.Color bgColor, java.awt.Font font)
- : base(control.CreateGraphics(), font, J2C.ConvertColor(fgColor), J2C.ConvertColor(bgColor))
+ internal ComponentGraphics(Control control, java.awt.Component target, java.awt.Color fgColor, java.awt.Color bgColor, java.awt.Font font)
+ : base(control.CreateGraphics(), target, font, J2C.ConvertColor(fgColor), J2C.ConvertColor(bgColor))
{
this.control = control;
}
@@ -116,12 +128,17 @@ namespace ikvm.awt
return (Point)this.control.Invoke(new Converter(getPointToScreenImpl),point);
}
- public override void copyArea(int x, int y, int width, int height, int dx, int dy)
- {
- Point src = getPointToScreen(new Point(x + (int)this.g.Transform.OffsetX, y + (int)this.g.Transform.OffsetY));
- Point dest = new Point(x + (int)this.g.Transform.OffsetX + dx, y + (int)this.g.Transform.OffsetY + dy);
- this.g.CopyFromScreen(src, dest, new Size(width, height));
- }
+ public override void copyArea(int x, int y, int width, int height, int dx, int dy)
+ {
+ Matrix t = g.Transform;
+ Point src = getPointToScreen(new Point(x + (int)t.OffsetX, y + (int)t.OffsetY));
+ Bitmap copy = new Bitmap(width, height);
+ using (Graphics gCopy = Graphics.FromImage(copy))
+ {
+ gCopy.CopyFromScreen(src, new Point(0, 0), new Size(width, height));
+ }
+ g.DrawImageUnscaled(copy, x + dx, y + dy);
+ }
public override void clip(java.awt.Shape shape)
{
@@ -150,7 +167,7 @@ namespace ikvm.awt
private bool isBase = true;
internal PrintGraphics(Graphics g)
- : base(g, null, Color.White, Color.Black)
+ : base(g, null, null, Color.White, Color.Black)
{
baseContext = new PrintGraphicsContext();
baseContext.Current = this;
@@ -744,7 +761,7 @@ namespace ikvm.awt
netG.g.Clip = Clip;
netG.g.SmoothingMode = SmoothingMode;
netG.g.PixelOffsetMode = PixelOffsetMode;
- netG.g.TextRenderingHint = TextRenderingHint;
+ netG.setTextRenderingHint(TextRenderingHint);
netG.g.InterpolationMode = InterpolationMode;
netG.g.CompositingMode = CompositingMode;
}
@@ -768,10 +785,9 @@ namespace ikvm.awt
}
}
- internal abstract class NetGraphics : java.awt.Graphics2D
+ internal abstract class NetGraphics : java.awt.Graphics2D//sun.java2d.SunGraphics2D
{
- internal Graphics g;
- internal Graphics JGraphics { get { return g; } }
+ private Graphics graphics;
private java.awt.Color javaColor;
private java.awt.Paint javaPaint;
internal Color color;
@@ -780,6 +796,7 @@ namespace ikvm.awt
private java.awt.Stroke stroke;
private static java.awt.BasicStroke defaultStroke = new java.awt.BasicStroke();
private Font netfont;
+ private int baseline;
internal Brush brush;
internal Pen pen;
private CompositeHelper composite;
@@ -787,7 +804,16 @@ namespace ikvm.awt
private Object textAntialiasHint;
private Object fractionalHint = java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT;
- protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor)
+ private static System.Collections.Generic.Dictionary baselines = new System.Collections.Generic.Dictionary();
+
+ internal static readonly StringFormat FORMAT = new StringFormat(StringFormat.GenericTypographic);
+ static NetGraphics()
+ {
+ FORMAT.FormatFlags = StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.NoWrap | StringFormatFlags.FitBlackBox;
+ FORMAT.Trimming = StringTrimming.None;
+ }
+
+ protected NetGraphics(Graphics g, Object destination, java.awt.Font font, Color fgcolor, Color bgcolor) //: base( new sun.java2d.SurfaceData(destination) )
{
if (font == null)
{
@@ -801,12 +827,21 @@ namespace ikvm.awt
init(g);
}
+ ///
+ /// The current C# Graphics
+ ///
+ internal virtual Graphics g
+ {
+ get { return graphics; }
+ set { graphics = value; }
+ }
+
protected void init(Graphics graphics)
{
NetGraphicsState state = new NetGraphicsState();
state.saveGraphics(this);
g = graphics;
- state.restoreGraphics(this);
+ state.restoreGraphics(this);
}
///
@@ -850,7 +885,7 @@ namespace ikvm.awt
{
if (pen!=null) pen.Dispose();
if (brush!=null) brush.Dispose();
- g.Dispose();
+ graphics.Dispose(); //for dispose we does not need to synchronize the buffer of a bitmap
}
public override void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
@@ -1190,6 +1225,7 @@ namespace ikvm.awt
{
netfont = f.getNetFont();
font = f;
+ baseline = getBaseline( netfont, g.TextRenderingHint );
}
}
@@ -1278,30 +1314,33 @@ namespace ikvm.awt
drawString(str, (float)x, (float)y);
}
- public override void drawString(String text, float x, float y)
- {
- if (text.Length == 0)
- {
+ public override void drawString(String text, float x, float y) {
+ if (text.Length == 0) {
return;
}
- bool fractional = isFractionalMetrics();
- StringFormat format = new StringFormat(StringFormat.GenericTypographic);
- format.FormatFlags = StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.NoWrap | StringFormatFlags.FitBlackBox;
- format.Trimming = StringTrimming.None;
- if (fractional || !sun.font.StandardGlyphVector.isSimpleString(font, text))
- {
- g.DrawString(text, netfont, brush, x, y - font.getSize(), format);
- }
- else
- {
- // fixed metric for simple text, we position every character to simulate the Java behaviour
- java.awt.font.FontRenderContext frc = new java.awt.font.FontRenderContext(null, isAntiAlias(), fractional);
- sun.font.FontDesignMetrics metrics = sun.font.FontDesignMetrics.getMetrics(font, frc);
- y -= font.getSize();
- for (int i = 0; i < text.Length; i++)
- {
- g.DrawString(text.Substring(i, 1), netfont, brush, x, y, format);
- x += metrics.charWidth(text[i]);
+ CompositingMode origCM = g.CompositingMode;
+ try {
+ if (origCM != CompositingMode.SourceOver) {
+ // Java has a different behaviar for AlphaComposite and Text Antialiasing
+ g.CompositingMode = CompositingMode.SourceOver;
+ }
+
+ bool fractional = isFractionalMetrics();
+ if (fractional || !sun.font.StandardGlyphVector.isSimpleString(font, text)) {
+ g.DrawString(text, netfont, brush, x, y - baseline, FORMAT);
+ } else {
+ // fixed metric for simple text, we position every character to simulate the Java behaviour
+ java.awt.font.FontRenderContext frc = new java.awt.font.FontRenderContext(null, isAntiAlias(), fractional);
+ sun.font.FontDesignMetrics metrics = sun.font.FontDesignMetrics.getMetrics(font, frc);
+ y -= baseline;
+ for (int i = 0; i < text.Length; i++) {
+ g.DrawString(text.Substring(i, 1), netfont, brush, x, y, FORMAT);
+ x += metrics.charWidth(text[i]);
+ }
+ }
+ } finally {
+ if (origCM != CompositingMode.SourceOver) {
+ g.CompositingMode = origCM;
}
}
}
@@ -1345,6 +1384,9 @@ namespace ikvm.awt
public override void setComposite(java.awt.Composite comp)
{
+ if (javaComposite == comp) {
+ return;
+ }
if (comp == null)
{
throw new java.lang.IllegalArgumentException("null Composite");
@@ -1750,13 +1792,13 @@ namespace ikvm.awt
if (hintValue == java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT ||
hintValue == java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)
{
- g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ setTextRenderingHint(TextRenderingHint.SingleBitPerPixelGridFit);
textAntialiasHint = hintValue;
return;
}
if (hintValue == java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON)
{
- g.TextRenderingHint = TextRenderingHint.AntiAlias;
+ setTextRenderingHint(TextRenderingHint.AntiAlias);
textAntialiasHint = hintValue;
return;
}
@@ -1933,6 +1975,71 @@ namespace ikvm.awt
return stroke;
}
+ internal void setTextRenderingHint(TextRenderingHint hint)
+ {
+ g.TextRenderingHint = hint;
+ baseline = getBaseline(netfont, hint);
+ }
+
+ ///
+ /// Caclulate the baseline from a font and a TextRenderingHint
+ ///
+ /// the font
+ /// the used TextRenderingHint
+ ///
+ private static int getBaseline(Font font, TextRenderingHint hint)
+ {
+ lock (baselines)
+ {
+ String key = font.ToString() + hint.ToString();
+ int baseline;
+ if (!baselines.TryGetValue(key, out baseline))
+ {
+ FontFamily family = font.FontFamily;
+ FontStyle style = font.Style;
+ float ascent = family.GetCellAscent(style);
+ float lineSpace = family.GetLineSpacing(style);
+
+ baseline = (int)Math.Round(font.GetHeight() * ascent / lineSpace);
+
+ // Until this point the calulation use only the Font. But with different TextRenderingHint there are smal differences.
+ // There is no API that calulate the offset from TextRenderingHint that we messure it.
+ const int w = 3;
+ const int h = 3;
+
+ Bitmap bitmap = new Bitmap(w, h);
+ Graphics g = Graphics.FromImage(bitmap);
+ g.TextRenderingHint = hint;
+ g.FillRectangle(new SolidBrush(Color.White), 0, 0, w, h);
+ g.DrawString("A", font, new SolidBrush(Color.Black), 0, -baseline, FORMAT);
+ g.DrawString("X", font, new SolidBrush(Color.Black), 0, -baseline, FORMAT);
+ g.Dispose();
+
+ int y = 0;
+ LINE:
+ while (y < h)
+ {
+ for (int x = 0; x < w; x++)
+ {
+ Color color = bitmap.GetPixel(x, y);
+ if (color.GetBrightness() < 0.5)
+ {
+ //there is a black pixel, we continue in the next line.
+ baseline++;
+ y++;
+ goto LINE;
+ }
+ }
+ break; // there was a line without black pixel
+ }
+
+
+ baselines[key] = baseline;
+ }
+ return baseline;
+ }
+ }
+
private bool isAntiAlias()
{
switch (g.TextRenderingHint)
@@ -1962,6 +2069,7 @@ namespace ikvm.awt
Matrix currentMatrix = null;
Font currentFont = netfont;
TextRenderingHint currentHint = g.TextRenderingHint;
+ int currentBaseline = baseline;
try
{
java.awt.Font javaFont = gv.getFont();
@@ -1969,19 +2077,22 @@ namespace ikvm.awt
{
netfont = javaFont.getNetFont();
}
+ TextRenderingHint hint;
if (frc.isAntiAliased()) {
if( frc.usesFractionalMetrics() ){
- g.TextRenderingHint = TextRenderingHint.AntiAlias;
+ hint = TextRenderingHint.AntiAlias;
} else {
- g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
+ hint = TextRenderingHint.AntiAliasGridFit;
}
} else {
if (frc.usesFractionalMetrics()) {
- g.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;
+ hint = TextRenderingHint.SingleBitPerPixel;
} else {
- g.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;
+ hint = TextRenderingHint.SingleBitPerPixelGridFit;
}
}
+ g.TextRenderingHint = hint;
+ baseline = getBaseline(netfont, hint);
if (!frc.getTransform().equals(getTransform()))
{
// save the old context and use the transformation from the renderContext
@@ -1994,6 +2105,7 @@ namespace ikvm.awt
{
// Restore the old context if needed
g.TextRenderingHint = currentHint;
+ baseline = currentBaseline;
netfont = currentFont;
if (currentMatrix != null)
{
@@ -2144,14 +2256,20 @@ namespace ikvm.awt
}
}
- public class NetGraphicsEnvironment : java.awt.GraphicsEnvironment
+ public class NetGraphicsEnvironment : sun.java2d.SunGraphicsEnvironment
{
+
+ public override bool isDisplayLocal()
+ {
+ return true;
+ }
+
// Create a bitmap with the dimensions of the argument image. Then
// create a graphics objects from the bitmap. All paint operations will
// then paint the bitmap.
public override java.awt.Graphics2D createGraphics(BufferedImage bi)
{
- return new BitmapGraphics(bi.getBitmap());
+ return new BitmapGraphics(bi.getBitmap(), bi );
}
public override java.awt.Font[] getAllFonts()
diff --git a/external/ikvm/awt/toolkit-0.95.cs.REMOVED.git-id b/external/ikvm/awt/toolkit-0.95.cs.REMOVED.git-id
index a8c1fa49f2..8a677abac1 100644
--- a/external/ikvm/awt/toolkit-0.95.cs.REMOVED.git-id
+++ b/external/ikvm/awt/toolkit-0.95.cs.REMOVED.git-id
@@ -1 +1 @@
-4341b9c30b528a9c448533ed715fc437369b3561
\ No newline at end of file
+474cfafc92a8fad74e36e71fb612ebd44209bce8
\ No newline at end of file
diff --git a/external/ikvm/bin/ikvm.exe.manifest b/external/ikvm/bin/ikvm.exe.manifest
new file mode 100644
index 0000000000..3dbbfde966
--- /dev/null
+++ b/external/ikvm/bin/ikvm.exe.manifest
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external/ikvm/classpath/java/util/concurrent/atomic/Striped64.java b/external/ikvm/classpath/java/util/concurrent/atomic/Striped64.java
new file mode 100644
index 0000000000..1fea75bed6
--- /dev/null
+++ b/external/ikvm/classpath/java/util/concurrent/atomic/Striped64.java
@@ -0,0 +1,380 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+package java.util.concurrent.atomic;
+import java.util.function.LongBinaryOperator;
+import java.util.function.DoubleBinaryOperator;
+import java.util.concurrent.ThreadLocalRandom;
+
+/**
+ * A package-local class holding common representation and mechanics
+ * for classes supporting dynamic striping on 64bit values. The class
+ * extends Number so that concrete subclasses must publicly do so.
+ */
+@SuppressWarnings("serial")
+abstract class Striped64 extends Number {
+ /*
+ * This class maintains a lazily-initialized table of atomically
+ * updated variables, plus an extra "base" field. The table size
+ * is a power of two. Indexing uses masked per-thread hash codes.
+ * Nearly all declarations in this class are package-private,
+ * accessed directly by subclasses.
+ *
+ * Table entries are of class Cell; a variant of AtomicLong padded
+ * (via @sun.misc.Contended) to reduce cache contention. Padding
+ * is overkill for most Atomics because they are usually
+ * irregularly scattered in memory and thus don't interfere much
+ * with each other. But Atomic objects residing in arrays will
+ * tend to be placed adjacent to each other, and so will most
+ * often share cache lines (with a huge negative performance
+ * impact) without this precaution.
+ *
+ * In part because Cells are relatively large, we avoid creating
+ * them until they are needed. When there is no contention, all
+ * updates are made to the base field. Upon first contention (a
+ * failed CAS on base update), the table is initialized to size 2.
+ * The table size is doubled upon further contention until
+ * reaching the nearest power of two greater than or equal to the
+ * number of CPUS. Table slots remain empty (null) until they are
+ * needed.
+ *
+ * A single spinlock ("cellsBusy") is used for initializing and
+ * resizing the table, as well as populating slots with new Cells.
+ * There is no need for a blocking lock; when the lock is not
+ * available, threads try other slots (or the base). During these
+ * retries, there is increased contention and reduced locality,
+ * which is still better than alternatives.
+ *
+ * The Thread probe fields maintained via ThreadLocalRandom serve
+ * as per-thread hash codes. We let them remain uninitialized as
+ * zero (if they come in this way) until they contend at slot
+ * 0. They are then initialized to values that typically do not
+ * often conflict with others. Contention and/or table collisions
+ * are indicated by failed CASes when performing an update
+ * operation. Upon a collision, if the table size is less than
+ * the capacity, it is doubled in size unless some other thread
+ * holds the lock. If a hashed slot is empty, and lock is
+ * available, a new Cell is created. Otherwise, if the slot
+ * exists, a CAS is tried. Retries proceed by "double hashing",
+ * using a secondary hash (Marsaglia XorShift) to try to find a
+ * free slot.
+ *
+ * The table size is capped because, when there are more threads
+ * than CPUs, supposing that each thread were bound to a CPU,
+ * there would exist a perfect hash function mapping threads to
+ * slots that eliminates collisions. When we reach capacity, we
+ * search for this mapping by randomly varying the hash codes of
+ * colliding threads. Because search is random, and collisions
+ * only become known via CAS failures, convergence can be slow,
+ * and because threads are typically not bound to CPUS forever,
+ * may not occur at all. However, despite these limitations,
+ * observed contention rates are typically low in these cases.
+ *
+ * It is possible for a Cell to become unused when threads that
+ * once hashed to it terminate, as well as in the case where
+ * doubling the table causes no thread to hash to it under
+ * expanded mask. We do not try to detect or remove such cells,
+ * under the assumption that for long-running instances, observed
+ * contention levels will recur, so the cells will eventually be
+ * needed again; and for short-lived ones, it does not matter.
+ */
+
+ /**
+ * Padded variant of AtomicLong supporting only raw accesses plus CAS.
+ *
+ * JVM intrinsics note: It would be possible to use a release-only
+ * form of CAS here, if it were provided.
+ */
+ @sun.misc.Contended static final class Cell {
+ volatile long value;
+ Cell(long x) { value = x; }
+ @ikvm.internal.InterlockedCompareAndSet("value")
+ final native boolean cas(long cmp, long val);
+ }
+
+ /** Number of CPUS, to place bound on table size */
+ static final int NCPU = Runtime.getRuntime().availableProcessors();
+
+ /**
+ * Table of cells. When non-null, size is a power of 2.
+ */
+ transient volatile Cell[] cells;
+
+ /**
+ * Base value, used mainly when there is no contention, but also as
+ * a fallback during table initialization races. Updated via CAS.
+ */
+ transient volatile long base;
+
+ /**
+ * Spinlock (locked via CAS) used when resizing and/or creating Cells.
+ */
+ transient volatile int cellsBusy;
+
+ /**
+ * Package-private default constructor
+ */
+ Striped64() {
+ }
+
+ /**
+ * CASes the base field.
+ */
+ @ikvm.internal.InterlockedCompareAndSet("base")
+ final native boolean casBase(long cmp, long val);
+
+ /**
+ * CASes the cellsBusy field from 0 to 1 to acquire lock.
+ */
+ final boolean casCellsBusy() {
+ return casCellsBusy(0, 1);
+ }
+
+ @ikvm.internal.InterlockedCompareAndSet("cellsBusy")
+ private native boolean casCellsBusy(int cmp, int newVal);
+
+ /**
+ * Returns the probe value for the current thread.
+ * Duplicated from ThreadLocalRandom because of packaging restrictions.
+ */
+ static final int getProbe() {
+ return Thread.currentThread().threadLocalRandomProbe;
+ }
+
+ /**
+ * Pseudo-randomly advances and records the given probe value for the
+ * given thread.
+ * Duplicated from ThreadLocalRandom because of packaging restrictions.
+ */
+ static final int advanceProbe(int probe) {
+ probe ^= probe << 13; // xorshift
+ probe ^= probe >>> 17;
+ probe ^= probe << 5;
+ Thread.currentThread().threadLocalRandomProbe = probe;
+ return probe;
+ }
+
+ /**
+ * Handles cases of updates involving initialization, resizing,
+ * creating new Cells, and/or contention. See above for
+ * explanation. This method suffers the usual non-modularity
+ * problems of optimistic retry code, relying on rechecked sets of
+ * reads.
+ *
+ * @param x the value
+ * @param fn the update function, or null for add (this convention
+ * avoids the need for an extra field or function in LongAdder).
+ * @param wasUncontended false if CAS failed before call
+ */
+ final void longAccumulate(long x, LongBinaryOperator fn,
+ boolean wasUncontended) {
+ int h;
+ if ((h = getProbe()) == 0) {
+ ThreadLocalRandom.current(); // force initialization
+ h = getProbe();
+ wasUncontended = true;
+ }
+ boolean collide = false; // True if last slot nonempty
+ for (;;) {
+ Cell[] as; Cell a; int n; long v;
+ if ((as = cells) != null && (n = as.length) > 0) {
+ if ((a = as[(n - 1) & h]) == null) {
+ if (cellsBusy == 0) { // Try to attach new Cell
+ Cell r = new Cell(x); // Optimistically create
+ if (cellsBusy == 0 && casCellsBusy()) {
+ boolean created = false;
+ try { // Recheck under lock
+ Cell[] rs; int m, j;
+ if ((rs = cells) != null &&
+ (m = rs.length) > 0 &&
+ rs[j = (m - 1) & h] == null) {
+ rs[j] = r;
+ created = true;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ if (created)
+ break;
+ continue; // Slot is now non-empty
+ }
+ }
+ collide = false;
+ }
+ else if (!wasUncontended) // CAS already known to fail
+ wasUncontended = true; // Continue after rehash
+ else if (a.cas(v = a.value, ((fn == null) ? v + x :
+ fn.applyAsLong(v, x))))
+ break;
+ else if (n >= NCPU || cells != as)
+ collide = false; // At max size or stale
+ else if (!collide)
+ collide = true;
+ else if (cellsBusy == 0 && casCellsBusy()) {
+ try {
+ if (cells == as) { // Expand table unless stale
+ Cell[] rs = new Cell[n << 1];
+ for (int i = 0; i < n; ++i)
+ rs[i] = as[i];
+ cells = rs;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ collide = false;
+ continue; // Retry with expanded table
+ }
+ h = advanceProbe(h);
+ }
+ else if (cellsBusy == 0 && cells == as && casCellsBusy()) {
+ boolean init = false;
+ try { // Initialize table
+ if (cells == as) {
+ Cell[] rs = new Cell[2];
+ rs[h & 1] = new Cell(x);
+ cells = rs;
+ init = true;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ if (init)
+ break;
+ }
+ else if (casBase(v = base, ((fn == null) ? v + x :
+ fn.applyAsLong(v, x))))
+ break; // Fall back on using base
+ }
+ }
+
+ /**
+ * Same as longAccumulate, but injecting long/double conversions
+ * in too many places to sensibly merge with long version, given
+ * the low-overhead requirements of this class. So must instead be
+ * maintained by copy/paste/adapt.
+ */
+ final void doubleAccumulate(double x, DoubleBinaryOperator fn,
+ boolean wasUncontended) {
+ int h;
+ if ((h = getProbe()) == 0) {
+ ThreadLocalRandom.current(); // force initialization
+ h = getProbe();
+ wasUncontended = true;
+ }
+ boolean collide = false; // True if last slot nonempty
+ for (;;) {
+ Cell[] as; Cell a; int n; long v;
+ if ((as = cells) != null && (n = as.length) > 0) {
+ if ((a = as[(n - 1) & h]) == null) {
+ if (cellsBusy == 0) { // Try to attach new Cell
+ Cell r = new Cell(Double.doubleToRawLongBits(x));
+ if (cellsBusy == 0 && casCellsBusy()) {
+ boolean created = false;
+ try { // Recheck under lock
+ Cell[] rs; int m, j;
+ if ((rs = cells) != null &&
+ (m = rs.length) > 0 &&
+ rs[j = (m - 1) & h] == null) {
+ rs[j] = r;
+ created = true;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ if (created)
+ break;
+ continue; // Slot is now non-empty
+ }
+ }
+ collide = false;
+ }
+ else if (!wasUncontended) // CAS already known to fail
+ wasUncontended = true; // Continue after rehash
+ else if (a.cas(v = a.value,
+ ((fn == null) ?
+ Double.doubleToRawLongBits
+ (Double.longBitsToDouble(v) + x) :
+ Double.doubleToRawLongBits
+ (fn.applyAsDouble
+ (Double.longBitsToDouble(v), x)))))
+ break;
+ else if (n >= NCPU || cells != as)
+ collide = false; // At max size or stale
+ else if (!collide)
+ collide = true;
+ else if (cellsBusy == 0 && casCellsBusy()) {
+ try {
+ if (cells == as) { // Expand table unless stale
+ Cell[] rs = new Cell[n << 1];
+ for (int i = 0; i < n; ++i)
+ rs[i] = as[i];
+ cells = rs;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ collide = false;
+ continue; // Retry with expanded table
+ }
+ h = advanceProbe(h);
+ }
+ else if (cellsBusy == 0 && cells == as && casCellsBusy()) {
+ boolean init = false;
+ try { // Initialize table
+ if (cells == as) {
+ Cell[] rs = new Cell[2];
+ rs[h & 1] = new Cell(Double.doubleToRawLongBits(x));
+ cells = rs;
+ init = true;
+ }
+ } finally {
+ cellsBusy = 0;
+ }
+ if (init)
+ break;
+ }
+ else if (casBase(v = base,
+ ((fn == null) ?
+ Double.doubleToRawLongBits
+ (Double.longBitsToDouble(v) + x) :
+ Double.doubleToRawLongBits
+ (fn.applyAsDouble
+ (Double.longBitsToDouble(v), x)))))
+ break; // Fall back on using base
+ }
+ }
+
+
+}
diff --git a/external/ikvm/ikvmc.8.csproj b/external/ikvm/ikvmc.8.csproj
index 71a657cd61..188dba9fe0 100644
--- a/external/ikvm/ikvmc.8.csproj
+++ b/external/ikvm/ikvmc.8.csproj
@@ -35,7 +35,7 @@
false
- TRACE;DEBUG;STATIC_COMPILER;IKVM_REF_EMIT
+ TRACE;DEBUG;STATIC_COMPILER;EMITTERStrue
@@ -91,6 +91,7 @@
Code
+ Code
@@ -119,10 +120,12 @@
Code
+ Code
+ Code
diff --git a/external/ikvm/ikvmc/AotTypeWrapper.cs b/external/ikvm/ikvmc/AotTypeWrapper.cs
index 60e519eb68..20a2f726f1 100644
--- a/external/ikvm/ikvmc/AotTypeWrapper.cs
+++ b/external/ikvm/ikvmc/AotTypeWrapper.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2009 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -48,14 +48,14 @@ namespace IKVM.Internal
private WorkaroundBaseClass workaroundBaseClass;
internal AotTypeWrapper(ClassFile f, CompilerClassLoader loader)
- : base(f, loader, null)
+ : base(null, f, loader, null)
{
}
protected override Type GetBaseTypeForDefineType()
{
TypeWrapper baseTypeWrapper = BaseTypeWrapper;
- if (this.IsPublic && this.IsAbstract && baseTypeWrapper.IsPublic && baseTypeWrapper.IsAbstract)
+ if (this.IsPublic && this.IsAbstract && baseTypeWrapper.IsPublic && baseTypeWrapper.IsAbstract && classLoader.WorkaroundAbstractMethodWidening)
{
// FXBUG
// if the current class widens access on an abstract base class method,
@@ -78,7 +78,7 @@ namespace IKVM.Internal
}
if (methods != null)
{
- string name = "__WorkaroundBaseClass__." + Name;
+ string name = "__WorkaroundBaseClass__." + UnicodeUtil.EscapeInvalidSurrogates(Name);
while (!classLoader.ReserveName(name))
{
name = "_" + name;
@@ -297,10 +297,7 @@ namespace IKVM.Internal
}
if(!found)
{
- FieldWrapper[] newFields = new FieldWrapper[fields.Length + 1];
- Array.Copy(fields, newFields, fields.Length);
- fields = newFields;
- fields[fields.Length - 1] = FieldWrapper.Create(this, null, null, field.Name, field.Sig, new ExModifiers((Modifiers)field.Modifiers, false));
+ fields = ArrayUtil.Concat(fields, FieldWrapper.Create(this, null, null, field.Name, field.Sig, new ExModifiers((Modifiers)field.Modifiers, false)));
}
}
}
@@ -471,9 +468,7 @@ namespace IKVM.Internal
if(setter != null)
{
MethodWrapper mw = setter;
- Type[] args = new Type[indexer.Length + 1];
- indexer.CopyTo(args, 0);
- args[args.Length - 1] = typeWrapper.TypeAsSignatureType;
+ Type[] args = ArrayUtil.Concat(indexer, typeWrapper.TypeAsSignatureType);
if(!CheckPropertyArgs(args, mw.GetParametersForDefineMethod()))
{
Console.Error.WriteLine("Warning: ignoring invalid property setter for {0}::{1}", clazz.Name, prop.Name);
@@ -512,36 +507,6 @@ namespace IKVM.Internal
}
}
- protected override bool IsPInvokeMethod(ClassFile.Method m)
- {
- Dictionary mapxml = classLoader.GetMapXmlClasses();
- if(mapxml != null)
- {
- IKVM.Internal.MapXml.Class clazz;
- if(mapxml.TryGetValue(this.Name, out clazz) && clazz.Methods != null)
- {
- foreach(IKVM.Internal.MapXml.Method method in clazz.Methods)
- {
- if(method.Name == m.Name && method.Sig == m.Signature)
- {
- if(method.Attributes != null)
- {
- foreach(IKVM.Internal.MapXml.Attribute attr in method.Attributes)
- {
- if(StaticCompiler.GetType(classLoader, attr.Type) == JVM.Import(typeof(System.Runtime.InteropServices.DllImportAttribute)))
- {
- return true;
- }
- }
- }
- break;
- }
- }
- }
- }
- return base.IsPInvokeMethod(m);
- }
-
private static void MapModifiers(MapXml.MapModifiers mapmods, bool isConstructor, out bool setmodifiers, ref MethodAttributes attribs)
{
setmodifiers = false;
@@ -716,14 +681,14 @@ namespace IKVM.Internal
// are we adding a new method?
if(GetMethodWrapper(method.Name, method.Sig, false) == null)
{
- if(method.body == null)
+ bool setmodifiers = false;
+ MethodAttributes attribs = method.MethodAttributes;
+ MapModifiers(method.Modifiers, false, out setmodifiers, ref attribs);
+ if(method.body == null && (attribs & MethodAttributes.Abstract) == 0)
{
Console.Error.WriteLine("Error: Method {0}.{1}{2} in xml remap file doesn't have a body.", clazz.Name, method.Name, method.Sig);
continue;
}
- bool setmodifiers = false;
- MethodAttributes attribs = method.MethodAttributes;
- MapModifiers(method.Modifiers, false, out setmodifiers, ref attribs);
Type returnType;
Type[] parameterTypes;
MapSignature(method.Sig, out returnType, out parameterTypes);
@@ -739,9 +704,12 @@ namespace IKVM.Internal
typeBuilder.DefineMethodOverride(mb, (MethodInfo)mw.GetMethod());
}
CompilerClassLoader.AddDeclaredExceptions(mb, method.throws);
- CodeEmitter ilgen = CodeEmitter.Create(mb);
- method.Emit(classLoader, ilgen);
- ilgen.DoEmit();
+ if(method.body != null)
+ {
+ CodeEmitter ilgen = CodeEmitter.Create(mb);
+ method.Emit(classLoader, ilgen);
+ ilgen.DoEmit();
+ }
if(method.Attributes != null)
{
foreach(IKVM.Internal.MapXml.Attribute attr in method.Attributes)
@@ -804,11 +772,14 @@ namespace IKVM.Internal
}
}
- protected override MethodBuilder DefineGhostMethod(string name, MethodAttributes attribs, MethodWrapper mw)
+ protected override MethodBuilder DefineGhostMethod(TypeBuilder typeBuilder, string name, MethodAttributes attribs, MethodWrapper mw)
{
- if(typeBuilderGhostInterface != null)
+ if(typeBuilderGhostInterface != null && mw.IsVirtual)
{
- return mw.GetDefineMethodHelper().DefineMethod(this, typeBuilderGhostInterface, name, attribs);
+ DefineMethodHelper helper = mw.GetDefineMethodHelper();
+ MethodBuilder stub = helper.DefineMethod(this, typeBuilder, name, MethodAttributes.Public);
+ ((GhostMethodWrapper)mw).SetGhostMethod(stub);
+ return helper.DefineMethod(this, typeBuilderGhostInterface, name, attribs);
}
return null;
}
@@ -820,11 +791,12 @@ namespace IKVM.Internal
// TODO consider adding methods from base interface and java.lang.Object as well
for(int i = 0; i < methods.Length; i++)
{
- // skip
- if(!methods[i].IsStatic)
+ // skip and non-virtual interface methods introduced in Java 8
+ GhostMethodWrapper gmw = methods[i] as GhostMethodWrapper;
+ if(gmw != null)
{
TypeWrapper[] args = methods[i].GetParameters();
- MethodBuilder stub = methods[i].GetDefineMethodHelper().DefineMethod(this, typeBuilder, methods[i].Name, MethodAttributes.Public);
+ MethodBuilder stub = gmw.GetGhostMethod();
AddParameterMetadata(stub, methods[i]);
AttributeHelper.SetModifiers(stub, methods[i].Modifiers, methods[i].IsInternal);
CodeEmitter ilgen = CodeEmitter.Create(stub);
@@ -850,13 +822,32 @@ namespace IKVM.Internal
ilgen.Emit(OpCodes.Isinst, implementers[j].TypeAsTBD);
label = ilgen.DefineLabel();
ilgen.EmitBrfalse(label);
- ilgen.Emit(OpCodes.Castclass, implementers[j].TypeAsTBD);
- for(int k = 0; k < args.Length; k++)
- {
- ilgen.EmitLdarg(k + 1);
- }
MethodWrapper mw = implementers[j].GetMethodWrapper(methods[i].Name, methods[i].Signature, true);
- mw.EmitCallvirt(ilgen);
+ if(mw == null)
+ {
+ if(methods[i].IsAbstract)
+ {
+ // This should only happen for remapped types (defined in map.xml), because normally you'd get a miranda method.
+ throw new FatalCompilerErrorException(Message.GhostInterfaceMethodMissing, implementers[j].Name, Name, methods[i].Name, methods[i].Signature);
+ }
+ // We're inheriting a default method
+ ilgen.Emit(OpCodes.Pop);
+ ilgen.Emit(OpCodes.Ldarg_0);
+ for (int k = 0; k < args.Length; k++)
+ {
+ ilgen.EmitLdarg(k + 1);
+ }
+ ilgen.Emit(OpCodes.Call, DefaultInterfaceMethodWrapper.GetImpl(methods[i]));
+ }
+ else
+ {
+ ilgen.Emit(OpCodes.Castclass, implementers[j].TypeAsTBD);
+ for (int k = 0; k < args.Length; k++)
+ {
+ ilgen.EmitLdarg(k + 1);
+ }
+ mw.EmitCallvirt(ilgen);
+ }
ilgen.EmitBr(end);
ilgen.MarkLabel(label);
}
diff --git a/external/ikvm/ikvmc/Compiler.cs b/external/ikvm/ikvmc/Compiler.cs
index f824b029d1..bf37e60046 100644
--- a/external/ikvm/ikvmc/Compiler.cs
+++ b/external/ikvm/ikvmc/Compiler.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2013 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -156,6 +156,13 @@ sealed class FatalCompilerErrorException : Exception
return "The type '{0}' is defined in an assembly that is not referenced. You must add a reference to assembly '{1}'";
case IKVM.Internal.Message.FileNotFound:
return "File not found: {0}";
+ case IKVM.Internal.Message.RuntimeMethodMissing:
+ return "Runtime method '{0}' not found";
+ case IKVM.Internal.Message.MapFileFieldNotFound:
+ return "Field '{0}' referenced in remap file was not found in class '{1}'";
+ case IKVM.Internal.Message.GhostInterfaceMethodMissing:
+ return "Remapped class '{0}' does not implement ghost interface method\n" +
+ "\t({1}.{2}{3})";
default:
return "Missing Error Message. Please file a bug.";
}
@@ -167,7 +174,6 @@ sealed class IkvmcCompiler
private bool nonleaf;
private string manifestMainClass;
private string defaultAssemblyName;
- private List classesToExclude = new List();
private static bool time;
private static string runtimeAssembly;
private static bool nostdlib;
@@ -515,6 +521,8 @@ sealed class IkvmcCompiler
Console.Error.WriteLine("-lib: Additional directories to search for references");
Console.Error.WriteLine("-highentropyva Enable high entropy ASLR");
Console.Error.WriteLine("-static Disable dynamic binding");
+ Console.Error.WriteLine("-assemblyattributes: Read assembly custom attributes from specified");
+ Console.Error.WriteLine(" class file.");
}
void ParseCommandLine(IEnumerator arglist, List targets, CompilerOptions options)
@@ -543,7 +551,6 @@ sealed class IkvmcCompiler
IkvmcCompiler nestedLevel = new IkvmcCompiler();
nestedLevel.manifestMainClass = manifestMainClass;
nestedLevel.defaultAssemblyName = defaultAssemblyName;
- nestedLevel.classesToExclude = new List(classesToExclude);
nestedLevel.ContinueParseCommandLine(arglist, targets, options.Copy());
}
else if(s == "}")
@@ -775,7 +782,7 @@ sealed class IkvmcCompiler
}
else if(s.StartsWith("-exclude:"))
{
- ProcessExclusionFile(classesToExclude, s.Substring(9));
+ ProcessExclusionFile(ref options.classesToExclude, s.Substring(9));
}
else if(s.StartsWith("-version:"))
{
@@ -977,12 +984,25 @@ sealed class IkvmcCompiler
}
else if(s == "-static")
{
- options.codegenoptions |= CodeGenOptions.DisableDynamicBinding;
+ // we abuse -static to also enable support for NoRefEmit scenarios
+ options.codegenoptions |= CodeGenOptions.DisableDynamicBinding | CodeGenOptions.NoRefEmitHelpers;
}
else if(s == "-nojarstubs") // undocumented temporary option to mitigate risk
{
options.nojarstubs = true;
}
+ else if(s.StartsWith("-assemblyattributes:", StringComparison.Ordinal))
+ {
+ ProcessAttributeAnnotationsClass(ref options.assemblyAttributeAnnotations, s.Substring(20));
+ }
+ else if(s == "-w4") // undocumented option to always warn if a class isn't found
+ {
+ options.warningLevelHigh = true;
+ }
+ else if(s == "-noparameterreflection") // undocumented option to compile core class libraries with, to disable MethodParameter attribute
+ {
+ options.noParameterReflection = true;
+ }
else
{
throw new FatalCompilerErrorException(Message.UnrecognizedOption, s);
@@ -1032,7 +1052,6 @@ sealed class IkvmcCompiler
StaticCompiler.IssueMessage(options, Message.MainMethodFromManifest, manifestMainClass);
options.mainClass = manifestMainClass;
}
- options.classesToExclude = classesToExclude.ToArray();
targets.Add(options);
}
@@ -1180,7 +1199,7 @@ sealed class IkvmcCompiler
{
foreach (CompilerOptions peer in targets)
{
- if (peer.assembly.Equals(reference, StringComparison.InvariantCultureIgnoreCase))
+ if (peer.assembly.Equals(reference, StringComparison.OrdinalIgnoreCase))
{
ArrayAppend(ref target.peerReferences, peer.assembly);
goto next_reference;
@@ -1238,10 +1257,22 @@ sealed class IkvmcCompiler
}
else
{
- T[] temp = new T[array.Length + 1];
- Array.Copy(array, 0, temp, 0, array.Length);
- temp[temp.Length - 1] = element;
- array = temp;
+ array = ArrayUtil.Concat(array, element);
+ }
+ }
+
+ private static void ArrayAppend(ref T[] array, T[] append)
+ {
+ if (array == null)
+ {
+ array = append;
+ }
+ else if (append != null)
+ {
+ T[] tmp = new T[array.Length + append.Length];
+ Array.Copy(array, tmp, array.Length);
+ Array.Copy(append, 0, tmp, array.Length, append.Length);
+ array = tmp;
}
}
@@ -1262,7 +1293,7 @@ sealed class IkvmcCompiler
ClassFile cf;
try
{
- cf = new ClassFile(buf, 0, buf.Length, "", ClassFileParseOptions.None);
+ cf = new ClassFile(buf, 0, buf.Length, "", ClassFileParseOptions.None, null);
}
catch (ClassFormatError)
{
@@ -1290,7 +1321,7 @@ sealed class IkvmcCompiler
return true;
}
- private static bool IsStubLegacy(CompilerOptions options, ZipEntry ze, byte[] data)
+ private static bool IsExcludedOrStubLegacy(CompilerOptions options, ZipEntry ze, byte[] data)
{
if (ze.Name.EndsWith(".class", StringComparison.OrdinalIgnoreCase))
{
@@ -1298,7 +1329,7 @@ sealed class IkvmcCompiler
{
bool stub;
string name = ClassFile.GetClassName(data, 0, data.Length, out stub);
- if (stub && EmitStubWarning(options, data))
+ if (options.IsExcludedClass(name) || (stub && EmitStubWarning(options, data)))
{
// we use stubs to add references, but otherwise ignore them
return true;
@@ -1356,7 +1387,7 @@ sealed class IkvmcCompiler
{
found = true;
byte[] data = ReadFromZip(zf, ze);
- if (IsStubLegacy(options, ze, data))
+ if (IsExcludedOrStubLegacy(options, ze, data))
{
continue;
}
@@ -1405,6 +1436,10 @@ sealed class IkvmcCompiler
{
bool stub;
string name = ClassFile.GetClassName(data, 0, data.Length, out stub);
+ if (options.IsExcludedClass(name))
+ {
+ return;
+ }
if (stub && EmitStubWarning(options, data))
{
// we use stubs to add references, but otherwise ignore them
@@ -1474,10 +1509,11 @@ sealed class IkvmcCompiler
}
//This processes an exclusion file with a single regular expression per line
- private static void ProcessExclusionFile(List classesToExclude, String filename)
+ private static void ProcessExclusionFile(ref string[] classesToExclude, string filename)
{
try
{
+ List list = classesToExclude == null ? new List() : new List(classesToExclude);
using(StreamReader file = new StreamReader(filename))
{
String line;
@@ -1486,14 +1522,29 @@ sealed class IkvmcCompiler
line = line.Trim();
if(!line.StartsWith("//") && line.Length != 0)
{
- classesToExclude.Add(line);
+ list.Add(line);
}
}
}
+ classesToExclude = list.ToArray();
}
catch(Exception x)
{
throw new FatalCompilerErrorException(Message.ErrorReadingFile, filename, x.Message);
}
}
+
+ private static void ProcessAttributeAnnotationsClass(ref object[] annotations, string filename)
+ {
+ try
+ {
+ byte[] buf = File.ReadAllBytes(filename);
+ ClassFile cf = new ClassFile(buf, 0, buf.Length, null, ClassFileParseOptions.None, null);
+ ArrayAppend(ref annotations, cf.Annotations);
+ }
+ catch (Exception x)
+ {
+ throw new FatalCompilerErrorException(Message.ErrorReadingFile, filename, x.Message);
+ }
+ }
}
diff --git a/external/ikvm/ikvmc/CompilerClassLoader.cs.REMOVED.git-id b/external/ikvm/ikvmc/CompilerClassLoader.cs.REMOVED.git-id
index 52ef2043ca..479732fb1a 100644
--- a/external/ikvm/ikvmc/CompilerClassLoader.cs.REMOVED.git-id
+++ b/external/ikvm/ikvmc/CompilerClassLoader.cs.REMOVED.git-id
@@ -1 +1 @@
-e7247c17ca6a6a7139699d9fdb9ddf15796f40b4
\ No newline at end of file
+b71e0f94bba2f37126b0c66cbd774ef9d76cd588
\ No newline at end of file
diff --git a/external/ikvm/ikvmc/Proxy.cs b/external/ikvm/ikvmc/Proxy.cs
index 14f87273e9..4bd2a4fb6f 100644
--- a/external/ikvm/ikvmc/Proxy.cs
+++ b/external/ikvm/ikvmc/Proxy.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2011 Jeroen Frijters
+ Copyright (C) 2011-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -23,6 +23,7 @@
*/
using System;
using System.Collections.Generic;
+using IKVM.Attributes;
using IKVM.Reflection;
using IKVM.Reflection.Emit;
using Type = IKVM.Reflection.Type;
@@ -143,6 +144,7 @@ namespace IKVM.Internal
// Check for duplicates
if (!MethodExists(methods, mw))
{
+ mw.Link();
methods.Add(mw);
}
}
@@ -220,9 +222,20 @@ namespace IKVM.Internal
private static void CreateNoFail(CompilerClassLoader loader, TypeWrapper[] interfaces, List methods)
{
+ bool ispublic = true;
+ Type[] interfaceTypes = new Type[interfaces.Length];
+ for (int i = 0; i < interfaceTypes.Length; i++)
+ {
+ ispublic &= interfaces[i].IsPublic;
+ interfaceTypes[i] = interfaces[i].TypeAsBaseType;
+ }
+ TypeAttributes attr = TypeAttributes.Class | TypeAttributes.Sealed;
+ attr |= ispublic ? TypeAttributes.NestedPublic : TypeAttributes.NestedAssembly;
DynamicClassLoader factory = (DynamicClassLoader)loader.GetTypeWrapperFactory();
- TypeBuilder tb = factory.DefineProxy(proxyClass, interfaces);
+ TypeBuilder tb = factory.DefineProxy(TypeNameUtil.GetProxyNestedName(interfaces), attr, proxyClass.TypeAsBaseType, interfaceTypes);
AttributeHelper.SetImplementsAttribute(tb, interfaces);
+ // we apply an InnerClass attribute to avoid the CompiledTypeWrapper heuristics for figuring out the modifiers
+ AttributeHelper.SetInnerClass(tb, null, ispublic ? Modifiers.Public | Modifiers.Final : Modifiers.Final);
CreateConstructor(tb);
for (int i = 0; i < methods.Count; i++)
{
@@ -232,7 +245,7 @@ namespace IKVM.Internal
{
CreateMethod(loader, tb, method);
}
- CreateStaticInitializer(tb, methods);
+ CreateStaticInitializer(tb, methods, loader);
}
private static void CreateConstructor(TypeBuilder tb)
@@ -297,7 +310,7 @@ namespace IKVM.Internal
}
else if (returnType.IsPrimitive)
{
- Boxer.EmitUnbox(ilgen, returnType);
+ Boxer.EmitUnbox(ilgen, returnType, true);
}
else if (returnType != CoreClasses.java.lang.Object.Wrapper)
{
@@ -341,9 +354,9 @@ namespace IKVM.Internal
ilgen.DoEmit();
}
- private static void CreateStaticInitializer(TypeBuilder tb, List methods)
+ private static void CreateStaticInitializer(TypeBuilder tb, List methods, CompilerClassLoader loader)
{
- CodeEmitter ilgen = CodeEmitter.Create(ReflectUtil.DefineTypeInitializer(tb));
+ CodeEmitter ilgen = CodeEmitter.Create(ReflectUtil.DefineTypeInitializer(tb, loader));
CodeEmitterLocal callerID = ilgen.DeclareLocal(CoreClasses.ikvm.@internal.CallerID.Wrapper.TypeAsSignatureType);
TypeBuilder tbCallerID = DynamicTypeWrapper.FinishContext.EmitCreateCallerID(tb, ilgen);
ilgen.Emit(OpCodes.Stloc, callerID);
@@ -401,7 +414,10 @@ namespace IKVM.Internal
Dictionary methods = new Dictionary();
foreach (MethodWrapper mw in tw.GetMethods())
{
- methods.Add(mw.Name + mw.Signature, mw);
+ if (mw.IsVirtual)
+ {
+ methods.Add(mw.Name + mw.Signature, mw);
+ }
}
foreach (TypeWrapper iface in tw.Interfaces)
{
@@ -438,165 +454,4 @@ namespace IKVM.Internal
}
}
}
-
- static class Boxer
- {
- private static readonly TypeWrapper javaLangByte;
- private static readonly MethodWrapper byteValue;
- private static readonly MethodWrapper valueOfByte;
- private static readonly TypeWrapper javaLangBoolean;
- private static readonly MethodWrapper booleanValue;
- private static readonly MethodWrapper valueOfBoolean;
- private static readonly TypeWrapper javaLangShort;
- private static readonly MethodWrapper shortValue;
- private static readonly MethodWrapper valueOfShort;
- private static readonly TypeWrapper javaLangCharacter;
- private static readonly MethodWrapper charValue;
- private static readonly MethodWrapper valueOfCharacter;
- private static readonly TypeWrapper javaLangInteger;
- private static readonly MethodWrapper intValue;
- private static readonly MethodWrapper valueOfInteger;
- private static readonly TypeWrapper javaLangFloat;
- private static readonly MethodWrapper floatValue;
- private static readonly MethodWrapper valueOfFloat;
- private static readonly TypeWrapper javaLangLong;
- private static readonly MethodWrapper longValue;
- private static readonly MethodWrapper valueOfLong;
- private static readonly TypeWrapper javaLangDouble;
- private static readonly MethodWrapper doubleValue;
- private static readonly MethodWrapper valueOfDouble;
-
- static Boxer()
- {
- ClassLoaderWrapper bootClassLoader = ClassLoaderWrapper.GetBootstrapClassLoader();
- javaLangByte = bootClassLoader.LoadClassByDottedNameFast("java.lang.Byte");
- byteValue = javaLangByte.GetMethodWrapper("byteValue", "()B", false);
- byteValue.Link();
- valueOfByte = javaLangByte.GetMethodWrapper("valueOf", "(B)Ljava.lang.Byte;", false);
- valueOfByte.Link();
- javaLangBoolean = bootClassLoader.LoadClassByDottedNameFast("java.lang.Boolean");
- booleanValue = javaLangBoolean.GetMethodWrapper("booleanValue", "()Z", false);
- booleanValue.Link();
- valueOfBoolean = javaLangBoolean.GetMethodWrapper("valueOf", "(Z)Ljava.lang.Boolean;", false);
- valueOfBoolean.Link();
- javaLangShort = bootClassLoader.LoadClassByDottedNameFast("java.lang.Short");
- shortValue = javaLangShort.GetMethodWrapper("shortValue", "()S", false);
- shortValue.Link();
- valueOfShort = javaLangShort.GetMethodWrapper("valueOf", "(S)Ljava.lang.Short;", false);
- valueOfShort.Link();
- javaLangCharacter = bootClassLoader.LoadClassByDottedNameFast("java.lang.Character");
- charValue = javaLangCharacter.GetMethodWrapper("charValue", "()C", false);
- charValue.Link();
- valueOfCharacter = javaLangCharacter.GetMethodWrapper("valueOf", "(C)Ljava.lang.Character;", false);
- valueOfCharacter.Link();
- javaLangInteger = bootClassLoader.LoadClassByDottedNameFast("java.lang.Integer");
- intValue = javaLangInteger.GetMethodWrapper("intValue", "()I", false);
- intValue.Link();
- valueOfInteger = javaLangInteger.GetMethodWrapper("valueOf", "(I)Ljava.lang.Integer;", false);
- valueOfInteger.Link();
- javaLangFloat = bootClassLoader.LoadClassByDottedNameFast("java.lang.Float");
- floatValue = javaLangFloat.GetMethodWrapper("floatValue", "()F", false);
- floatValue.Link();
- valueOfFloat = javaLangFloat.GetMethodWrapper("valueOf", "(F)Ljava.lang.Float;", false);
- valueOfFloat.Link();
- javaLangLong = bootClassLoader.LoadClassByDottedNameFast("java.lang.Long");
- longValue = javaLangLong.GetMethodWrapper("longValue", "()J", false);
- longValue.Link();
- valueOfLong = javaLangLong.GetMethodWrapper("valueOf", "(J)Ljava.lang.Long;", false);
- valueOfLong.Link();
- javaLangDouble = bootClassLoader.LoadClassByDottedNameFast("java.lang.Double");
- doubleValue = javaLangDouble.GetMethodWrapper("doubleValue", "()D", false);
- doubleValue.Link();
- valueOfDouble = javaLangDouble.GetMethodWrapper("valueOf", "(D)Ljava.lang.Double;", false);
- valueOfDouble.Link();
- }
-
- internal static void EmitUnbox(CodeEmitter ilgen, TypeWrapper tw)
- {
- if (tw == PrimitiveTypeWrapper.BYTE)
- {
- javaLangByte.EmitCheckcast(ilgen);
- byteValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.BOOLEAN)
- {
- javaLangBoolean.EmitCheckcast(ilgen);
- booleanValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.SHORT)
- {
- javaLangShort.EmitCheckcast(ilgen);
- shortValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.CHAR)
- {
- javaLangCharacter.EmitCheckcast(ilgen);
- charValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.INT)
- {
- javaLangInteger.EmitCheckcast(ilgen);
- intValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.FLOAT)
- {
- javaLangFloat.EmitCheckcast(ilgen);
- floatValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.LONG)
- {
- javaLangLong.EmitCheckcast(ilgen);
- longValue.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.DOUBLE)
- {
- javaLangDouble.EmitCheckcast(ilgen);
- doubleValue.EmitCall(ilgen);
- }
- else
- {
- throw new InvalidOperationException();
- }
- }
-
- internal static void EmitBox(CodeEmitter ilgen, TypeWrapper tw)
- {
- if (tw == PrimitiveTypeWrapper.BYTE)
- {
- valueOfByte.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.BOOLEAN)
- {
- valueOfBoolean.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.SHORT)
- {
- valueOfShort.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.CHAR)
- {
- valueOfCharacter.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.INT)
- {
- valueOfInteger.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.FLOAT)
- {
- valueOfFloat.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.LONG)
- {
- valueOfLong.EmitCall(ilgen);
- }
- else if (tw == PrimitiveTypeWrapper.DOUBLE)
- {
- valueOfDouble.EmitCall(ilgen);
- }
- else
- {
- throw new InvalidOperationException();
- }
- }
- }
}
diff --git a/external/ikvm/ikvmc/ikvmc.build b/external/ikvm/ikvmc/ikvmc.build
index af5dcb9cb9..06dda99f52 100644
--- a/external/ikvm/ikvmc/ikvmc.build
+++ b/external/ikvm/ikvmc/ikvmc.build
@@ -1,9 +1,32 @@
+
-
+
@@ -25,6 +48,7 @@
+
@@ -37,8 +61,10 @@
+
+
diff --git a/external/ikvm/openjdk/FORKED b/external/ikvm/openjdk/FORKED
index 64e8faf23a..5260658227 100644
--- a/external/ikvm/openjdk/FORKED
+++ b/external/ikvm/openjdk/FORKED
@@ -30,18 +30,7 @@ jdk/src/share/classes/java/io/RandomAccessFile.java=java/io/RandomAccessFile.jav
jdk/src/share/classes/java/lang/Class.java=java/lang/Class.java
jdk/src/share/classes/java/lang/ClassLoader.java=java/lang/ClassLoader.java
jdk/src/share/classes/java/lang/Enum.java=java/lang/Enum.java
-jdk/src/share/classes/java/lang/invoke/AdapterMethodHandle.java=java/lang/invoke/AdapterMethodHandle.java
-jdk/src/share/classes/java/lang/invoke/BoundMethodHandle.java=java/lang/invoke/BoundMethodHandle.java
-jdk/src/share/classes/java/lang/invoke/CallSite.java=java/lang/invoke/CallSite.java
-jdk/src/share/classes/java/lang/invoke/ConstantCallSite.java=java/lang/invoke/ConstantCallSite.java
-jdk/src/share/classes/java/lang/invoke/DirectMethodHandle.java=java/lang/invoke/DirectMethodHandle.java
-jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java=java/lang/invoke/MethodHandleImpl.java
-jdk/src/share/classes/java/lang/invoke/MethodHandleNatives.java=java/lang/invoke/MethodHandleNatives.java
-jdk/src/share/classes/java/lang/invoke/MethodHandles.java=java/lang/invoke/MethodHandles.java
-jdk/src/share/classes/java/lang/invoke/MutableCallSite.java=java/lang/invoke/MutableCallSite.java
-jdk/src/share/classes/java/lang/invoke/VolatileCallSite.java=java/lang/invoke/VolatileCallSite.java
jdk/src/share/classes/java/lang/management/PlatformComponent.java=java/lang/management/PlatformComponent.java
-jdk/src/share/classes/java/lang/Package.java=java/lang/Package.java
jdk/src/share/classes/java/lang/ref/SoftReference.java=java/lang/ref/SoftReference.java
jdk/src/share/classes/java/lang/reflect/Constructor.java=java/lang/reflect/Constructor.java
jdk/src/share/classes/java/lang/reflect/Field.java=java/lang/reflect/Field.java
@@ -57,7 +46,6 @@ jdk/src/share/classes/java/net/SocketOutputStream.java=java/net/SocketOutputStre
jdk/src/share/classes/java/nio/Bits.java=java/nio/Bits.java
jdk/src/share/classes/java/security/AccessController.java=java/security/AccessController.java
jdk/src/share/classes/java/security/ProtectionDomain.java=java/security/ProtectionDomain.java
-jdk/src/share/classes/java/sql/DriverManager.java=java/sql/DriverManager.java
jdk/src/share/classes/java/util/concurrent/atomic/AtomicBoolean.java=../classpath/java/util/concurrent/atomic/AtomicBoolean.java
jdk/src/share/classes/java/util/concurrent/atomic/AtomicInteger.java=../classpath/java/util/concurrent/atomic/AtomicInteger.java
jdk/src/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java=../classpath/java/util/concurrent/atomic/AtomicIntegerArray.java
@@ -67,9 +55,6 @@ jdk/src/share/classes/java/util/concurrent/atomic/AtomicReference.java=../classp
jdk/src/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java=../classpath/java/util/concurrent/atomic/AtomicReferenceArray.java
jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java=java/util/concurrent/locks/AbstractQueuedSynchronizer.java
jdk/src/share/classes/java/util/concurrent/locks/LockSupport.java=java/util/concurrent/locks/LockSupport.java
-jdk/src/share/classes/java/util/ResourceBundle.java=java/util/ResourceBundle.java
-jdk/src/share/classes/java/util/TimeZone.java=java/util/TimeZone.java
-jdk/src/share/classes/sun/awt/AppContext.java=sun/awt/AppContext.java
jdk/src/share/classes/sun/awt/EmbeddedFrame.java=sun/awt/EmbeddedFrame.java
jdk/src/share/classes/sun/awt/image/ByteInterleavedRaster.java=sun/awt/image/ByteInterleavedRaster.java
jdk/src/share/classes/sun/awt/image/ImagingLib.java=sun/awt/image/ImagingLib.java
@@ -79,11 +64,8 @@ jdk/src/share/classes/sun/awt/image/ToolkitImage.java=sun/awt/image/ToolkitImage
jdk/src/share/classes/sun/awt/SunToolkit.java=sun/awt/SunToolkit.java
jdk/src/share/classes/sun/font/FontManager.java=sun/font/FontManager.java
jdk/src/share/classes/sun/font/StrikeCache.java=sun/font/StrikeCache.java
-jdk/src/share/classes/sun/management/GcInfoBuilder.java=sun/management/GcInfoBuilder.java
jdk/src/share/classes/sun/management/ManagementFactoryHelper.java=sun/management/ManagementFactoryHelper.java
jdk/src/share/classes/sun/management/VMManagementImpl.java=sun/management/VMManagementImpl.java
-jdk/src/share/classes/sun/misc/IoTrace.java=sun/misc/IoTrace.java
-jdk/src/share/classes/sun/misc/JavaAWTAccess.java=sun/misc/JavaAWTAccess.java
jdk/src/share/classes/sun/misc/SharedSecrets.java=sun/misc/SharedSecrets.java
jdk/src/share/classes/sun/misc/VM.java=sun/misc/VM.java
jdk/src/share/classes/sun/net/sdp/SdpSupport.java=sun/net/sdp/SdpSupport.java
@@ -94,9 +76,8 @@ jdk/src/share/classes/sun/nio/ch/IOUtil.java=sun/nio/ch/IOUtil.java
jdk/src/share/classes/sun/nio/ch/NativeDispatcher.java=sun/nio/ch/NativeDispatcher.java
jdk/src/share/classes/sun/nio/ch/Net.java=sun/nio/ch/Net.java
jdk/src/share/classes/sun/nio/ch/Util.java=sun/nio/ch/Util.java
-jdk/src/share/classes/sun/reflect/CallerSensitive.java=sun/reflect/CallerSensitive.java
+jdk/src/share/classes/sun/reflect/annotation/AnnotationType.java=sun/reflect/annotation/AnnotationType.java
jdk/src/share/classes/sun/reflect/MethodAccessor.java=sun/reflect/MethodAccessor.java
-jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java=sun/reflect/misc/ReflectUtil.java
jdk/src/share/classes/sun/reflect/Reflection.java=sun/reflect/Reflection.java
jdk/src/share/classes/sun/reflect/ReflectionFactory.java=sun/reflect/ReflectionFactory.java
jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java=sun/nio/fs/UnixUriUtils.java
diff --git a/external/ikvm/openjdk/allsources.lst.REMOVED.git-id b/external/ikvm/openjdk/allsources.lst.REMOVED.git-id
index 2083ba76e0..11b74df61c 100644
--- a/external/ikvm/openjdk/allsources.lst.REMOVED.git-id
+++ b/external/ikvm/openjdk/allsources.lst.REMOVED.git-id
@@ -1 +1 @@
-533d7645e2bb496cbbac8996759c133993dcc1bb
\ No newline at end of file
+4911d54d998b7a044246f97683fb62901e9dc052
\ No newline at end of file
diff --git a/external/ikvm/openjdk/ikvm/internal/AnnotationAttributeBase.java b/external/ikvm/openjdk/ikvm/internal/AnnotationAttributeBase.java
index f2359e5498..6b77d2f356 100644
--- a/external/ikvm/openjdk/ikvm/internal/AnnotationAttributeBase.java
+++ b/external/ikvm/openjdk/ikvm/internal/AnnotationAttributeBase.java
@@ -236,12 +236,14 @@ public abstract class AnnotationAttributeBase
{
// TODO consider checking that the type matches
// (or better yet (?), remove the first two redundant elements from the array)
- decodeValues(values, annotationType, annotationType.getClassLoader(), definition);
+ decodeValues(values, annotationType, annotationType.getClassLoader(), unescapeInvalidSurrogates(definition));
definition = null;
}
}
}
+ private static native Object[] unescapeInvalidSurrogates(Object[] definition);
+
private static void decodeValues(HashMap map, Class annotationClass, ClassLoader loader, Object[] array)
{
for (int i = 2; i < array.length; i += 2)
diff --git a/external/ikvm/openjdk/java/lang/Class.java.REMOVED.git-id b/external/ikvm/openjdk/java/lang/Class.java.REMOVED.git-id
index b69294ee34..dd598adddb 100644
--- a/external/ikvm/openjdk/java/lang/Class.java.REMOVED.git-id
+++ b/external/ikvm/openjdk/java/lang/Class.java.REMOVED.git-id
@@ -1 +1 @@
-bbc1d241f632078e8ecf146e9398406c5719dd2f
\ No newline at end of file
+07fd7bd567e5b0ae8b3ae9c32741b56f6f363b0a
\ No newline at end of file
diff --git a/external/ikvm/openjdk/java/lang/LangHelper.java b/external/ikvm/openjdk/java/lang/LangHelper.java
index cc62d2cbd6..8d725d4374 100644
--- a/external/ikvm/openjdk/java/lang/LangHelper.java
+++ b/external/ikvm/openjdk/java/lang/LangHelper.java
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2007-2011 Jeroen Frijters
+ Copyright (C) 2007-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -24,80 +24,40 @@
package java.lang;
-import ikvm.runtime.AssemblyClassLoader;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.util.Enumeration;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Executable;
+import java.security.AccessControlContext;
import java.util.Map;
import sun.nio.ch.Interruptible;
import sun.reflect.annotation.AnnotationType;
-import sun.security.action.GetPropertyAction;
@ikvm.lang.Internal
public class LangHelper
{
- private static boolean addedSystemPackages;
-
- private static void addSystemPackage(Map pkgMap)
- {
- // NOTE caller must have acquired lock on pkgMap
- if (!addedSystemPackages)
- {
- addedSystemPackages = true;
- String[] pkgs = getBootClassPackages();
- for (int i = 0; i < pkgs.length; i++)
- {
- pkgMap.put(pkgs[i],
- new Package(pkgs[i],
- VMSystemProperties.SPEC_TITLE, // specTitle
- VMSystemProperties.SPEC_VERSION, // specVersion
- VMSystemProperties.SPEC_VENDOR, // specVendor
- "IKVM.NET OpenJDK", // implTitle
- PropertyConstants.openjdk_version, // implVersion
- "Oracle Corporation & others", // implVendor
- null, // sealBase
- null)); // class loader
- }
- }
- }
-
- private static native String[] getBootClassPackages();
-
- /* this method gets called by Package.getSystemPackage() via a redefined method in map.xml */
- static Package getSystemPackage(Map pkgs, String name)
- {
- synchronized (pkgs)
- {
- addSystemPackage(pkgs);
- return (Package)pkgs.get(name);
- }
- }
-
- /* this method gets called by Package.getSystemPackages() via a redefined method in map.xml */
- static Package[] getSystemPackages(Map pkgs)
- {
- synchronized (pkgs)
- {
- addSystemPackage(pkgs);
- return (Package[])pkgs.values().toArray(new Package[pkgs.size()]);
-
- }
- }
-
public static sun.misc.JavaLangAccess getJavaLangAccess()
{
return new sun.misc.JavaLangAccess() {
public sun.reflect.ConstantPool getConstantPool(Class klass) {
- return null;
+ return klass.getConstantPool();
}
- public void setAnnotationType(Class klass, AnnotationType type) {
- klass.setAnnotationType(type);
+ public boolean casAnnotationType(Class> klass, AnnotationType oldType, AnnotationType newType) {
+ return klass.casAnnotationType(oldType, newType);
}
public AnnotationType getAnnotationType(Class klass) {
return klass.getAnnotationType();
}
+ public Map, Annotation> getDeclaredAnnotationMap(Class> klass) {
+ return klass.getDeclaredAnnotationMap();
+ }
+ public byte[] getRawClassAnnotations(Class> klass) {
+ throw new InternalError();
+ }
+ public byte[] getRawClassTypeAnnotations(Class> klass) {
+ return klass.getRawTypeAnnotations();
+ }
+ public byte[] getRawExecutableTypeAnnotations(Executable executable) {
+ return Class.getExecutableTypeAnnotationBytes(executable);
+ }
public >
E[] getEnumConstantsShared(Class klass) {
return klass.getEnumConstantsShared();
@@ -114,8 +74,14 @@ public class LangHelper
public StackTraceElement getStackTraceElement(Throwable t, int i) {
return t.getStackTraceElement(i);
}
- public int getStringHash32(String string) {
- return StringHelper.hash32(string);
+ public String newStringUnsafe(char[] chars) {
+ return String.valueOf(chars);
+ }
+ public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) {
+ return new Thread(target, acc);
+ }
+ public void invokeFinalize(Object o) throws Throwable {
+ // we don't actually support invoking the finalize method explicitly
}
};
}
diff --git a/external/ikvm/openjdk/java/lang/ProcessImpl.java b/external/ikvm/openjdk/java/lang/ProcessImpl.java
index 9147b345ac..0624dc1784 100644
--- a/external/ikvm/openjdk/java/lang/ProcessImpl.java
+++ b/external/ikvm/openjdk/java/lang/ProcessImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,9 +42,15 @@ import java.io.BufferedOutputStream;
import java.lang.ProcessBuilder.Redirect;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import cli.System.AsyncCallback;
import cli.System.IAsyncResult;
import cli.System.Diagnostics.ProcessStartInfo;
+import cli.System.EventArgs;
+import cli.System.EventHandler;
import cli.System.IO.FileAccess;
import cli.System.IO.FileShare;
import cli.System.IO.FileMode;
@@ -146,8 +152,17 @@ final class ProcessImpl extends Process {
return new ProcessImpl(cmdarray, environment, dir,
stdHandles, redirectErrorStream);
+ } catch (Throwable t) {
+ if (f0 != null)
+ f0.close();
+ if (f1 != null)
+ f1.close();
+ if (f2 != null)
+ f2.close();
+ throw t;
} finally {
// HACK prevent the File[In|Out]putStream objects from closing the streams
+ // (the System.IO.FileStream will eventually be closed explicitly or by its finalizer)
if (f0 != null)
cli.System.GC.SuppressFinalize(f0);
if (f1 != null)
@@ -158,50 +173,240 @@ final class ProcessImpl extends Process {
}
+ private static class LazyPattern {
+ // Escape-support version:
+ // "(\")((?:\\\\\\1|.)+?)\\1|([^\\s\"]+)";
+ private static final Pattern PATTERN =
+ Pattern.compile("[^\\s\"]+|\"[^\"]*\"");
+ };
+
+ /* Parses the command string parameter into the executable name and
+ * program arguments.
+ *
+ * The command string is broken into tokens. The token separator is a space
+ * or quota character. The space inside quotation is not a token separator.
+ * There are no escape sequences.
+ */
+ private static String[] getTokensFromCommand(String command) {
+ ArrayList matchList = new ArrayList<>(8);
+ Matcher regexMatcher = LazyPattern.PATTERN.matcher(command);
+ while (regexMatcher.find())
+ matchList.add(regexMatcher.group());
+ return matchList.toArray(new String[matchList.size()]);
+ }
+
+ private static final int VERIFICATION_CMD_BAT = 0;
+ private static final int VERIFICATION_WIN32 = 1;
+ private static final int VERIFICATION_LEGACY = 2;
+ private static final char ESCAPE_VERIFICATION[][] = {
+ // We guarantee the only command file execution for implicit [cmd.exe] run.
+ // http://technet.microsoft.com/en-us/library/bb490954.aspx
+ {' ', '\t', '<', '>', '&', '|', '^'},
+
+ {' ', '\t', '<', '>'},
+ {' ', '\t'}
+ };
+
+ private static String createCommandLine(int verificationType,
+ final String executablePath,
+ final String cmd[])
+ {
+ StringBuilder cmdbuf = new StringBuilder(80);
+
+ cmdbuf.append(executablePath);
+
+ for (int i = 1; i < cmd.length; ++i) {
+ cmdbuf.append(' ');
+ String s = cmd[i];
+ if (needsEscaping(verificationType, s)) {
+ cmdbuf.append('"').append(s);
+
+ // The code protects the [java.exe] and console command line
+ // parser, that interprets the [\"] combination as an escape
+ // sequence for the ["] char.
+ // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
+ //
+ // If the argument is an FS path, doubling of the tail [\]
+ // char is not a problem for non-console applications.
+ //
+ // The [\"] sequence is not an escape sequence for the [cmd.exe]
+ // command line parser. The case of the [""] tail escape
+ // sequence could not be realized due to the argument validation
+ // procedure.
+ if ((verificationType != VERIFICATION_CMD_BAT) && s.endsWith("\\")) {
+ cmdbuf.append('\\');
+ }
+ cmdbuf.append('"');
+ } else {
+ cmdbuf.append(s);
+ }
+ }
+ return cmdbuf.toString();
+ }
+
+ private static boolean isQuoted(boolean noQuotesInside, String arg,
+ String errorMessage) {
+ int lastPos = arg.length() - 1;
+ if (lastPos >=1 && arg.charAt(0) == '"' && arg.charAt(lastPos) == '"') {
+ // The argument has already been quoted.
+ if (noQuotesInside) {
+ if (arg.indexOf('"', 1) != lastPos) {
+ // There is ["] inside.
+ throw new IllegalArgumentException(errorMessage);
+ }
+ }
+ return true;
+ }
+ if (noQuotesInside) {
+ if (arg.indexOf('"') >= 0) {
+ // There is ["] inside.
+ throw new IllegalArgumentException(errorMessage);
+ }
+ }
+ return false;
+ }
+
+ private static boolean needsEscaping(int verificationType, String arg) {
+ // Switch off MS heuristic for internal ["].
+ // Please, use the explicit [cmd.exe] call
+ // if you need the internal ["].
+ // Example: "cmd.exe", "/C", "Extended_MS_Syntax"
+
+ // For [.exe] or [.com] file the unpaired/internal ["]
+ // in the argument is not a problem.
+ boolean argIsQuoted = isQuoted(
+ (verificationType == VERIFICATION_CMD_BAT),
+ arg, "Argument has embedded quote, use the explicit CMD.EXE call.");
+
+ if (!argIsQuoted) {
+ char testEscape[] = ESCAPE_VERIFICATION[verificationType];
+ for (int i = 0; i < testEscape.length; ++i) {
+ if (arg.indexOf(testEscape[i]) >= 0) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private static String getExecutablePath(String path)
+ throws IOException
+ {
+ boolean pathIsQuoted = isQuoted(true, path,
+ "Executable name has embedded quote, split the arguments");
+
+ // Win32 CreateProcess requires path to be normalized
+ File fileToRun = new File(pathIsQuoted
+ ? path.substring(1, path.length() - 1)
+ : path);
+
+ // From the [CreateProcess] function documentation:
+ //
+ // "If the file name does not contain an extension, .exe is appended.
+ // Therefore, if the file name extension is .com, this parameter
+ // must include the .com extension. If the file name ends in
+ // a period (.) with no extension, or if the file name contains a path,
+ // .exe is not appended."
+ //
+ // "If the file name !does not contain a directory path!,
+ // the system searches for the executable file in the following
+ // sequence:..."
+ //
+ // In practice ANY non-existent path is extended by [.exe] extension
+ // in the [CreateProcess] funcion with the only exception:
+ // the path ends by (.)
+
+ return fileToRun.getPath();
+ }
+
+
+ private boolean isShellFile(String executablePath) {
+ String upPath = executablePath.toUpperCase();
+ return (upPath.endsWith(".CMD") || upPath.endsWith(".BAT"));
+ }
+
+ private String quoteString(String arg) {
+ StringBuilder argbuf = new StringBuilder(arg.length() + 2);
+ return argbuf.append('"').append(arg).append('"').toString();
+ }
+
+
private cli.System.Diagnostics.Process handle;
private OutputStream stdin_stream;
private InputStream stdout_stream;
private InputStream stderr_stream;
- private ProcessImpl(final String cmd[],
+ private ProcessImpl(String cmd[],
final java.util.Map envblock,
final String path,
final Stream[] stdHandles,
final boolean redirectErrorStream)
throws IOException
{
- // Win32 CreateProcess requires cmd[0] to be normalized
- cmd[0] = new File(cmd[0]).getPath();
-
- // give the runtime an opportunity to map executables from VFS to a real executable
- cmd[0] = mapVfsExecutable(cmd[0]);
-
- StringBuilder cmdbuf = new StringBuilder(80);
- for (int i = 0; i < cmd.length; i++) {
- if (i > 0) {
- cmdbuf.append(' ');
- }
- String s = cmd[i];
- if (s.indexOf(' ') >= 0 || s.indexOf('\t') >= 0) {
- if (s.charAt(0) != '"') {
- cmdbuf.append('"');
- cmdbuf.append(s);
- if (s.endsWith("\\")) {
- cmdbuf.append("\\");
- }
- cmdbuf.append('"');
- } else if (s.endsWith("\"")) {
- /* The argument has already been quoted. */
- cmdbuf.append(s);
- } else {
- /* Unmatched quote for the argument. */
- throw new IllegalArgumentException();
- }
- } else {
- cmdbuf.append(s);
- }
+ String cmdstr;
+ SecurityManager security = System.getSecurityManager();
+ boolean allowAmbiguousCommands = false;
+ if (security == null) {
+ allowAmbiguousCommands = true;
+ String value = System.getProperty("jdk.lang.Process.allowAmbiguousCommands");
+ if (value != null)
+ allowAmbiguousCommands = !"false".equalsIgnoreCase(value);
+ }
+ if (allowAmbiguousCommands) {
+ // Legacy mode.
+
+ // Normalize path if possible.
+ String executablePath = new File(cmd[0]).getPath();
+
+ // No worry about internal, unpaired ["], and redirection/piping.
+ if (needsEscaping(VERIFICATION_LEGACY, executablePath) )
+ executablePath = quoteString(executablePath);
+
+ cmdstr = createCommandLine(
+ //legacy mode doesn't worry about extended verification
+ VERIFICATION_LEGACY,
+ executablePath,
+ cmd);
+ } else {
+ String executablePath;
+ try {
+ executablePath = getExecutablePath(cmd[0]);
+ } catch (IllegalArgumentException e) {
+ // Workaround for the calls like
+ // Runtime.getRuntime().exec("\"C:\\Program Files\\foo\" bar")
+
+ // No chance to avoid CMD/BAT injection, except to do the work
+ // right from the beginning. Otherwise we have too many corner
+ // cases from
+ // Runtime.getRuntime().exec(String[] cmd [, ...])
+ // calls with internal ["] and escape sequences.
+
+ // Restore original command line.
+ StringBuilder join = new StringBuilder();
+ // terminal space in command line is ok
+ for (String s : cmd)
+ join.append(s).append(' ');
+
+ // Parse the command line again.
+ cmd = getTokensFromCommand(join.toString());
+ executablePath = getExecutablePath(cmd[0]);
+
+ // Check new executable name once more
+ if (security != null)
+ security.checkExec(executablePath);
+ }
+
+ // Quotation protects from interpretation of the [path] argument as
+ // start of longer path with spaces. Quotation has no influence to
+ // [.exe] extension heuristic.
+ cmdstr = createCommandLine(
+ // We need the extended verification procedure for CMD files.
+ isShellFile(executablePath)
+ ? VERIFICATION_CMD_BAT
+ : VERIFICATION_WIN32,
+ quoteString(executablePath),
+ cmd);
}
- String cmdstr = cmdbuf.toString();
handle = create(cmdstr, envblock, path,
stdHandles, redirectErrorStream);
@@ -261,6 +466,7 @@ final class ProcessImpl extends Process {
throw new InterruptedException();
return exitValue();
}
+
private static void waitForInterruptibly(cli.System.Diagnostics.Process handle) throws InterruptedException {
// to be interruptable we have to use polling
// (on .NET 2.0 WaitForExit is actually interruptible, but this isn't documented)
@@ -269,7 +475,53 @@ final class ProcessImpl extends Process {
;
}
+ @Override
+ public boolean waitFor(long timeout, TimeUnit unit)
+ throws InterruptedException
+ {
+ if (handle.get_HasExited()) return true;
+ if (timeout <= 0) return false;
+
+ long msTimeout = unit.toMillis(timeout);
+
+ waitForTimeoutInterruptibly(handle, msTimeout);
+ if (Thread.interrupted())
+ throw new InterruptedException();
+ return handle.get_HasExited();
+ }
+
+ private static void waitForTimeoutInterruptibly(
+ cli.System.Diagnostics.Process handle, long timeout) {
+ long now = System.currentTimeMillis();
+ long exp = now + timeout;
+ if (exp < now) {
+ // if we overflowed, just wait for a really long time
+ exp = Long.MAX_VALUE;
+ }
+ Thread current = Thread.currentThread();
+ for (;;) {
+ if (current.isInterrupted()) {
+ return;
+ }
+ // wait for a maximum of 100 ms to be interruptible
+ if (handle.WaitForExit((int)Math.min(100, exp - now))) {
+ return;
+ }
+ now = System.currentTimeMillis();
+ if (now >= exp) {
+ return;
+ }
+ }
+ }
+
public void destroy() { terminateProcess(handle); }
+
+ @Override
+ public Process destroyForcibly() {
+ destroy();
+ return this;
+ }
+
private static void terminateProcess(cli.System.Diagnostics.Process handle) {
try {
if (false) throw new cli.System.ComponentModel.Win32Exception();
@@ -280,10 +532,21 @@ final class ProcessImpl extends Process {
}
}
+ @Override
+ public boolean isAlive() {
+ return isProcessAlive(handle);
+ }
+
+ private static boolean isProcessAlive(cli.System.Diagnostics.Process handle) {
+ return !handle.get_HasExited();
+ }
+
/**
* Create a process using the win32 function CreateProcess.
+ * The method is synchronized due to MS kb315939 problem.
+ * All native handles should restore the inherit flag at the end of call.
*
- * @param cmdstr the Windows commandline
+ * @param cmdstr the Windows command line
* @param envblock NUL-separated, double-NUL-terminated list of
* environment strings in VAR=VALUE form
* @param dir the working directory of the process, or null if
@@ -312,7 +575,8 @@ final class ProcessImpl extends Process {
argumentsStart++;
}
- ProcessStartInfo si = new ProcessStartInfo(cmdstr.substring(0, programEnd), cmdstr.substring(argumentsStart));
+ String fileName = cmdstr.substring(0, programEnd);
+ ProcessStartInfo si = new ProcessStartInfo(mapVfsExecutable(fileName), cmdstr.substring(argumentsStart));
si.set_UseShellExecute(false);
si.set_RedirectStandardError(true);
si.set_RedirectStandardOutput(true);
@@ -338,6 +602,27 @@ final class ProcessImpl extends Process {
} catch (cli.System.InvalidOperationException x2) {
throw new IOException(x2.getMessage());
}
+
+ // if any of the handles is redirected to/from a file,
+ // we need to close the files as soon as the process exits
+ if (stdHandles[0] instanceof FileStream
+ || stdHandles[1] instanceof FileStream
+ || stdHandles[2] instanceof FileStream) {
+ final Stream s0 = stdHandles[0];
+ final Stream s1 = stdHandles[1];
+ final Stream s2 = stdHandles[2];
+ proc.set_EnableRaisingEvents(true);
+ proc.add_Exited(new EventHandler(new EventHandler.Method() {
+ public void Invoke(Object sender, EventArgs e) {
+ if (s0 instanceof FileStream)
+ s0.Close();
+ if (s1 instanceof FileStream)
+ s1.Close();
+ if (s2 instanceof FileStream)
+ s2.Close();
+ }
+ }));
+ }
Stream stdin = proc.get_StandardInput().get_BaseStream();
Stream stdout = proc.get_StandardOutput().get_BaseStream();
diff --git a/external/ikvm/openjdk/java/lang/Thread.java b/external/ikvm/openjdk/java/lang/Thread.java
deleted file mode 100644
index e8f57d065a..0000000000
--- a/external/ikvm/openjdk/java/lang/Thread.java
+++ /dev/null
@@ -1,2578 +0,0 @@
-/*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.lang;
-
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.security.AccessController;
-import java.security.AccessControlContext;
-import java.security.PrivilegedAction;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.locks.LockSupport;
-import sun.nio.ch.Interruptible;
-import sun.reflect.CallerSensitive;
-import sun.reflect.Reflection;
-import sun.security.util.SecurityConstants;
-
-
-/**
- * A thread is a thread of execution in a program. The Java
- * Virtual Machine allows an application to have multiple threads of
- * execution running concurrently.
- *
- * Every thread has a priority. Threads with higher priority are
- * executed in preference to threads with lower priority. Each thread
- * may or may not also be marked as a daemon. When code running in
- * some thread creates a new Thread object, the new
- * thread has its priority initially set equal to the priority of the
- * creating thread, and is a daemon thread if and only if the
- * creating thread is a daemon.
- *
- * When a Java Virtual Machine starts up, there is usually a single
- * non-daemon thread (which typically calls the method named
- * main of some designated class). The Java Virtual
- * Machine continues to execute threads until either of the following
- * occurs:
- *
- *
The exit method of class Runtime has been
- * called and the security manager has permitted the exit operation
- * to take place.
- *
All threads that are not daemon threads have died, either by
- * returning from the call to the run method or by
- * throwing an exception that propagates beyond the run
- * method.
- *
- *
- * There are two ways to create a new thread of execution. One is to
- * declare a class to be a subclass of Thread. This
- * subclass should override the run method of class
- * Thread. An instance of the subclass can then be
- * allocated and started. For example, a thread that computes primes
- * larger than a stated value could be written as follows:
- *
- * The following code would then create a thread and start it running:
- *
- * PrimeThread p = new PrimeThread(143);
- * p.start();
- *
- *
- * The other way to create a thread is to declare a class that
- * implements the Runnable interface. That class then
- * implements the run method. An instance of the class can
- * then be allocated, passed as an argument when creating
- * Thread, and started. The same example in this other
- * style looks like the following:
- *
- * The following code would then create a thread and start it running:
- *
- * PrimeRun p = new PrimeRun(143);
- * new Thread(p).start();
- *
- *
- * Every thread has a name for identification purposes. More than
- * one thread may have the same name. If a name is not specified when
- * a thread is created, a new name is generated for it.
- *
- * Unless otherwise noted, passing a {@code null} argument to a constructor
- * or method in this class will cause a {@link NullPointerException} to be
- * thrown.
- *
- * @author unascribed
- * @see Runnable
- * @see Runtime#exit(int)
- * @see #run()
- * @see #stop()
- * @since JDK1.0
- */
-public
-class Thread implements Runnable {
- // [IKVM]
- static {
- // force the set/getContextClassLoader methods to be JIT compiled, because isCCLOverridden(Thread) depends on it
- // (we don't want to use RuntimeHelpers.PrepareMethod() because it requires full trust)
- Thread dummy = new Thread((Void)null);
- dummy.getContextClassLoader();
- dummy.setContextClassLoader(ClassLoader.DUMMY);
- }
- private Thread(Void _) {
- // body replaced in map.xml
- }
- final class Cleanup {
- private final Thread thread;
-
- Cleanup(Thread thread) {
- this.thread = thread;
- }
-
- protected void finalize() {
- thread.die();
- }
- }
- /* --- start IKVM specific state --- */
- static final int[] nonDaemonCount = new int[1];
- @cli.System.ThreadStaticAttribute.Annotation
- static Thread current;
- @cli.System.ThreadStaticAttribute.Annotation
- private static Cleanup cleanup;
- private final Object lock = new Object();
- private cli.System.Threading.Thread nativeThread;
- private Throwable stillborn;
- private boolean running; // used only for coordination with stop0(), is never set to false
- private volatile boolean interruptPending;
- private volatile boolean nativeInterruptPending;
- private volatile boolean interruptableWait;
- private boolean timedWait;
- volatile Object parkLock; // used by get/setParkLock in map.xml
- int parkState; // used by cmpxchgParkState in map.xml
- /* --- end IKVM specific state --- */
-
- private char name[];
- private int priority;
- private Thread threadQ;
- private long eetop;
-
- /* Whether or not to single_step this thread. */
- private boolean single_step;
-
- /* Whether or not the thread is a daemon thread. */
- private boolean daemon = false;
-
- /* What will be run. */
- private Runnable target;
-
- /* The group of this thread */
- private ThreadGroup group;
-
- /* The context ClassLoader for this thread */
- private volatile ClassLoader contextClassLoader;
-
- /* The inherited AccessControlContext of this thread */
- AccessController.LazyContext lazyInheritedAccessControlContext;
-
- /* For autonumbering anonymous threads. */
- private static int threadInitNumber;
- private static synchronized int nextThreadNum() {
- return threadInitNumber++;
- }
-
- /* ThreadLocal values pertaining to this thread. This map is maintained
- * by the ThreadLocal class. */
- ThreadLocal.ThreadLocalMap threadLocals = null;
-
- /*
- * InheritableThreadLocal values pertaining to this thread. This map is
- * maintained by the InheritableThreadLocal class.
- */
- ThreadLocal.ThreadLocalMap inheritableThreadLocals = null;
-
- /*
- * The requested stack size for this thread, or 0 if the creator did
- * not specify a stack size. It is up to the VM to do whatever it
- * likes with this number; some VMs will ignore it.
- */
- private long stackSize;
-
- /*
- * JVM-private state that persists after native thread termination.
- */
- private long nativeParkEventPointer;
-
- /*
- * Thread ID
- */
- private long tid;
-
- /* For generating thread ID */
- private static long threadSeqNumber;
-
- /* Java thread status for tools,
- * initialized to indicate thread 'not yet started'
- */
-
- private volatile int threadStatus = 0;
-
-
- private static synchronized long nextThreadID() {
- return ++threadSeqNumber;
- }
-
- /**
- * The argument supplied to the current call to
- * java.util.concurrent.locks.LockSupport.park.
- * Set by (private) java.util.concurrent.locks.LockSupport.setBlocker
- * Accessed using java.util.concurrent.locks.LockSupport.getBlocker
- */
- volatile Object parkBlocker;
-
- /* The object in which this thread is blocked in an interruptible I/O
- * operation, if any. The blocker's interrupt method should be invoked
- * after setting this thread's interrupt status.
- */
- private volatile Interruptible blocker;
- private final Object blockerLock = new Object();
-
- /* Set the blocker field; invoked via sun.misc.SharedSecrets from java.nio code
- */
- void blockedOn(Interruptible b) {
- synchronized (blockerLock) {
- blocker = b;
- }
- }
-
- /**
- * The minimum priority that a thread can have.
- */
- public final static int MIN_PRIORITY = 1;
-
- /**
- * The default priority that is assigned to a thread.
- */
- public final static int NORM_PRIORITY = 5;
-
- /**
- * The maximum priority that a thread can have.
- */
- public final static int MAX_PRIORITY = 10;
-
- /**
- * Returns a reference to the currently executing thread object.
- *
- * @return the currently executing thread.
- */
- public static Thread currentThread() {
- Thread c = current;
- if (c == null) {
- c = new Thread(getMainThreadGroup());
- }
- return c;
- }
-
- private static native ThreadGroup getMainThreadGroup();
-
- /**
- * A hint to the scheduler that the current thread is willing to yield
- * its current use of a processor. The scheduler is free to ignore this
- * hint.
- *
- *
Yield is a heuristic attempt to improve relative progression
- * between threads that would otherwise over-utilise a CPU. Its use
- * should be combined with detailed profiling and benchmarking to
- * ensure that it actually has the desired effect.
- *
- *
It is rarely appropriate to use this method. It may be useful
- * for debugging or testing purposes, where it may help to reproduce
- * bugs due to race conditions. It may also be useful when designing
- * concurrency control constructs such as the ones in the
- * {@link java.util.concurrent.locks} package.
- */
- public static void yield() {
- cli.System.Threading.Thread.Sleep(0);
- }
-
- private void enterInterruptableWait(boolean timedWait) throws InterruptedException {
- synchronized (lock) {
- if (interruptPending) {
- interruptPending = false;
- throw new InterruptedException();
- }
- interruptableWait = true;
- this.timedWait = timedWait;
- }
- }
-
- private void leaveInterruptableWait() throws InterruptedException {
- cli.System.Threading.ThreadInterruptedException dotnetInterrupt = null;
- interruptableWait = false;
- for (; ; ) {
- try {
- if (false) throw new cli.System.Threading.ThreadInterruptedException();
- synchronized (lock) {
- if (nativeInterruptPending) {
- nativeInterruptPending = false;
- // HACK if there is a pending Interrupt (on the .NET thread), we need to consume that
- // (if there was no contention on "lock (this)" above the interrupted state isn't checked)
- try {
- if (false) throw new cli.System.Threading.ThreadInterruptedException();
- cli.System.Threading.Thread t = cli.System.Threading.Thread.get_CurrentThread();
- // the obvious thing to do would be t.Interrupt() / t.Join(),
- // but for some reason that causes a regression in JSR166TestCase (probably a CLR bug)
- // so we waste a time slice... sigh.
- t.Join(1);
- }
- catch (cli.System.Threading.ThreadInterruptedException _) {
- }
- }
- if (interruptPending) {
- interruptPending = false;
- throw new InterruptedException();
- }
- }
- break;
- }
- catch (cli.System.Threading.ThreadInterruptedException x) {
- dotnetInterrupt = x;
- nativeInterruptPending = false;
- }
- }
- if (dotnetInterrupt != null) {
- ikvm.runtime.Util.throwException(dotnetInterrupt);
- }
- }
-
- /**
- * Causes the currently executing thread to sleep (temporarily cease
- * execution) for the specified number of milliseconds, subject to
- * the precision and accuracy of system timers and schedulers. The thread
- * does not lose ownership of any monitors.
- *
- * @param millis
- * the length of time to sleep in milliseconds
- *
- * @throws IllegalArgumentException
- * if the value of {@code millis} is negative
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The
- * interrupted status of the current thread is
- * cleared when this exception is thrown.
- */
- public static void sleep(long millis) throws InterruptedException {
- if (millis < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
- Thread c = currentThread();
- c.enterInterruptableWait(true);
- try {
- if (false) throw new cli.System.Threading.ThreadInterruptedException();
- for (long iter = millis / Integer.MAX_VALUE; iter != 0; iter--)
- {
- cli.System.Threading.Thread.Sleep(Integer.MAX_VALUE);
- }
- cli.System.Threading.Thread.Sleep((int)(millis % Integer.MAX_VALUE));
- }
- catch (cli.System.Threading.ThreadInterruptedException _) {
- }
- finally {
- c.leaveInterruptableWait();
- }
- }
-
- /**
- * Causes the currently executing thread to sleep (temporarily cease
- * execution) for the specified number of milliseconds plus the specified
- * number of nanoseconds, subject to the precision and accuracy of system
- * timers and schedulers. The thread does not lose ownership of any
- * monitors.
- *
- * @param millis
- * the length of time to sleep in milliseconds
- *
- * @param nanos
- * {@code 0-999999} additional nanoseconds to sleep
- *
- * @throws IllegalArgumentException
- * if the value of {@code millis} is negative, or the value of
- * {@code nanos} is not in the range {@code 0-999999}
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The
- * interrupted status of the current thread is
- * cleared when this exception is thrown.
- */
- public static void sleep(long millis, int nanos)
- throws InterruptedException {
- if (millis < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
-
- if (nanos < 0 || nanos > 999999) {
- throw new IllegalArgumentException(
- "nanosecond timeout value out of range");
- }
-
- if (nanos >= 500000 || (nanos != 0 && millis == 0)) {
- millis++;
- }
-
- sleep(millis);
- }
-
- /**
- * Initializes a Thread.
- *
- * @param g the Thread group
- * @param target the object whose run() method gets called
- * @param name the name of the new Thread
- * @param stackSize the desired stack size for the new thread, or
- * zero to indicate that this parameter is to be ignored.
- */
- private void init(ThreadGroup g, Runnable target, String name,
- long stackSize) {
- if (name == null) {
- throw new NullPointerException("name cannot be null");
- }
-
- Thread parent = currentThread();
- SecurityManager security = System.getSecurityManager();
- if (g == null) {
- /* Determine if it's an applet or not */
-
- /* If there is a security manager, ask the security manager
- what to do. */
- if (security != null) {
- g = security.getThreadGroup();
- }
-
- /* If the security doesn't have a strong opinion of the matter
- use the parent thread group. */
- if (g == null) {
- g = parent.getThreadGroup();
- }
- }
-
- /* checkAccess regardless of whether or not threadgroup is
- explicitly passed in. */
- g.checkAccess();
-
- /*
- * Do we have the required permissions?
- */
- if (security != null) {
- if (isCCLOverridden(this)) {
- security.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
- }
- }
-
-
- g.addUnstarted();
-
- this.group = g;
- this.daemon = parent.isDaemon();
- this.priority = parent.getPriority();
- this.name = name.toCharArray();
- if (isCCLOverridden(parent))
- this.contextClassLoader = parent.getContextClassLoader();
- else
- this.contextClassLoader = parent.contextClassLoader;
- this.lazyInheritedAccessControlContext = AccessController.getLazyContext(parent.lazyInheritedAccessControlContext);
- this.target = target;
- setPriority(priority);
- if (parent.inheritableThreadLocals != null)
- this.inheritableThreadLocals =
- ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
- /* Stash the specified stack size in case the VM cares */
- this.stackSize = stackSize;
-
- /* Set thread ID */
- tid = nextThreadID();
- }
-
- // [IKVM] constructor for attaching to a .NET thread
- Thread(ThreadGroup g) {
- this.running = true;
- cli.System.Threading.Thread thread = cli.System.Threading.Thread.get_CurrentThread();
- nativeThread = thread;
- String name = thread.get_Name();
- if (name == null) {
- name = "Thread-" + nextThreadNum();
- }
-
- this.group = g;
- this.daemon = thread.get_IsBackground();
- this.priority = mapClrPriorityToJava(thread.get_Priority().Value);
- this.name = name.toCharArray();
- this.contextClassLoader = ClassLoader.DUMMY;
- this.threadStatus = 0x0005; /* JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE */
-
- /* Set thread ID */
- tid = nextThreadID();
-
- synchronized (g) {
- g.addUnstarted();
- g.add(this);
- }
-
- current = this;
- cleanup = new Cleanup(this);
-
- if (!daemon) {
- cli.System.Threading.Interlocked.Increment(nonDaemonCount);
- }
- }
-
- private static int mapClrPriorityToJava(int priority) {
- // TODO consider supporting -XX:JavaPriorityX_To_OSPriority settings
- switch (priority) {
- case cli.System.Threading.ThreadPriority.Lowest:
- return MIN_PRIORITY;
- case cli.System.Threading.ThreadPriority.BelowNormal:
- return 3;
- default:
- case cli.System.Threading.ThreadPriority.Normal:
- return NORM_PRIORITY;
- case cli.System.Threading.ThreadPriority.AboveNormal:
- return 7;
- case cli.System.Threading.ThreadPriority.Highest:
- return MAX_PRIORITY;
- }
- }
-
- private static int mapJavaPriorityToClr(int priority) {
- // TODO consider supporting -XX:JavaPriorityX_To_OSPriority settings
- if (priority == MIN_PRIORITY) {
- return cli.System.Threading.ThreadPriority.Lowest;
- }
- else if (priority > Thread.MIN_PRIORITY && priority < Thread.NORM_PRIORITY) {
- return cli.System.Threading.ThreadPriority.BelowNormal;
- }
- else if (priority == Thread.NORM_PRIORITY) {
- return cli.System.Threading.ThreadPriority.Normal;
- }
- else if (priority > Thread.NORM_PRIORITY && priority < Thread.MAX_PRIORITY) {
- return cli.System.Threading.ThreadPriority.AboveNormal;
- }
- else if (priority == Thread.MAX_PRIORITY) {
- return cli.System.Threading.ThreadPriority.Highest;
- }
- else {
- // can't happen
- return cli.System.Threading.ThreadPriority.Normal;
- }
- }
-
- /**
- * Throws CloneNotSupportedException as a Thread can not be meaningfully
- * cloned. Construct a new Thread instead.
- *
- * @throws CloneNotSupportedException
- * always
- */
- @Override
- protected Object clone() throws CloneNotSupportedException {
- throw new CloneNotSupportedException();
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (null, null, gname)}, where {@code gname} is a newly generated
- * name. Automatically generated names are of the form
- * {@code "Thread-"+}n, where n is an integer.
- */
- public Thread() {
- init(null, null, "Thread-" + nextThreadNum(), 0);
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (null, target, gname)}, where {@code gname} is a newly generated
- * name. Automatically generated names are of the form
- * {@code "Thread-"+}n, where n is an integer.
- *
- * @param target
- * the object whose {@code run} method is invoked when this thread
- * is started. If {@code null}, this classes {@code run} method does
- * nothing.
- */
- public Thread(Runnable target) {
- init(null, target, "Thread-" + nextThreadNum(), 0);
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (group, target, gname)} ,where {@code gname} is a newly generated
- * name. Automatically generated names are of the form
- * {@code "Thread-"+}n, where n is an integer.
- *
- * @param group
- * the thread group. If {@code null} and there is a security
- * manager, the group is determined by {@linkplain
- * SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
- * If there is not a security manager or {@code
- * SecurityManager.getThreadGroup()} returns {@code null}, the group
- * is set to the current thread's thread group.
- *
- * @param target
- * the object whose {@code run} method is invoked when this thread
- * is started. If {@code null}, this thread's run method is invoked.
- *
- * @throws SecurityException
- * if the current thread cannot create a thread in the specified
- * thread group
- */
- public Thread(ThreadGroup group, Runnable target) {
- init(group, target, "Thread-" + nextThreadNum(), 0);
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (null, null, name)}.
- *
- * @param name
- * the name of the new thread
- */
- public Thread(String name) {
- init(null, null, name, 0);
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (group, null, name)}.
- *
- * @param group
- * the thread group. If {@code null} and there is a security
- * manager, the group is determined by {@linkplain
- * SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
- * If there is not a security manager or {@code
- * SecurityManager.getThreadGroup()} returns {@code null}, the group
- * is set to the current thread's thread group.
- *
- * @param name
- * the name of the new thread
- *
- * @throws SecurityException
- * if the current thread cannot create a thread in the specified
- * thread group
- */
- public Thread(ThreadGroup group, String name) {
- init(group, null, name, 0);
- }
-
- /**
- * Allocates a new {@code Thread} object. This constructor has the same
- * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread}
- * {@code (null, target, name)}.
- *
- * @param target
- * the object whose {@code run} method is invoked when this thread
- * is started. If {@code null}, this thread's run method is invoked.
- *
- * @param name
- * the name of the new thread
- */
- public Thread(Runnable target, String name) {
- init(null, target, name, 0);
- }
-
- /**
- * Allocates a new {@code Thread} object so that it has {@code target}
- * as its run object, has the specified {@code name} as its name,
- * and belongs to the thread group referred to by {@code group}.
- *
- *
If there is a security manager, its
- * {@link SecurityManager#checkAccess(ThreadGroup) checkAccess}
- * method is invoked with the ThreadGroup as its argument.
- *
- *
In addition, its {@code checkPermission} method is invoked with
- * the {@code RuntimePermission("enableContextClassLoaderOverride")}
- * permission when invoked directly or indirectly by the constructor
- * of a subclass which overrides the {@code getContextClassLoader}
- * or {@code setContextClassLoader} methods.
- *
- *
The priority of the newly created thread is set equal to the
- * priority of the thread creating it, that is, the currently running
- * thread. The method {@linkplain #setPriority setPriority} may be
- * used to change the priority to a new value.
- *
- *
The newly created thread is initially marked as being a daemon
- * thread if and only if the thread creating it is currently marked
- * as a daemon thread. The method {@linkplain #setDaemon setDaemon}
- * may be used to change whether or not a thread is a daemon.
- *
- * @param group
- * the thread group. If {@code null} and there is a security
- * manager, the group is determined by {@linkplain
- * SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
- * If there is not a security manager or {@code
- * SecurityManager.getThreadGroup()} returns {@code null}, the group
- * is set to the current thread's thread group.
- *
- * @param target
- * the object whose {@code run} method is invoked when this thread
- * is started. If {@code null}, this thread's run method is invoked.
- *
- * @param name
- * the name of the new thread
- *
- * @throws SecurityException
- * if the current thread cannot create a thread in the specified
- * thread group or cannot override the context class loader methods.
- */
- public Thread(ThreadGroup group, Runnable target, String name) {
- init(group, target, name, 0);
- }
-
- /**
- * Allocates a new {@code Thread} object so that it has {@code target}
- * as its run object, has the specified {@code name} as its name,
- * and belongs to the thread group referred to by {@code group}, and has
- * the specified stack size.
- *
- *
This constructor is identical to {@link
- * #Thread(ThreadGroup,Runnable,String)} with the exception of the fact
- * that it allows the thread stack size to be specified. The stack size
- * is the approximate number of bytes of address space that the virtual
- * machine is to allocate for this thread's stack. The effect of the
- * {@code stackSize} parameter, if any, is highly platform dependent.
- *
- *
On some platforms, specifying a higher value for the
- * {@code stackSize} parameter may allow a thread to achieve greater
- * recursion depth before throwing a {@link StackOverflowError}.
- * Similarly, specifying a lower value may allow a greater number of
- * threads to exist concurrently without throwing an {@link
- * OutOfMemoryError} (or other internal error). The details of
- * the relationship between the value of the stackSize parameter
- * and the maximum recursion depth and concurrency level are
- * platform-dependent. On some platforms, the value of the
- * {@code stackSize} parameter may have no effect whatsoever.
- *
- *
The virtual machine is free to treat the {@code stackSize}
- * parameter as a suggestion. If the specified value is unreasonably low
- * for the platform, the virtual machine may instead use some
- * platform-specific minimum value; if the specified value is unreasonably
- * high, the virtual machine may instead use some platform-specific
- * maximum. Likewise, the virtual machine is free to round the specified
- * value up or down as it sees fit (or to ignore it completely).
- *
- *
Specifying a value of zero for the {@code stackSize} parameter will
- * cause this constructor to behave exactly like the
- * {@code Thread(ThreadGroup, Runnable, String)} constructor.
- *
- *
Due to the platform-dependent nature of the behavior of this
- * constructor, extreme care should be exercised in its use.
- * The thread stack size necessary to perform a given computation will
- * likely vary from one JRE implementation to another. In light of this
- * variation, careful tuning of the stack size parameter may be required,
- * and the tuning may need to be repeated for each JRE implementation on
- * which an application is to run.
- *
- *
Implementation note: Java platform implementers are encouraged to
- * document their implementation's behavior with respect to the
- * {@code stackSize} parameter.
- *
- *
- * @param group
- * the thread group. If {@code null} and there is a security
- * manager, the group is determined by {@linkplain
- * SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
- * If there is not a security manager or {@code
- * SecurityManager.getThreadGroup()} returns {@code null}, the group
- * is set to the current thread's thread group.
- *
- * @param target
- * the object whose {@code run} method is invoked when this thread
- * is started. If {@code null}, this thread's run method is invoked.
- *
- * @param name
- * the name of the new thread
- *
- * @param stackSize
- * the desired stack size for the new thread, or zero to indicate
- * that this parameter is to be ignored.
- *
- * @throws SecurityException
- * if the current thread cannot create a thread in the specified
- * thread group
- *
- * @since 1.4
- */
- public Thread(ThreadGroup group, Runnable target, String name,
- long stackSize) {
- init(group, target, name, stackSize);
- }
-
- /**
- * Causes this thread to begin execution; the Java Virtual Machine
- * calls the run method of this thread.
- *
- * The result is that two threads are running concurrently: the
- * current thread (which returns from the call to the
- * start method) and the other thread (which executes its
- * run method).
- *
- * It is never legal to start a thread more than once.
- * In particular, a thread may not be restarted once it has completed
- * execution.
- *
- * @exception IllegalThreadStateException if the thread was already
- * started.
- * @see #run()
- * @see #stop()
- */
- public synchronized void start() {
- /**
- * This method is not invoked for the main method thread or "system"
- * group threads created/set up by the VM. Any new functionality added
- * to this method in the future may have to also be added to the VM.
- *
- * A zero status value corresponds to state "NEW".
- */
- if (threadStatus != 0)
- throw new IllegalThreadStateException();
-
- /* Notify the group that this thread is about to be started
- * so that it can be added to the group's list of threads
- * and the group's unstarted count can be decremented. */
- group.add(this);
-
- boolean started = false;
- try {
- start0();
- started = true;
- } finally {
- try {
- if (!started) {
- group.threadStartFailed(this);
- }
- } catch (Throwable ignore) {
- /* do nothing. If start0 threw a Throwable then
- it will be passed up the call stack */
- }
- }
- }
-
- private void start0() {
- cli.System.Threading.ThreadStart threadStart = new cli.System.Threading.ThreadStart(new cli.System.Threading.ThreadStart.Method() {
- @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation
- public void Invoke() {
- threadProc();
- }
- });
- if (stackSize <= 0) {
- nativeThread = new cli.System.Threading.Thread(threadStart);
- }
- else {
- int maxStackSize = (int)Math.min(Math.max(128 * 1024, stackSize), Integer.MAX_VALUE);
- nativeThread = new cli.System.Threading.Thread(threadStart, maxStackSize);
- }
- nativeThread.set_Name(getName());
- nativeThread.set_IsBackground(daemon);
- nativeThread.set_Priority(cli.System.Threading.ThreadPriority.wrap(mapJavaPriorityToClr(priority)));
- String apartment = Props.props.getProperty("ikvm.apartmentstate", "").toLowerCase();
- if ("mta".equals(apartment)) {
- nativeThread.SetApartmentState(cli.System.Threading.ApartmentState.wrap(cli.System.Threading.ApartmentState.MTA));
- }
- else if ("sta".equals(apartment)) {
- nativeThread.SetApartmentState(cli.System.Threading.ApartmentState.wrap(cli.System.Threading.ApartmentState.STA));
- }
- threadStatus = 0x0005; // JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE
- nativeThread.Start();
- if (!daemon) {
- cli.System.Threading.Interlocked.Increment(nonDaemonCount);
- }
- }
-
- /**
- * If this thread was constructed using a separate
- * Runnable run object, then that
- * Runnable object's run method is called;
- * otherwise, this method does nothing and returns.
- *
- * Subclasses of Thread should override this method.
- *
- * @see #start()
- * @see #stop()
- * @see #Thread(ThreadGroup, Runnable, String)
- */
- @Override
- public void run() {
- if (target != null) {
- target.run();
- }
- }
-
- // [IKVM] for threads started from Java, this method is called on the thread itself,
- // but for .NET threads it will be called by the finalizer of the Cleanup object.
- // NOTE there might be a race condition here (when the thread's Cleanup object
- // is finalized during AppDomain shutdown while the thread is also exiting on its own),
- // but that doesn't matter because Thread.exit() is safe to call multiple times.
- void die() {
- exit();
- synchronized (lock) {
- nativeThread = null;
- threadStatus = 0x0002; // JVMTI_THREAD_STATE_TERMINATED
- }
- wakeupJoinedThreads();
- if (!daemon) {
- // TODO there is a race condition in the non-daemon counting
- // (setDaemon() isn't synchronized so it may clear/set the daemon flag without the count being affected)
- cli.System.Threading.Interlocked.Decrement(nonDaemonCount);
- }
- if (current == this) {
- current = null;
- // check if we have a cleanup object, this happens if we attach and subsequently detach from JNI code
- if (cleanup != null) {
- cli.System.GC.SuppressFinalize(cleanup);
- cleanup = null;
- }
- }
- }
-
- private void wakeupJoinedThreads() {
- // HACK locking this here isn't ideal, because we might be invoked from
- // the Cleanup object's finalizer and some user code might own the lock and hence
- // block the finalizer thread.
- // A second scenario is that another thread is currently blocking inside stop()
- // (the Thread.Abort() call will block while we are running the finally block)
- // and that thread will own the lock on our thread object.
- boolean locked = false;
- try {
- locked = cli.System.Threading.Monitor.TryEnter(this);
- if (locked) {
- notifyAll();
- } else {
- // HACK schedule an asynchronous notification
- cli.System.Threading.ThreadPool.QueueUserWorkItem(
- new cli.System.Threading.WaitCallback(
- new cli.System.Threading.WaitCallback.Method() {
- public void Invoke(Object thread) {
- synchronized (thread) {
- thread.notifyAll();
- }
- }
- }), this);
- }
- }
- finally {
- if (locked)
- cli.System.Threading.Monitor.Exit(this);
- }
- }
-
- /**
- * This method is called by the system to give a Thread
- * a chance to clean up before it actually exits.
- */
- private void exit() {
- if (group != null) {
- group.threadTerminated(this);
- group = null;
- }
- /* Aggressively null out all reference fields: see bug 4006245 */
- target = null;
- /* Speed the release of some of these resources */
- threadLocals = null;
- inheritableThreadLocals = null;
- lazyInheritedAccessControlContext = null;
- blocker = null;
- uncaughtExceptionHandler = null;
- }
-
- /**
- * Forces the thread to stop executing.
- *
- * If there is a security manager installed, its checkAccess
- * method is called with this
- * as its argument. This may result in a
- * SecurityException being raised (in the current thread).
- *
- * If this thread is different from the current thread (that is, the current
- * thread is trying to stop a thread other than itself), the
- * security manager's checkPermission method (with a
- * RuntimePermission("stopThread") argument) is called in
- * addition.
- * Again, this may result in throwing a
- * SecurityException (in the current thread).
- *
- * The thread represented by this thread is forced to stop whatever
- * it is doing abnormally and to throw a newly created
- * ThreadDeath object as an exception.
- *
- * It is permitted to stop a thread that has not yet been started.
- * If the thread is eventually started, it immediately terminates.
- *
- * An application should not normally try to catch
- * ThreadDeath unless it must do some extraordinary
- * cleanup operation (note that the throwing of
- * ThreadDeath causes finally clauses of
- * try statements to be executed before the thread
- * officially dies). If a catch clause catches a
- * ThreadDeath object, it is important to rethrow the
- * object so that the thread actually dies.
- *
- * The top-level error handler that reacts to otherwise uncaught
- * exceptions does not print out a message or otherwise notify the
- * application if the uncaught exception is an instance of
- * ThreadDeath.
- *
- * @exception SecurityException if the current thread cannot
- * modify this thread.
- * @see #interrupt()
- * @see #checkAccess()
- * @see #run()
- * @see #start()
- * @see ThreadDeath
- * @see ThreadGroup#uncaughtException(Thread,Throwable)
- * @see SecurityManager#checkAccess(Thread)
- * @see SecurityManager#checkPermission
- * @deprecated This method is inherently unsafe. Stopping a thread with
- * Thread.stop causes it to unlock all of the monitors that it
- * has locked (as a natural consequence of the unchecked
- * ThreadDeath exception propagating up the stack). If
- * any of the objects previously protected by these monitors were in
- * an inconsistent state, the damaged objects become visible to
- * other threads, potentially resulting in arbitrary behavior. Many
- * uses of stop should be replaced by code that simply
- * modifies some variable to indicate that the target thread should
- * stop running. The target thread should check this variable
- * regularly, and return from its run method in an orderly fashion
- * if the variable indicates that it is to stop running. If the
- * target thread waits for long periods (on a condition variable,
- * for example), the interrupt method should be used to
- * interrupt the wait.
- * For more information, see
- * Why
- * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- */
- @Deprecated
- public final void stop() {
- stop(new ThreadDeath());
- }
-
- /**
- * Forces the thread to stop executing.
- *
- * If there is a security manager installed, the checkAccess
- * method of this thread is called, which may result in a
- * SecurityException being raised (in the current thread).
- *
- * If this thread is different from the current thread (that is, the current
- * thread is trying to stop a thread other than itself) or
- * obj is not an instance of ThreadDeath, the
- * security manager's checkPermission method (with the
- * RuntimePermission("stopThread") argument) is called in
- * addition.
- * Again, this may result in throwing a
- * SecurityException (in the current thread).
- *
- * If the argument obj is null, a
- * NullPointerException is thrown (in the current thread).
- *
- * The thread represented by this thread is forced to stop
- * whatever it is doing abnormally and to throw the
- * Throwable object obj as an exception. This
- * is an unusual action to take; normally, the stop method
- * that takes no arguments should be used.
- *
- * It is permitted to stop a thread that has not yet been started.
- * If the thread is eventually started, it immediately terminates.
- *
- * @param obj the Throwable object to be thrown.
- * @exception SecurityException if the current thread cannot modify
- * this thread.
- * @throws NullPointerException if obj is null.
- * @see #interrupt()
- * @see #checkAccess()
- * @see #run()
- * @see #start()
- * @see #stop()
- * @see SecurityManager#checkAccess(Thread)
- * @see SecurityManager#checkPermission
- * @deprecated This method is inherently unsafe. See {@link #stop()}
- * for details. An additional danger of this
- * method is that it may be used to generate exceptions that the
- * target thread is unprepared to handle (including checked
- * exceptions that the thread could not possibly throw, were it
- * not for this method).
- * For more information, see
- * Why
- * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- */
- @Deprecated
- public final synchronized void stop(Throwable obj) {
- if (obj == null)
- throw new NullPointerException();
-
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- checkAccess();
- if ((this != Thread.currentThread()) ||
- (!(obj instanceof ThreadDeath))) {
- security.checkPermission(SecurityConstants.STOP_THREAD_PERMISSION);
- }
- }
- // A zero status value corresponds to "NEW", it can't change to
- // not-NEW because we hold the lock.
- if (threadStatus != 0) {
- resume(); // Wake up thread if it was suspended; no-op otherwise
- }
-
- // The VM can handle all thread states
- stop0(obj);
- }
-
- /**
- * Interrupts this thread.
- *
- *
Unless the current thread is interrupting itself, which is
- * always permitted, the {@link #checkAccess() checkAccess} method
- * of this thread is invoked, which may cause a {@link
- * SecurityException} to be thrown.
- *
- *
If this thread is blocked in an invocation of the {@link
- * Object#wait() wait()}, {@link Object#wait(long) wait(long)}, or {@link
- * Object#wait(long, int) wait(long, int)} methods of the {@link Object}
- * class, or of the {@link #join()}, {@link #join(long)}, {@link
- * #join(long, int)}, {@link #sleep(long)}, or {@link #sleep(long, int)},
- * methods of this class, then its interrupt status will be cleared and it
- * will receive an {@link InterruptedException}.
- *
- *
If this thread is blocked in an I/O operation upon an {@link
- * java.nio.channels.InterruptibleChannel interruptible
- * channel} then the channel will be closed, the thread's interrupt
- * status will be set, and the thread will receive a {@link
- * java.nio.channels.ClosedByInterruptException}.
- *
- *
If this thread is blocked in a {@link java.nio.channels.Selector}
- * then the thread's interrupt status will be set and it will return
- * immediately from the selection operation, possibly with a non-zero
- * value, just as if the selector's {@link
- * java.nio.channels.Selector#wakeup wakeup} method were invoked.
- *
- *
If none of the previous conditions hold then this thread's interrupt
- * status will be set.
- *
- *
Interrupting a thread that is not alive need not have any effect.
- *
- * @throws SecurityException
- * if the current thread cannot modify this thread
- *
- * @revised 6.0
- * @spec JSR-51
- */
- public void interrupt() {
- if (this != Thread.currentThread())
- checkAccess();
-
- synchronized (blockerLock) {
- Interruptible b = blocker;
- if (b != null) {
- interrupt0(); // Just to set the interrupt flag
- b.interrupt(this);
- return;
- }
- }
- interrupt0();
- }
-
- /**
- * Tests whether the current thread has been interrupted. The
- * interrupted status of the thread is cleared by this method. In
- * other words, if this method were to be called twice in succession, the
- * second call would return false (unless the current thread were
- * interrupted again, after the first call had cleared its interrupted
- * status and before the second call had examined it).
- *
- *
A thread interruption ignored because a thread was not alive
- * at the time of the interrupt will be reflected by this method
- * returning false.
- *
- * @return true if the current thread has been interrupted;
- * false otherwise.
- * @see #isInterrupted()
- * @revised 6.0
- */
- public static boolean interrupted() {
- Thread current = currentThread();
- if (!current.interruptPending) {
- return false;
- }
- current.interruptPending = false;
- return true;
- }
-
- /**
- * Tests whether this thread has been interrupted. The interrupted
- * status of the thread is unaffected by this method.
- *
- *
A thread interruption ignored because a thread was not alive
- * at the time of the interrupt will be reflected by this method
- * returning false.
- *
- * @return true if this thread has been interrupted;
- * false otherwise.
- * @see #interrupted()
- * @revised 6.0
- */
- public boolean isInterrupted() {
- return interruptPending;
- }
-
- /**
- * Throws {@link NoSuchMethodError}.
- *
- * @deprecated This method was originally designed to destroy this
- * thread without any cleanup. Any monitors it held would have
- * remained locked. However, the method was never implemented.
- * If if were to be implemented, it would be deadlock-prone in
- * much the manner of {@link #suspend}. If the target thread held
- * a lock protecting a critical system resource when it was
- * destroyed, no thread could ever access this resource again.
- * If another thread ever attempted to lock this resource, deadlock
- * would result. Such deadlocks typically manifest themselves as
- * "frozen" processes. For more information, see
- *
- * Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- * @throws NoSuchMethodError always
- */
- @Deprecated
- public void destroy() {
- throw new NoSuchMethodError();
- }
-
- /**
- * Tests if this thread is alive. A thread is alive if it has
- * been started and has not yet died.
- *
- * @return true if this thread is alive;
- * false otherwise.
- */
- public final boolean isAlive() {
- return (threadStatus & 0x0001) != 0;
- }
-
- /**
- * Suspends this thread.
- *
- * First, the checkAccess method of this thread is called
- * with no arguments. This may result in throwing a
- * SecurityException (in the current thread).
- *
- * If the thread is alive, it is suspended and makes no further
- * progress unless and until it is resumed.
- *
- * @exception SecurityException if the current thread cannot modify
- * this thread.
- * @see #checkAccess
- * @deprecated This method has been deprecated, as it is
- * inherently deadlock-prone. If the target thread holds a lock on the
- * monitor protecting a critical system resource when it is suspended, no
- * thread can access this resource until the target thread is resumed. If
- * the thread that would resume the target thread attempts to lock this
- * monitor prior to calling resume, deadlock results. Such
- * deadlocks typically manifest themselves as "frozen" processes.
- * For more information, see
- * Why
- * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- */
- @Deprecated
- public final void suspend() {
- checkAccess();
- suspend0();
- }
-
- /**
- * Resumes a suspended thread.
- *
- * First, the checkAccess method of this thread is called
- * with no arguments. This may result in throwing a
- * SecurityException (in the current thread).
- *
- * If the thread is alive but suspended, it is resumed and is
- * permitted to make progress in its execution.
- *
- * @exception SecurityException if the current thread cannot modify this
- * thread.
- * @see #checkAccess
- * @see #suspend()
- * @deprecated This method exists solely for use with {@link #suspend},
- * which has been deprecated because it is deadlock-prone.
- * For more information, see
- * Why
- * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- */
- @Deprecated
- public final void resume() {
- checkAccess();
- resume0();
- }
-
- /**
- * Changes the priority of this thread.
- *
- * First the checkAccess method of this thread is called
- * with no arguments. This may result in throwing a
- * SecurityException.
- *
- * Otherwise, the priority of this thread is set to the smaller of
- * the specified newPriority and the maximum permitted
- * priority of the thread's thread group.
- *
- * @param newPriority priority to set this thread to
- * @exception IllegalArgumentException If the priority is not in the
- * range MIN_PRIORITY to
- * MAX_PRIORITY.
- * @exception SecurityException if the current thread cannot modify
- * this thread.
- * @see #getPriority
- * @see #checkAccess()
- * @see #getThreadGroup()
- * @see #MAX_PRIORITY
- * @see #MIN_PRIORITY
- * @see ThreadGroup#getMaxPriority()
- */
- public final void setPriority(int newPriority) {
- ThreadGroup g;
- checkAccess();
- if (newPriority > MAX_PRIORITY || newPriority < MIN_PRIORITY) {
- throw new IllegalArgumentException();
- }
- if((g = getThreadGroup()) != null) {
- if (newPriority > g.getMaxPriority()) {
- newPriority = g.getMaxPriority();
- }
- setPriority0(priority = newPriority);
- }
- }
-
- /**
- * Returns this thread's priority.
- *
- * @return this thread's priority.
- * @see #setPriority
- */
- public final int getPriority() {
- return priority;
- }
-
- /**
- * Changes the name of this thread to be equal to the argument
- * name.
- *
- * First the checkAccess method of this thread is called
- * with no arguments. This may result in throwing a
- * SecurityException.
- *
- * @param name the new name for this thread.
- * @exception SecurityException if the current thread cannot modify this
- * thread.
- * @see #getName
- * @see #checkAccess()
- */
- public final void setName(String name) {
- checkAccess();
- this.name = name.toCharArray();
- }
-
- /**
- * Returns this thread's name.
- *
- * @return this thread's name.
- * @see #setName(String)
- */
- public final String getName() {
- return String.valueOf(name);
- }
-
- /**
- * Returns the thread group to which this thread belongs.
- * This method returns null if this thread has died
- * (been stopped).
- *
- * @return this thread's thread group.
- */
- public final ThreadGroup getThreadGroup() {
- return group;
- }
-
- /**
- * Returns an estimate of the number of active threads in the current
- * thread's {@linkplain java.lang.ThreadGroup thread group} and its
- * subgroups. Recursively iterates over all subgroups in the current
- * thread's thread group.
- *
- *
The value returned is only an estimate because the number of
- * threads may change dynamically while this method traverses internal
- * data structures, and might be affected by the presence of certain
- * system threads. This method is intended primarily for debugging
- * and monitoring purposes.
- *
- * @return an estimate of the number of active threads in the current
- * thread's thread group and in any other thread group that
- * has the current thread's thread group as an ancestor
- */
- public static int activeCount() {
- return currentThread().getThreadGroup().activeCount();
- }
-
- /**
- * Copies into the specified array every active thread in the current
- * thread's thread group and its subgroups. This method simply
- * invokes the {@link java.lang.ThreadGroup#enumerate(Thread[])}
- * method of the current thread's thread group.
- *
- *
An application might use the {@linkplain #activeCount activeCount}
- * method to get an estimate of how big the array should be, however
- * if the array is too short to hold all the threads, the extra threads
- * are silently ignored. If it is critical to obtain every active
- * thread in the current thread's thread group and its subgroups, the
- * invoker should verify that the returned int value is strictly less
- * than the length of {@code tarray}.
- *
- *
Due to the inherent race condition in this method, it is recommended
- * that the method only be used for debugging and monitoring purposes.
- *
- * @param tarray
- * an array into which to put the list of threads
- *
- * @return the number of threads put into the array
- *
- * @throws SecurityException
- * if {@link java.lang.ThreadGroup#checkAccess} determines that
- * the current thread cannot access its thread group
- */
- public static int enumerate(Thread tarray[]) {
- return currentThread().getThreadGroup().enumerate(tarray);
- }
-
- /**
- * Counts the number of stack frames in this thread. The thread must
- * be suspended.
- *
- * @return the number of stack frames in this thread.
- * @exception IllegalThreadStateException if this thread is not
- * suspended.
- * @deprecated The definition of this call depends on {@link #suspend},
- * which is deprecated. Further, the results of this call
- * were never well-defined.
- */
- @Deprecated
- public int countStackFrames() {
- return 0;
- }
-
- /**
- * Waits at most {@code millis} milliseconds for this thread to
- * die. A timeout of {@code 0} means to wait forever.
- *
- *
This implementation uses a loop of {@code this.wait} calls
- * conditioned on {@code this.isAlive}. As a thread terminates the
- * {@code this.notifyAll} method is invoked. It is recommended that
- * applications not use {@code wait}, {@code notify}, or
- * {@code notifyAll} on {@code Thread} instances.
- *
- * @param millis
- * the time to wait in milliseconds
- *
- * @throws IllegalArgumentException
- * if the value of {@code millis} is negative
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The
- * interrupted status of the current thread is
- * cleared when this exception is thrown.
- */
- public final synchronized void join(long millis)
- throws InterruptedException {
- long base = System.currentTimeMillis();
- long now = 0;
-
- if (millis < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
-
- if (millis == 0) {
- while (isAlive()) {
- wait(0);
- }
- } else {
- while (isAlive()) {
- long delay = millis - now;
- if (delay <= 0) {
- break;
- }
- wait(delay);
- now = System.currentTimeMillis() - base;
- }
- }
- }
-
- /**
- * Waits at most {@code millis} milliseconds plus
- * {@code nanos} nanoseconds for this thread to die.
- *
- *
This implementation uses a loop of {@code this.wait} calls
- * conditioned on {@code this.isAlive}. As a thread terminates the
- * {@code this.notifyAll} method is invoked. It is recommended that
- * applications not use {@code wait}, {@code notify}, or
- * {@code notifyAll} on {@code Thread} instances.
- *
- * @param millis
- * the time to wait in milliseconds
- *
- * @param nanos
- * {@code 0-999999} additional nanoseconds to wait
- *
- * @throws IllegalArgumentException
- * if the value of {@code millis} is negative, or the value
- * of {@code nanos} is not in the range {@code 0-999999}
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The
- * interrupted status of the current thread is
- * cleared when this exception is thrown.
- */
- public final synchronized void join(long millis, int nanos)
- throws InterruptedException {
-
- if (millis < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
-
- if (nanos < 0 || nanos > 999999) {
- throw new IllegalArgumentException(
- "nanosecond timeout value out of range");
- }
-
- if (nanos >= 500000 || (nanos != 0 && millis == 0)) {
- millis++;
- }
-
- join(millis);
- }
-
- /**
- * Waits for this thread to die.
- *
- *
An invocation of this method behaves in exactly the same
- * way as the invocation
- *
- *
- * {@linkplain #join(long) join}{@code (0)}
- *
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The
- * interrupted status of the current thread is
- * cleared when this exception is thrown.
- */
- public final void join() throws InterruptedException {
- join(0);
- }
-
- /**
- * Prints a stack trace of the current thread to the standard error stream.
- * This method is used only for debugging.
- *
- * @see Throwable#printStackTrace()
- */
- public static void dumpStack() {
- new Exception("Stack trace").printStackTrace();
- }
-
- /**
- * Marks this thread as either a {@linkplain #isDaemon daemon} thread
- * or a user thread. The Java Virtual Machine exits when the only
- * threads running are all daemon threads.
- *
- *
This method must be invoked before the thread is started.
- *
- * @param on
- * if {@code true}, marks this thread as a daemon thread
- *
- * @throws IllegalThreadStateException
- * if this thread is {@linkplain #isAlive alive}
- *
- * @throws SecurityException
- * if {@link #checkAccess} determines that the current
- * thread cannot modify this thread
- */
- public final void setDaemon(boolean on) {
- checkAccess();
- if (isAlive()) {
- throw new IllegalThreadStateException();
- }
- daemon = on;
- }
-
- /**
- * Tests if this thread is a daemon thread.
- *
- * @return true if this thread is a daemon thread;
- * false otherwise.
- * @see #setDaemon(boolean)
- */
- public final boolean isDaemon() {
- return daemon;
- }
-
- /**
- * Determines if the currently running thread has permission to
- * modify this thread.
- *
- * If there is a security manager, its checkAccess method
- * is called with this thread as its argument. This may result in
- * throwing a SecurityException.
- *
- * @exception SecurityException if the current thread is not allowed to
- * access this thread.
- * @see SecurityManager#checkAccess(Thread)
- */
- public final void checkAccess() {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkAccess(this);
- }
- }
-
- /**
- * Returns a string representation of this thread, including the
- * thread's name, priority, and thread group.
- *
- * @return a string representation of this thread.
- */
- public String toString() {
- ThreadGroup group = getThreadGroup();
- if (group != null) {
- return "Thread[" + getName() + "," + getPriority() + "," +
- group.getName() + "]";
- } else {
- return "Thread[" + getName() + "," + getPriority() + "," +
- "" + "]";
- }
- }
-
- /**
- * Returns the context ClassLoader for this Thread. The context
- * ClassLoader is provided by the creator of the thread for use
- * by code running in this thread when loading classes and resources.
- * If not {@linkplain #setContextClassLoader set}, the default is the
- * ClassLoader context of the parent Thread. The context ClassLoader of the
- * primordial thread is typically set to the class loader used to load the
- * application.
- *
- *
If a security manager is present, and the invoker's class loader is not
- * {@code null} and is not the same as or an ancestor of the context class
- * loader, then this method invokes the security manager's {@link
- * SecurityManager#checkPermission(java.security.Permission) checkPermission}
- * method with a {@link RuntimePermission RuntimePermission}{@code
- * ("getClassLoader")} permission to verify that retrieval of the context
- * class loader is permitted.
- *
- * @return the context ClassLoader for this Thread, or {@code null}
- * indicating the system class loader (or, failing that, the
- * bootstrap class loader)
- *
- * @throws SecurityException
- * if the current thread cannot get the context ClassLoader
- *
- * @since 1.2
- */
- @CallerSensitive
- public ClassLoader getContextClassLoader() {
- if (contextClassLoader == ClassLoader.DUMMY) {
- contextClassLoader = ClassLoader.getSystemClassLoader();
- }
- if (contextClassLoader == null)
- return null;
-
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- ClassLoader.checkClassLoaderPermission(contextClassLoader,
- Reflection.getCallerClass());
- }
- return contextClassLoader;
- }
-
- /**
- * Sets the context ClassLoader for this Thread. The context
- * ClassLoader can be set when a thread is created, and allows
- * the creator of the thread to provide the appropriate class loader,
- * through {@code getContextClassLoader}, to code running in the thread
- * when loading classes and resources.
- *
- *
If a security manager is present, its {@link
- * SecurityManager#checkPermission(java.security.Permission) checkPermission}
- * method is invoked with a {@link RuntimePermission RuntimePermission}{@code
- * ("setContextClassLoader")} permission to see if setting the context
- * ClassLoader is permitted.
- *
- * @param cl
- * the context ClassLoader for this Thread, or null indicating the
- * system class loader (or, failing that, the bootstrap class loader)
- *
- * @throws SecurityException
- * if the current thread cannot set the context ClassLoader
- *
- * @since 1.2
- */
- public void setContextClassLoader(ClassLoader cl) {
- if (cl == ClassLoader.DUMMY) {
- // we're being called by Thread. to force this method to be JIT compiled
- return;
- }
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkPermission(new RuntimePermission("setContextClassLoader"));
- }
- contextClassLoader = cl;
- }
-
- // [IKVM] called by sun.misc.Launcher (via map.xml patch) to initialize the context class loader
- final void initContextClassLoader(ClassLoader cl) {
- // we only set contextClassLoader if it hasn't been set (by user code) previously
- java.util.concurrent.atomic.AtomicReferenceFieldUpdater
- .newUpdater(Thread.class, ClassLoader.class, "contextClassLoader")
- .compareAndSet(this, ClassLoader.DUMMY, cl);
- }
-
- /**
- * Returns true if and only if the current thread holds the
- * monitor lock on the specified object.
- *
- *
This method is designed to allow a program to assert that
- * the current thread already holds a specified lock:
- *
- * assert Thread.holdsLock(obj);
- *
- *
- * @param obj the object on which to test lock ownership
- * @throws NullPointerException if obj is null
- * @return true if the current thread holds the monitor lock on
- * the specified object.
- * @since 1.4
- */
- public static boolean holdsLock(Object obj) {
- if (obj == null) {
- throw new NullPointerException();
- }
- try {
- if (false) throw new cli.System.Threading.SynchronizationLockException();
- // The 1.5 memory model (JSR133) explicitly allows spurious wake-ups from Object.wait,
- // so we abuse Pulse to check if we own the monitor.
- cli.System.Threading.Monitor.Pulse(obj);
- return true;
- }
- catch (cli.System.Threading.SynchronizationLockException _) {
- return false;
- }
- }
-
- private static final StackTraceElement[] EMPTY_STACK_TRACE
- = new StackTraceElement[0];
-
- /**
- * Returns an array of stack trace elements representing the stack dump
- * of this thread. This method will return a zero-length array if
- * this thread has not started, has started but has not yet been
- * scheduled to run by the system, or has terminated.
- * If the returned array is of non-zero length then the first element of
- * the array represents the top of the stack, which is the most recent
- * method invocation in the sequence. The last element of the array
- * represents the bottom of the stack, which is the least recent method
- * invocation in the sequence.
- *
- *
If there is a security manager, and this thread is not
- * the current thread, then the security manager's
- * checkPermission method is called with a
- * RuntimePermission("getStackTrace") permission
- * to see if it's ok to get the stack trace.
- *
- *
Some virtual machines may, under some circumstances, omit one
- * or more stack frames from the stack trace. In the extreme case,
- * a virtual machine that has no stack trace information concerning
- * this thread is permitted to return a zero-length array from this
- * method.
- *
- * @return an array of StackTraceElement,
- * each represents one stack frame.
- *
- * @throws SecurityException
- * if a security manager exists and its
- * checkPermission method doesn't allow
- * getting the stack trace of thread.
- * @see SecurityManager#checkPermission
- * @see RuntimePermission
- * @see Throwable#getStackTrace
- *
- * @since 1.5
- */
- public StackTraceElement[] getStackTrace() {
- if (this != Thread.currentThread()) {
- // check for getStackTrace permission
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkPermission(
- SecurityConstants.GET_STACK_TRACE_PERMISSION);
- }
- // optimization so we do not call into the vm for threads that
- // have not yet started or have terminated
- if (!isAlive()) {
- return EMPTY_STACK_TRACE;
- }
- StackTraceElement[][] stackTraceArray = dumpThreads(new Thread[] {this});
- StackTraceElement[] stackTrace = stackTraceArray[0];
- // a thread that was alive during the previous isAlive call may have
- // since terminated, therefore not having a stacktrace.
- if (stackTrace == null) {
- stackTrace = EMPTY_STACK_TRACE;
- }
- return stackTrace;
- } else {
- // Don't need JVM help for current thread
- return (new Exception()).getStackTrace();
- }
- }
-
- /**
- * Returns a map of stack traces for all live threads.
- * The map keys are threads and each map value is an array of
- * StackTraceElement that represents the stack dump
- * of the corresponding Thread.
- * The returned stack traces are in the format specified for
- * the {@link #getStackTrace getStackTrace} method.
- *
- *
The threads may be executing while this method is called.
- * The stack trace of each thread only represents a snapshot and
- * each stack trace may be obtained at different time. A zero-length
- * array will be returned in the map value if the virtual machine has
- * no stack trace information about a thread.
- *
- *
If there is a security manager, then the security manager's
- * checkPermission method is called with a
- * RuntimePermission("getStackTrace") permission as well as
- * RuntimePermission("modifyThreadGroup") permission
- * to see if it is ok to get the stack trace of all threads.
- *
- * @return a Map from Thread to an array of
- * StackTraceElement that represents the stack trace of
- * the corresponding thread.
- *
- * @throws SecurityException
- * if a security manager exists and its
- * checkPermission method doesn't allow
- * getting the stack trace of thread.
- * @see #getStackTrace
- * @see SecurityManager#checkPermission
- * @see RuntimePermission
- * @see Throwable#getStackTrace
- *
- * @since 1.5
- */
- public static Map getAllStackTraces() {
- // check for getStackTrace permission
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkPermission(
- SecurityConstants.GET_STACK_TRACE_PERMISSION);
- security.checkPermission(
- SecurityConstants.MODIFY_THREADGROUP_PERMISSION);
- }
-
- // Get a snapshot of the list of all threads
- Thread[] threads = getThreads();
- StackTraceElement[][] traces = dumpThreads(threads);
- Map m = new HashMap<>(threads.length);
- for (int i = 0; i < threads.length; i++) {
- StackTraceElement[] stackTrace = traces[i];
- if (stackTrace != null) {
- m.put(threads[i], stackTrace);
- }
- // else terminated so we don't put it in the map
- }
- return m;
- }
-
-
- private static final RuntimePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
- new RuntimePermission("enableContextClassLoaderOverride");
-
- /** cache of subclass security audit results */
- /* Replace with ConcurrentReferenceHashMap when/if it appears in a future
- * release */
- private static class Caches {
- /** cache of subclass security audit results */
- static final ConcurrentMap subclassAudits =
- new ConcurrentHashMap<>();
-
- /** queue for WeakReferences to audited subclasses */
- static final ReferenceQueue> subclassAuditsQueue =
- new ReferenceQueue<>();
- }
-
- /**
- * Verifies that this (possibly subclass) instance can be constructed
- * without violating security constraints: the subclass must not override
- * security-sensitive non-final methods, or else the
- * "enableContextClassLoaderOverride" RuntimePermission is checked.
- */
- @cli.System.Runtime.CompilerServices.MethodImplAttribute.Annotation(value = cli.System.Runtime.CompilerServices.MethodImplOptions.__Enum.NoInlining)
- private static native boolean isCCLOverridden(Thread thread); // [IKVM] implemented in map.xml
-
- private static boolean isCCLOverridden(Class cl) {
- if (cl == Thread.class)
- return false;
-
- processQueue(Caches.subclassAuditsQueue, Caches.subclassAudits);
- WeakClassKey key = new WeakClassKey(cl, Caches.subclassAuditsQueue);
- Boolean result = Caches.subclassAudits.get(key);
- if (result == null) {
- result = Boolean.valueOf(auditSubclass(cl));
- Caches.subclassAudits.putIfAbsent(key, result);
- }
-
- return result.booleanValue();
- }
-
- /**
- * Performs reflective checks on given subclass to verify that it doesn't
- * override security-sensitive non-final methods. Returns true if the
- * subclass overrides any of the methods, false otherwise.
- */
- private static boolean auditSubclass(final Class subcl) {
- Boolean result = AccessController.doPrivileged(
- new PrivilegedAction() {
- public Boolean run() {
- for (Class cl = subcl;
- cl != Thread.class;
- cl = cl.getSuperclass())
- {
- try {
- cl.getDeclaredMethod("getContextClassLoader", new Class[0]);
- return Boolean.TRUE;
- } catch (NoSuchMethodException ex) {
- }
- try {
- Class[] params = {ClassLoader.class};
- cl.getDeclaredMethod("setContextClassLoader", params);
- return Boolean.TRUE;
- } catch (NoSuchMethodException ex) {
- }
- }
- return Boolean.FALSE;
- }
- }
- );
- return result.booleanValue();
- }
-
- private static StackTraceElement[][] dumpThreads(Thread[] threads) {
- StackTraceElement[][] stacks = new StackTraceElement[threads.length][];
- for (int i = 0; i < threads.length; i++) {
- cli.System.Threading.Thread nativeThread = threads[i].nativeThread;
- if (nativeThread == null) {
- stacks[i] = new StackTraceElement[0];
- } else {
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- boolean suspended = false;
- if ((nativeThread.get_ThreadState().Value & cli.System.Threading.ThreadState.Suspended) == 0 && nativeThread != cli.System.Threading.Thread.get_CurrentThread()) {
- suspended = true;
- nativeThread.Suspend();
- }
- cli.System.Diagnostics.StackTrace stack;
- try {
- stack = new cli.System.Diagnostics.StackTrace(nativeThread, true);
- }
- finally {
- if (suspended) {
- nativeThread.Resume();
- }
- }
- stacks[i] = getStackTrace(stack);
- }
- catch (cli.System.Threading.ThreadStateException _) {
- stacks[i] = new StackTraceElement[0];
- }
- }
- }
- return stacks;
- }
-
- private static native StackTraceElement[] getStackTrace(cli.System.Diagnostics.StackTrace stack);
-
- private static native Thread[] getThreads();
-
- /**
- * Returns the identifier of this Thread. The thread ID is a positive
- * long number generated when this thread was created.
- * The thread ID is unique and remains unchanged during its lifetime.
- * When a thread is terminated, this thread ID may be reused.
- *
- * @return this thread's ID.
- * @since 1.5
- */
- public long getId() {
- return tid;
- }
-
- /**
- * A thread state. A thread can be in one of the following states:
- *
- *
{@link #NEW}
- * A thread that has not yet started is in this state.
- *
- *
{@link #RUNNABLE}
- * A thread executing in the Java virtual machine is in this state.
- *
- *
{@link #BLOCKED}
- * A thread that is blocked waiting for a monitor lock
- * is in this state.
- *
- *
{@link #WAITING}
- * A thread that is waiting indefinitely for another thread to
- * perform a particular action is in this state.
- *
- *
{@link #TIMED_WAITING}
- * A thread that is waiting for another thread to perform an action
- * for up to a specified waiting time is in this state.
- *
- *
{@link #TERMINATED}
- * A thread that has exited is in this state.
- *
- *
- *
- *
- * A thread can be in only one state at a given point in time.
- * These states are virtual machine states which do not reflect
- * any operating system thread states.
- *
- * @since 1.5
- * @see #getState
- */
- public enum State {
- /**
- * Thread state for a thread which has not yet started.
- */
- NEW,
-
- /**
- * Thread state for a runnable thread. A thread in the runnable
- * state is executing in the Java virtual machine but it may
- * be waiting for other resources from the operating system
- * such as processor.
- */
- RUNNABLE,
-
- /**
- * Thread state for a thread blocked waiting for a monitor lock.
- * A thread in the blocked state is waiting for a monitor lock
- * to enter a synchronized block/method or
- * reenter a synchronized block/method after calling
- * {@link Object#wait() Object.wait}.
- */
- BLOCKED,
-
- /**
- * Thread state for a waiting thread.
- * A thread is in the waiting state due to calling one of the
- * following methods:
- *
- *
{@link Object#wait() Object.wait} with no timeout
- *
{@link #join() Thread.join} with no timeout
- *
{@link LockSupport#park() LockSupport.park}
- *
- *
- *
A thread in the waiting state is waiting for another thread to
- * perform a particular action.
- *
- * For example, a thread that has called Object.wait()
- * on an object is waiting for another thread to call
- * Object.notify() or Object.notifyAll() on
- * that object. A thread that has called Thread.join()
- * is waiting for a specified thread to terminate.
- */
- WAITING,
-
- /**
- * Thread state for a waiting thread with a specified waiting time.
- * A thread is in the timed waiting state due to calling one of
- * the following methods with a specified positive waiting time:
- *
- *
{@link #sleep Thread.sleep}
- *
{@link Object#wait(long) Object.wait} with timeout
- */
- TIMED_WAITING,
-
- /**
- * Thread state for a terminated thread.
- * The thread has completed execution.
- */
- TERMINATED;
- }
-
- /**
- * Returns the state of this thread.
- * This method is designed for use in monitoring of the system state,
- * not for synchronization control.
- *
- * @return this thread's state.
- * @since 1.5
- */
- public State getState() {
- // get current thread state
- switch (threadStatus) {
- case 0:
- return State.NEW;
- case 0x0002:
- return State.TERMINATED;
- }
- synchronized (lock) {
- if (interruptableWait) {
- // NOTE if objectWait has satisfied the wait condition (or has been interrupted or has timed-out),
- // it can be blocking on the re-acquire of the monitor, but we have no way of detecting that.
- return timedWait ? State.TIMED_WAITING : State.WAITING;
- }
- }
- cli.System.Threading.Thread nativeThread = this.nativeThread;
- if (nativeThread == null) {
- return State.TERMINATED;
- }
- if ((nativeThread.get_ThreadState().Value & cli.System.Threading.ThreadState.WaitSleepJoin) != 0) {
- return State.BLOCKED;
- }
- return State.RUNNABLE;
- }
-
- // Added in JSR-166
-
- /**
- * Interface for handlers invoked when a Thread abruptly
- * terminates due to an uncaught exception.
- *
When a thread is about to terminate due to an uncaught exception
- * the Java Virtual Machine will query the thread for its
- * UncaughtExceptionHandler using
- * {@link #getUncaughtExceptionHandler} and will invoke the handler's
- * uncaughtException method, passing the thread and the
- * exception as arguments.
- * If a thread has not had its UncaughtExceptionHandler
- * explicitly set, then its ThreadGroup object acts as its
- * UncaughtExceptionHandler. If the ThreadGroup object
- * has no
- * special requirements for dealing with the exception, it can forward
- * the invocation to the {@linkplain #getDefaultUncaughtExceptionHandler
- * default uncaught exception handler}.
- *
- * @see #setDefaultUncaughtExceptionHandler
- * @see #setUncaughtExceptionHandler
- * @see ThreadGroup#uncaughtException
- * @since 1.5
- */
- public interface UncaughtExceptionHandler {
- /**
- * Method invoked when the given thread terminates due to the
- * given uncaught exception.
- *
Any exception thrown by this method will be ignored by the
- * Java Virtual Machine.
- * @param t the thread
- * @param e the exception
- */
- void uncaughtException(Thread t, Throwable e);
- }
-
- // null unless explicitly set
- private volatile UncaughtExceptionHandler uncaughtExceptionHandler;
-
- // null unless explicitly set
- private static volatile UncaughtExceptionHandler defaultUncaughtExceptionHandler;
-
- /**
- * Set the default handler invoked when a thread abruptly terminates
- * due to an uncaught exception, and no other handler has been defined
- * for that thread.
- *
- *
Uncaught exception handling is controlled first by the thread, then
- * by the thread's {@link ThreadGroup} object and finally by the default
- * uncaught exception handler. If the thread does not have an explicit
- * uncaught exception handler set, and the thread's thread group
- * (including parent thread groups) does not specialize its
- * uncaughtException method, then the default handler's
- * uncaughtException method will be invoked.
- *
By setting the default uncaught exception handler, an application
- * can change the way in which uncaught exceptions are handled (such as
- * logging to a specific device, or file) for those threads that would
- * already accept whatever "default" behavior the system
- * provided.
- *
- *
Note that the default uncaught exception handler should not usually
- * defer to the thread's ThreadGroup object, as that could cause
- * infinite recursion.
- *
- * @param eh the object to use as the default uncaught exception handler.
- * If null then there is no default handler.
- *
- * @throws SecurityException if a security manager is present and it
- * denies {@link RuntimePermission}
- * ("setDefaultUncaughtExceptionHandler")
- *
- * @see #setUncaughtExceptionHandler
- * @see #getUncaughtExceptionHandler
- * @see ThreadGroup#uncaughtException
- * @since 1.5
- */
- public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh) {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkPermission(
- new RuntimePermission("setDefaultUncaughtExceptionHandler")
- );
- }
-
- defaultUncaughtExceptionHandler = eh;
- }
-
- /**
- * Returns the default handler invoked when a thread abruptly terminates
- * due to an uncaught exception. If the returned value is null,
- * there is no default.
- * @since 1.5
- * @see #setDefaultUncaughtExceptionHandler
- */
- public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
- return defaultUncaughtExceptionHandler;
- }
-
- /**
- * Returns the handler invoked when this thread abruptly terminates
- * due to an uncaught exception. If this thread has not had an
- * uncaught exception handler explicitly set then this thread's
- * ThreadGroup object is returned, unless this thread
- * has terminated, in which case null is returned.
- * @since 1.5
- */
- public UncaughtExceptionHandler getUncaughtExceptionHandler() {
- return uncaughtExceptionHandler != null ?
- uncaughtExceptionHandler : group;
- }
-
- /**
- * Set the handler invoked when this thread abruptly terminates
- * due to an uncaught exception.
- *
A thread can take full control of how it responds to uncaught
- * exceptions by having its uncaught exception handler explicitly set.
- * If no such handler is set then the thread's ThreadGroup
- * object acts as its handler.
- * @param eh the object to use as this thread's uncaught exception
- * handler. If null then this thread has no explicit handler.
- * @throws SecurityException if the current thread is not allowed to
- * modify this thread.
- * @see #setDefaultUncaughtExceptionHandler
- * @see ThreadGroup#uncaughtException
- * @since 1.5
- */
- public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh) {
- checkAccess();
- uncaughtExceptionHandler = eh;
- }
-
- /**
- * Dispatch an uncaught exception to the handler. This method is
- * intended to be called only by the JVM.
- */
- private void dispatchUncaughtException(Throwable e) {
- getUncaughtExceptionHandler().uncaughtException(this, e);
- }
-
- /**
- * Removes from the specified map any keys that have been enqueued
- * on the specified reference queue.
- */
- static void processQueue(ReferenceQueue> queue,
- ConcurrentMap extends
- WeakReference>, ?> map)
- {
- Reference extends Class>> ref;
- while((ref = queue.poll()) != null) {
- map.remove(ref);
- }
- }
-
- /**
- * Weak key for Class objects.
- **/
- static class WeakClassKey extends WeakReference> {
- /**
- * saved value of the referent's identity hash code, to maintain
- * a consistent hash code after the referent has been cleared
- */
- private final int hash;
-
- /**
- * Create a new WeakClassKey to the given object, registered
- * with a queue.
- */
- WeakClassKey(Class> cl, ReferenceQueue> refQueue) {
- super(cl, refQueue);
- hash = System.identityHashCode(cl);
- }
-
- /**
- * Returns the identity hash code of the original referent.
- */
- @Override
- public int hashCode() {
- return hash;
- }
-
- /**
- * Returns true if the given object is this identical
- * WeakClassKey instance, or, if this object's referent has not
- * been cleared, if the given object is another WeakClassKey
- * instance with the identical non-null referent as this one.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == this)
- return true;
-
- if (obj instanceof WeakClassKey) {
- Object referent = get();
- return (referent != null) &&
- (referent == ((WeakClassKey) obj).get());
- } else {
- return false;
- }
- }
- }
-
- /* Some private helper methods */
- private synchronized void setPriority0(int newPriority) {
- cli.System.Threading.Thread nativeThread = this.nativeThread;
- if (nativeThread != null) {
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- nativeThread.set_Priority(cli.System.Threading.ThreadPriority.wrap(mapJavaPriorityToClr(newPriority)));
- }
- catch (cli.System.Threading.ThreadStateException _) {
- }
- }
- }
-
- private void stop0(Throwable x) {
- synchronized (lock) {
- if (!running) {
- stillborn = x;
- x = null;
- }
- }
- if (x != null) {
- // NOTE we allow ThreadDeath (and its subclasses) to be thrown on every thread, but any
- // other exception is ignored, except if we're throwing it on the current Thread. This
- // is done to allow exception handlers to be type specific, otherwise every exception
- // handler would have to catch ThreadAbortException and look inside it to see if it
- // contains the real exception that we wish to handle.
- // I hope we can get away with this behavior, because Thread.stop() is deprecated
- // anyway. Note that we do allow arbitrary exceptions to be thrown on the current
- // thread, since this is harmless (because they aren't wrapped) and also because it
- // provides some real value, because it is one of the ways you can throw arbitrary checked
- // exceptions from Java.
- if (this == current) {
- sun.misc.Unsafe.getUnsafe().throwException(x);
- }
- else if (x instanceof ThreadDeath) {
- cli.System.Threading.Thread nativeThread = this.nativeThread;
- if (nativeThread == null) {
- return;
- }
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- nativeThread.Abort(x);
- }
- catch (cli.System.Threading.ThreadStateException _) {
- // .NET 2.0 throws a ThreadStateException if the target thread is currently suspended
- // (but it does record the Abort request)
- }
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- int suspend = cli.System.Threading.ThreadState.Suspended | cli.System.Threading.ThreadState.SuspendRequested;
- while ((nativeThread.get_ThreadState().Value & suspend) != 0) {
- nativeThread.Resume();
- }
- }
- catch (cli.System.Threading.ThreadStateException _) {
- }
- }
- }
- }
-
- private void suspend0() {
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- cli.System.Threading.Thread nativeThread = this.nativeThread;
- if (nativeThread != null) {
- nativeThread.Suspend();
- }
- }
- catch (cli.System.Threading.ThreadStateException _) {
- }
- }
-
- private void resume0() {
- try {
- if (false) throw new cli.System.Threading.ThreadStateException();
- cli.System.Threading.Thread nativeThread = this.nativeThread;
- if (nativeThread != null) {
- nativeThread.Resume();
- }
- }
- catch (cli.System.Threading.ThreadStateException _) {
- }
- }
-
- private void interrupt0() {
- synchronized (lock) {
- // if the thread hasn't been started yet or has been terminated, the interrupt is ignored
- // (like on the reference implementation)
- if (nativeThread == null) {
- return;
- }
- if (!interruptPending) {
- interruptPending = true;
- if (interruptableWait) {
- nativeInterruptPending = true;
- nativeThread.Interrupt();
- }
- }
- }
- }
-
- private void setRunningAndCheckStillborn() throws Throwable {
- Throwable x;
- synchronized (lock) {
- running = true;
- x = stillborn;
- stillborn = null;
- }
- if (x != null) {
- throw x;
- }
- }
-
- // [IKVM] this the entry point of thread started from Java
- @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation
- void threadProc() {
- current = this;
- try {
- // the body of the try block is in another method to allow the (limited) try/finally optimizer
- // to properly recognize the try/finally block, because we want to make sure that die()
- // runs in a finally block to prevent it from being asynchronously aborted.
- threadProc2();
- }
- finally {
- die();
- }
- }
-
- @cli.IKVM.Attributes.HideFromJavaAttribute.Annotation
- private void threadProc2() {
- try {
- setRunningAndCheckStillborn();
- run();
- }
- catch (Throwable x) {
- try {
- getUncaughtExceptionHandler().uncaughtException(this, x);
- }
- catch (Throwable _) {
- }
- }
- }
-
- // [IKVM] this the implementation of Object.wait(long timeout, int nanos). It is hooked up in map.xml.
- static void objectWait(Object o, long timeout, int nanos) throws InterruptedException {
- if (o == null) {
- throw new NullPointerException();
- }
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
- if (nanos < 0 || nanos > 999999) {
- throw new IllegalArgumentException("nanosecond timeout value out of range");
- }
- if (nanos >= 500000 || (nanos != 0 && timeout == 0)) {
- timeout++;
- }
- objectWait(o, timeout);
- }
-
- // [IKVM] this the implementation of Object.wait(long timeout). It is hooked up in map.xml.
- static void objectWait(Object o, long timeout) throws InterruptedException {
- if (o == null) {
- throw new NullPointerException();
- }
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout value is negative");
- }
- Thread t = currentThread();
- t.enterInterruptableWait(timeout != 0);
- try {
- if (false) throw new cli.System.Threading.ThreadInterruptedException();
- if (timeout == 0 || timeout > 922337203685476L) {
- cli.System.Threading.Monitor.Wait(o);
- }
- else {
- // We wait a maximum of Integer.MAX_VALUE milliseconds, because that is the maximum that Monitor.Wait will wait.
- // Note that the Object.wait() specification allows for spurious wakeups, so this isn't a problem. Trying to
- // emulate a longer wait with multiple Monitor.Wait() calls is not allowed, because that would mean that
- // we acquire and release the synchronization lock multiple times during the wait.
- cli.System.Threading.Monitor.Wait(o, (int)Math.min(timeout, Integer.MAX_VALUE));
- }
- }
- catch (cli.System.Threading.ThreadInterruptedException _) {
- }
- finally {
- t.leaveInterruptableWait();
- }
- }
-}
diff --git a/external/ikvm/openjdk/java/lang/Thread.java.REMOVED.git-id b/external/ikvm/openjdk/java/lang/Thread.java.REMOVED.git-id
new file mode 100644
index 0000000000..3685fc66ec
--- /dev/null
+++ b/external/ikvm/openjdk/java/lang/Thread.java.REMOVED.git-id
@@ -0,0 +1 @@
+7ab53c76bb97c702c39866643a2547962ef3ead6
\ No newline at end of file
diff --git a/external/ikvm/openjdk/map.xml.REMOVED.git-id b/external/ikvm/openjdk/map.xml.REMOVED.git-id
index b5b141299c..96001e9c28 100644
--- a/external/ikvm/openjdk/map.xml.REMOVED.git-id
+++ b/external/ikvm/openjdk/map.xml.REMOVED.git-id
@@ -1 +1 @@
-33393ac257cbddfb25bbbbef28c2d70a939dcc57
\ No newline at end of file
+df6a641f2325337bd9354a4d23537dc48a60d0ee
\ No newline at end of file
diff --git a/external/ikvm/openjdk/openjdk.build b/external/ikvm/openjdk/openjdk.build
index 37f23b2d57..41e2382e28 100644
--- a/external/ikvm/openjdk/openjdk.build
+++ b/external/ikvm/openjdk/openjdk.build
@@ -1,16 +1,42 @@
+
-
-
+
+
+
+
+
-
+
@@ -26,7 +52,7 @@
-
+
@@ -70,27 +96,38 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -99,20 +136,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -122,14 +172,28 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
@@ -147,10 +211,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -158,7 +242,7 @@
-
+
@@ -169,7 +253,7 @@
-->
-
+
@@ -177,13 +261,42 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -192,13 +305,35 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -217,6 +352,8 @@
+
+
@@ -225,11 +362,14 @@
+
+
+
@@ -268,7 +408,7 @@
-
+
@@ -280,6 +420,8 @@
+
+
@@ -300,9 +442,14 @@
-
+
+
+
+
+
+
diff --git a/external/ikvm/openjdk/response.txt b/external/ikvm/openjdk/response.txt
deleted file mode 100644
index f7d9471db2..0000000000
--- a/external/ikvm/openjdk/response.txt
+++ /dev/null
@@ -1,1116 +0,0 @@
-#
-# Copyright (C) 2002-2013 Jeroen Frijters
-#
-# This software is provided 'as-is', without any express or implied
-# warranty. In no event will the authors be held liable for any damages
-# arising from the use of this software.
-#
-# Permission is granted to anyone to use this software for any purpose,
-# including commercial applications, and to alter it and redistribute it
-# freely, subject to the following restrictions:
-#
-# 1. The origin of this software must not be misrepresented; you must not
-# claim that you wrote the original software. If you use this software
-# in a product, an acknowledgment in the product documentation would be
-# appreciated but is not required.
-# 2. Altered source versions must be plainly marked as such, and must not be
-# misrepresented as being the original software.
-# 3. This notice may not be removed or altered from any source distribution.
-#
-# Jeroen Frijters
-# jeroen@frijters.net
-#
-
-assembly.class
-{
- -out:IKVM.OpenJDK.Core.dll
- -baseaddress:0x56000000
- -remap:map.xml
- -exclude:exclude.lst
- -resource:META-INF/MANIFEST.MF=MANIFEST.MF
- -resource:java/lang/uniName.dat=@OPENJDK7@/build/linux-amd64/classes/java/lang/uniName.dat
- -resource:sun/net/idn/uidna.spp=@OPENJDK7@/build/linux-amd64/classes/sun/net/idn/uidna.spp
- ikvm/internal/*.class
- java/io/*.class
- java/lang/*.class
- java/lang/invoke/*.class
- java/lang/ref/*.class
- java/lang/reflect/*.class
- java/net/*.class
- java/nio/*.class
- java/security/*.class
- java/util/*.class
- java/util/concurrent/locks/*.class
- gnu/java/util/*.class
- sun/misc/*.class
- sun/net/sdp/*.class
- sun/net/www/protocol/file/*.class
- sun/net/www/protocol/ikvmres/*.class
- sun/net/www/protocol/jar/*.class
- sun/nio/ch/*.class
- sun/nio/cs/*.class
- sun/nio/fs/*.class
- sun/reflect/*.class
- sun/reflect/misc/*.class
- ../classpath/gnu/java/net/protocol/ikvmres/*.class
- ../classpath/ikvm/extensions/*.class
- ../classpath/ikvm/internal/*.class
- ../classpath/ikvm/io/*.class
- ../classpath/ikvm/lang/*.class
- ../classpath/ikvm/runtime/*.class
- ../classpath/java/util/concurrent/atomic/*.class
- ../classpath/sun/misc/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/java/lang/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/java/nio/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/java/nio/channels/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/java/nio/charset/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/nio/cs/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/istack/internal/logging/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/developer/ServerSideException.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/nio/file/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/nio/sctp/*.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/ChangeListenerMap.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/IndexedPropertyChangeEvent.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/PropertyChangeEvent.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/PropertyChangeListener.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/PropertyChangeListenerProxy.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/PropertyChangeSupport*.class
- @OPENJDK7@/jdk/src/share/classes/java/io/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/annotation/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/invoke/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/ref/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/reflect/*.class
- @OPENJDK7@/jdk/src/share/classes/java/math/*.class
- @OPENJDK7@/jdk/src/share/classes/java/net/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/channels/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/channels/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/charset/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/charset/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/file/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/file/attribute/*.class
- @OPENJDK7@/jdk/src/share/classes/java/nio/file/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/security/*.class
- @OPENJDK7@/jdk/src/share/classes/java/security/cert/*.class
- @OPENJDK7@/jdk/src/share/classes/java/sql/Timestamp.class
- @OPENJDK7@/jdk/src/share/classes/java/util/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/concurrent/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/concurrent/atomic/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/concurrent/locks/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/jar/Attributes*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/jar/Manifest*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/regex/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/net/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/invoke/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/invoke/anon/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/invoke/empty/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/invoke/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/misc/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/ftp/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/ftp/impl/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/idn/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/smtp/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/spi/nameservice/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/content/text/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/http/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/ftp/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/http/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/http/logging/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/http/spnego/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/jar/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/mailto/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/nio/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/nio/ch/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/nio/cs/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/nio/fs/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/annotation/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/factory/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/parser/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/reflectiveObjects/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/repository/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/scope/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/tree/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/generics/visitor/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/reflect/misc/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/action/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/jca/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/DigestBase.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/SHA.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/Sun.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/SunEntries$1.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/SunEntries.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/Debug.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/PermissionFactory.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/PropertyExpander$ExpandException.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/PropertyExpander.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/SecurityConstants*.class
- @OPENJDK7@/jdk/src/share/classes/sun/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/util/locale/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/util/logging/*.class
- @OPENJDK7@/jdk/src/solaris/classes/java/io/*.class
- @OPENJDK7@/jdk/src/solaris/classes/sun/net/www/protocol/http/ntlm/*.class
- @OPENJDK7@/jdk/src/windows/classes/java/io/*.class
- @OPENJDK7@/jdk/src/windows/classes/java/lang/*.class
- @OPENJDK7@/jdk/src/windows/classes/java/net/DefaultInterface.class
- @OPENJDK7@/jdk/src/windows/classes/sun/net/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/nio/ch/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/nio/fs/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/security/provider/NativePRNG.class
-}
-{
- -out:IKVM.OpenJDK.Corba.dll
- -baseaddress:0x56C60000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/corba/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/jndi/cosnaming/jndiprovider.properties
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/activation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/copyobject/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/corba/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/dynamicany/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/encoding/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/interceptors/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/io/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/ior/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/ior/iiop/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/javax/rmi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/javax/rmi/CORBA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/legacy/connection/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/logging/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/monitoring/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/naming/cosnaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/naming/namingutil/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/naming/pcosnaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/oa/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/oa/poa/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/oa/toa/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orb/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/closure/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/concurrent/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/fsm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/graph/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/orbutil/threadpool/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/presentation/rmi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/protocol/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/protocol/giopmsgheaders/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/resolver/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/transport/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/impl/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/internal/corba/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/internal/CosNaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/internal/iiop/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/internal/Interceptors/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/internal/POA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/org/omg/CORBA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/pept/broker/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/pept/encoding/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/pept/protocol/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/pept/transport/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/PortableActivationIDL/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/PortableActivationIDL/InitialNameServicePackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/PortableActivationIDL/LocatorPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/PortableActivationIDL/RepositoryPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/activation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/activation/InitialNameServicePackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/activation/LocatorPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/activation/RepositoryPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/copyobject/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/encoding/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/extension/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/ior/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/ior/iiop/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/legacy/connection/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/legacy/interceptor/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/logging/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/monitoring/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/oa/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/orb/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/orbutil/closure/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/orbutil/fsm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/orbutil/proxy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/orbutil/threadpool/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/presentation/rmi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/protocol/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/resolver/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/servicecontext/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/corba/se/spi/transport/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/omg/CORBA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/omg/CORBA/portable/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/omg/CORBA/ValueDefPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/omg/SendingContext/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/omg/SendingContext/CodeBasePackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/rmi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/rmi/CORBA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA/DynAnyPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA/ORBPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA/portable/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA/TypeCodePackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA_2_3/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CORBA_2_3/portable/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CosNaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CosNaming/NamingContextExtPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/CosNaming/NamingContextPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/Dynamic/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/DynamicAny/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/DynamicAny/DynAnyFactoryPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/DynamicAny/DynAnyPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/IOP/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/IOP/CodecFactoryPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/IOP/CodecPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/Messaging/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableInterceptor/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableInterceptor/ORBInitInfoPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/CurrentPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/POAManagerPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/POAPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/portable/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/PortableServer/ServantLocatorPackage/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/SendingContext/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/omg/stub/java/rmi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/sun/corba/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/cosnaming/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/toolkit/corba/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/corbaname/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/iiop/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/iiopname/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.API.dll
- -baseaddress:0x572C0000
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/datatype/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/namespace/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/parsers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/stream/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/stream/events/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/stream/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/transform/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/transform/dom/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/transform/sax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/transform/stax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/transform/stream/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/validation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/xpath/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/bootstrap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/css/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/events/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/html/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/ls/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/ranges/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/stylesheets/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/traversal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/views/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/w3c/dom/xpath/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/xml/sax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/xml/sax/ext/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/org/xml/sax/helpers/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/browser/dom/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.XPath.dll
- -baseaddress:0x57380000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xalan/internal/res/*
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/extensions/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/res/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/dtm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/dtm/ref/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/dtm/ref/dom2dtm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/AttList.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/DOMHelper.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/DOM2Helper.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/TreeWalker.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/axes/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/compiler/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/domapi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/functions/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/jaxp/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/objects/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/operations/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/patterns/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xpath/internal/res/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.Parse.dll
- -baseaddress:0x576E0000
- -resource:com/sun/org/apache/xml/internal/serialize/HTMLEntities.res=@OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/serialize/HTMLEntities.res
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xerces/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xml/internal/serializer/*
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/utils/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/dom/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/dom/events/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dtd/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dtd/models/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dv/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dv/dtd/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dv/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/dv/xs/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/io/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/msg/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/validation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xpath/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xpath/regex/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/identity/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/models/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/opti/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/traversers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/impl/xs/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/jaxp/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/jaxp/datatype/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/jaxp/validation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/parsers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/utils/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xinclude/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xni/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xni/grammars/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xni/parser/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xpointer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xs/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xerces/internal/xs/datatypes/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/res/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/resolver/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/resolver/helpers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/resolver/readers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/resolver/tools/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/serialize/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/serializer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/serializer/utils/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xml/internal/utils/res/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/staxex/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/buffer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/buffer/sax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/buffer/stax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/dtd/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/dtd/nonvalidating/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/events/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/stream/writers/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.Transform.dll
- -baseaddress:0x57E90000
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/java_cup/internal/runtime/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/classfile/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/generic/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/bcel/internal/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/regexp/internal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/lib/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/templates/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xslt/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/cmdline/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/cmdline/getopt/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/compiler/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/compiler/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/dom/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/runtime/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/runtime/output/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/trax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/apache/xalan/internal/xsltc/util/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.Bind.dll
- -baseaddress:0x582B0000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/javax/xml/bind/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/bind/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/fastinfoset/*
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/istack/internal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/istack/internal/localization/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/annotation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/api/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/api/impl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/marshaller/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/unmarshaller/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/bytecode/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/annotation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/core/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/impl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/nav/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/model/runtime/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/output/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/property/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/reflect/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/reflect/opt/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/runtime/unmarshaller/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/schemagen/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/schemagen/episode/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/schemagen/xmlschema/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/bind/v2/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/algorithm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/alphabet/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/dom/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/org/apache/xerces/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/sax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/stax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/stax/events/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/stax/factory/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/stax/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/tools/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/fastinfoset/vocab/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/fastinfoset/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/fastinfoset/sax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/fastinfoset/sax/helpers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/fastinfoset/stax/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/txw2/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/txw2/annotation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/txw2/output/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/annotation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/annotation/adapters/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/attachment/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/helpers/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/bind/util/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.WebServices.dll
- -baseaddress:0x58610000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/messaging/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/xml/internal/ws/*
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/amx/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/arc/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/probe/provider/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/probe/provider/annotations/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/statistics/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/statistics/annotations/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/external/statistics/impl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/gmbal/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/org/glassfish/gmbal/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/client/p2p/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/packaging/mime/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/packaging/mime/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/dynamic/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/impl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/name/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/ver1_1/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/soap/ver1_2/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/messaging/saaj/util/transform/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/org/jvnet/mimepull/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/addressing/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/addressing/model/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/addressing/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/addressing/v200408/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/addressing/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/client/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/config/management/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/config/management/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/fastinfoset/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/ha/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/handler/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/message/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/message/stream/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/model/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/model/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/model/wsdl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/pipe/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/pipe/helper/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/server/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/streaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/wsdl/parser/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/api/wsdl/writer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/binding/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/client/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/client/dispatch/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/client/sei/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/config/management/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/developer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/fastinfoset/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/soap/streaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/encoding/xml/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/fault/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/handler/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/message/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/message/jaxb/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/message/saaj/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/message/source/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/message/stream/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/model/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/model/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/model/wsdl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/org/objectweb/asm/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/jaxws/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/jaxws/spi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/privateutil/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/sourcemodel/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/sourcemodel/attach/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/sourcemodel/wspolicy/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/spi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/policy/subject/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/protocol/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/protocol/xml/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/resources/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/server/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/server/provider/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/server/sei/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/spi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/streaming/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/transport/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/transport/http/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/transport/http/client/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/transport/http/server/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/util/exception/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/util/localization/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/util/pipe/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/util/xml/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/parser/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/document/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/document/http/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/document/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/document/soap12/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/xml/internal/ws/wsdl/writer/document/xsd/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/handler/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/handler/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/http/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/spi/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/spi/http/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/xml/ws/wsaddressing/*.class
-}
-{
- -out:IKVM.OpenJDK.XML.Crypto.dll
- -baseaddress:0x58B80000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/org/apache/xml/internal/security/*
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/helper/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/c14n/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/encryption/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/exceptions/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/keyvalues/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/storage/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/params/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/dom/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/dsig/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/dsig/dom/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/dsig/keyinfo/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/xml/crypto/dsig/spec/*.class
- @OPENJDK7@/jdk/src/share/classes/org/jcp/xml/dsig/internal/*.class
- @OPENJDK7@/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/*.class
-}
-{
- -out:IKVM.OpenJDK.SwingAWT.dll
- -baseaddress:0x58CD0000
- -remap:swingawt.xml
- -resource:META-INF/services/sun.java2d.pipe.RenderingEngine=resources/META-INF/services/sun.java2d.pipe.RenderingEngine
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/sun.java2d.cmm.PCMM
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/java/swing/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/javax/swing/*
- -recurse:resources.zip/com/sun/swing/internal/plaf/*
- -recurse:resources.zip/com/sun/java/swing/plaf/*
- -r:System.Drawing.dll
- -r:IKVM.AWT.WinForms.dll
- ikvm/awt/*.class
- java/awt/*.class
- java/awt/color/*.class
- java/awt/image/*.class
- gnu/java/awt/*.class
- gnu/java/awt/color/*.class
- sun/awt/*.class
- sun/awt/image/*.class
- sun/awt/shell/*.class
- sun/font/*.class
- sun/java2d/*.class
- sun/java2d/cmm/lcms/*.class
- sun/java2d/pipe/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/accessibility/internal/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/java/swing/plaf/motif/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/java/swing/plaf/windows/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/swing/internal/plaf/basic/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/swing/internal/plaf/metal/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/com/sun/swing/internal/plaf/synth/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/javax/swing/plaf/nimbus/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/awt/resources/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/awt/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/swing/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/swing/plaf/motif/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/swing/plaf/nimbus/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/swing/plaf/windows/*.class
- @OPENJDK7@/jdk/src/share/classes/java/applet/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/color/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/datatransfer/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/dnd/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/dnd/peer/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/event/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/font/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/geom/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/im/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/im/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/image/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/image/renderable/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/peer/*.class
- @OPENJDK7@/jdk/src/share/classes/java/awt/print/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/accessibility/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/border/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/colorchooser/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/event/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/filechooser/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/basic/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/metal/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/multi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/nimbus/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/plaf/synth/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/table/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/text/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/text/html/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/text/html/parser/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/text/rtf/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/tree/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/swing/undo/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/applet/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/datatransfer/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/dnd/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/event/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/geom/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/im/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/image/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/shell/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/awt/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/font/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/java2d/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/java2d/cmm/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/java2d/pipe/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/java2d/pipe/hw/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/java2d/pisces/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/content/image/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/icon/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/plaf/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/plaf/synth/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/plaf/windows/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/table/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/text/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/swing/text/html/*.class
- @OPENJDK7@/jdk/src/solaris/classes/sun/awt/windows/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/awt/*.class
-}
-{
- -out:IKVM.OpenJDK.Charsets.dll
- -baseaddress:0x59E70000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/charsets.jar/sun/nio/cs/ext/sjis0213.dat
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/charsets.jar/META-INF/services/java.nio.charset.spi.CharsetProvider
- @OPENJDK7@/build/linux-amd64/gensrc/sun/nio/cs/ext/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/nio/cs/ext/*.class
-}
-{
- -out:IKVM.OpenJDK.Util.dll
- -baseaddress:0x5A500000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/java/util/jar/pack/intrinsic.properties
- -recurse:resources.zip/sun/launcher/resources/*
- -resource:META-INF/services/java.nio.file.spi.FileSystemProvider=@OPENJDK7@/jdk/src/share/demo/nio/zipfs/src/META-INF/services/java.nio.file.spi.FileSystemProvider
- java/util/zip/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/util/logging/resources/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/util/resources/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/browser/net/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/java/util/jar/pack/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/jar/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/logging/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/prefs/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/util/zip/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/launcher/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/util/calendar/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/util/resources/*.class
- @OPENJDK7@/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/*.class
- @OPENJDK7@/jdk/src/solaris/classes/java/util/prefs/*.class
- @OPENJDK7@/jdk/src/windows/classes/java/util/prefs/*.class
-}
-{
- -out:IKVM.OpenJDK.Text.dll
- -baseaddress:0x5AAD0000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/text/*
- @OPENJDK7@/build/linux-amd64/j2re-image/lib/ext/localedata.jar
- @OPENJDK7@/jdk/src/share/classes/java/text/*.class
- @OPENJDK7@/jdk/src/share/classes/java/text/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/text/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/text/bidi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/text/normalizer/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/text/resources/*.class
-}
-{
- -out:IKVM.OpenJDK.Security.dll
- -baseaddress:0x5AD40000
- -remap:security.xml
- sun/security/jgss/wrapper/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/crypto/provider/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/net/ssl/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/net/ssl/internal/ssl/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/auth/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/auth/callback/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/auth/login/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/auth/module/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/cert/internal/x509/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/jgss/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/ntlm/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/sasl/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/sasl/digest/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/sasl/gsskerb/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/sasl/ntlm/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/security/sasl/util/*.class
- @OPENJDK7@/jdk/src/share/classes/java/security/acl/*.class
- @OPENJDK7@/jdk/src/share/classes/java/security/interfaces/*.class
- @OPENJDK7@/jdk/src/share/classes/java/security/spec/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/crypto/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/crypto/interfaces/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/crypto/spec/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/net/ssl/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/callback/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/kerberos/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/login/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/auth/x500/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/cert/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/security/sasl/*.class
- @OPENJDK7@/jdk/src/share/classes/org/ietf/jgss/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/http/ntlm/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/https/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/acl/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/ec/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/internal/interfaces/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/internal/spec/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/jgss/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/jgss/krb5/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/jgss/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/jgss/spnego/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/ccache/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/crypto/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/ktab/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/rcache/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/krb5/internal/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/pkcs/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/pkcs12/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/certpath/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/provider/certpath/ldap/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/rsa/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/ssl/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/ssl/krb5/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/timestamp/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/util/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/validator/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/security/x509/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/security/krb5/internal/tools/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/security/provider/*.class
-}
-{
- -out:IKVM.OpenJDK.Management.dll
- -baseaddress:0x5B550000
- com/sun/management/*.class
- java/lang/management/*.class
- sun/management/*.class
- @OPENJDK7@/build/linux-amd64/classes/javax/management/remote/rmi/*.class
- @OPENJDK7@/build/linux-amd64/classes/org/omg/stub/javax/management/remote/rmi/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/management/resources/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/defaults/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/interceptor/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/mbeanserver/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/remote/internal/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/remote/protocol/rmi/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/remote/security/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jmx/remote/util/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/management/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/management/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/loading/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/modelmbean/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/monitor/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/openmbean/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/relation/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/remote/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/remote/rmi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/management/timer/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/management/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/management/counter/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/management/counter/perf/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/management/jmxremote/*.class
- @OPENJDK7@/jdk/src/windows/classes/com/sun/management/*.class
-}
-{
- -out:IKVM.OpenJDK.Misc.dll
- -baseaddress:0x5B8B0000
- -resource:com/sun/servicetag/resources/javase_5_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_5_swordfish.properties
- -resource:com/sun/servicetag/resources/javase_6_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_6_swordfish.properties
- -resource:com/sun/servicetag/resources/javase_7_swordfish.properties=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/javase_7_swordfish.properties
- -resource:com/sun/servicetag/resources/product_registration.xsd=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/product_registration.xsd
- -resource:com/sun/servicetag/resources/register.html=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/register.html
- -resource:com/sun/servicetag/resources/register_ja.html=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/register_ja.html
- -resource:com/sun/servicetag/resources/register_zh_CN.html=@OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html
- @OPENJDK7@/build/linux-amd64/impsrc/javax/activity/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/annotation/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/annotation/processing/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/jws/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/jws/soap/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/lang/model/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/lang/model/element/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/lang/model/type/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/lang/model/util/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/tools/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/transaction/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/transaction/xa/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/net/httpserver/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/net/httpserver/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/encoding/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/ept/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/presentation/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/protocol/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/pept/transport/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/servicetag/*.class
- @OPENJDK7@/jdk/src/share/classes/java/lang/instrument/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/script/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/smartcardio/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharASCII.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharConverter.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1250.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1251.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1252.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1253.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1254.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharCp1257.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_1.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_13.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_15.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_2.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_4.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_5.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_7.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharISO8859_9.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharKOI8_R.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharSingleByte.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUnicode.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUnicodeBig.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUnicodeBigUnmarked.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUnicodeLittle.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUnicodeLittleUnmarked.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUTF16.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ByteToCharUTF8.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharacterEncoding$1.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharacterEncoding$2.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharacterEncoding.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteASCII.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteConverter.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1250.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1251.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1252.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1253.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1254.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteCp1257.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_1.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_13.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_15.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_2.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_4.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_5.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_7.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteISO8859_9.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteKOI8_R.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteSingleByte.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUnicode.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUnicodeBig.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUnicodeBigUnmarked.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUnicodeLittle.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUnicodeLittleUnmarked.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUTF16.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/CharToByteUTF8.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/ConversionBufferFullException.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/Converters.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/MalformedInputException.class
- @OPENJDK7@/jdk/src/share/classes/sun/io/UnknownCharacterException.class
- @OPENJDK7@/jdk/src/share/classes/sun/misc/resources/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/httpserver/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/gopher/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/www/protocol/netdoc/*.class
- @OPENJDK7@/jdk/src/share/classes/sunw/io/*.class
- @OPENJDK7@/jdk/src/share/classes/sunw/util/*.class
- @OPENJDK7@/langtools/src/share/classes/javax/lang/model/*.class
- @OPENJDK7@/langtools/src/share/classes/javax/lang/model/element/*.class
- @OPENJDK7@/langtools/src/share/classes/javax/lang/model/type/*.class
-}
-{
- -out:IKVM.OpenJDK.Naming.dll
- -baseaddress:0x5B9D0000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/jndi/ldap/jndiprovider.properties
- -resource:META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor=@OPENJDK7@/jdk/src/share/classes/sun/net/spi/nameservice/dns/META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
- sun/net/dns/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/dns/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/ldap/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/ldap/ext/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/ldap/pool/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/ldap/sasl/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/toolkit/dir/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/toolkit/url/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/dns/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/ldap/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/ldaps/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/naming/internal/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/naming/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/naming/directory/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/naming/event/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/naming/ldap/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/naming/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/dns/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/net/spi/nameservice/dns/*.class
-}
-{
- -out:IKVM.OpenJDK.Jdbc.dll
- -baseaddress:0x5BB20000
- -resource:META-INF/services/java.sql.Driver=resources/META-INF/services/java.sql.Driver
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/rowset/*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/javax/sql/*
- -r:System.Data.dll
- java/sql/*.class
- sun/jdbc/odbc/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/rowset/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/rowset/internal/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/rowset/providers/*.class
- @OPENJDK7@/jdk/src/share/classes/java/sql/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sql/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sql/rowset/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sql/rowset/serial/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sql/rowset/spi/*.class
-}
-{
- -out:IKVM.OpenJDK.Remoting.dll
- -baseaddress:0x5BC70000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/rmi/*
- @OPENJDK7@/build/linux-amd64/classes/sun/rmi/registry/*.class
- @OPENJDK7@/build/linux-amd64/classes/sun/rmi/server/*.class
- @OPENJDK7@/build/linux-amd64/classes/sun/rmi/transport/*.class
- @OPENJDK7@/build/linux-amd64/classes/com/sun/jndi/rmi/registry/*.class
- @OPENJDK7@/build/linux-amd64/classes/java/rmi/activation/*.class
- @OPENJDK7@/jdk/src/share/classes/java/rmi/*.class
- @OPENJDK7@/jdk/src/share/classes/java/rmi/activation/*.class
- @OPENJDK7@/jdk/src/share/classes/java/rmi/dgc/*.class
- @OPENJDK7@/jdk/src/share/classes/java/rmi/registry/*.class
- @OPENJDK7@/jdk/src/share/classes/java/rmi/server/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/rmi/ssl/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/rmi/registry/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/jndi/url/rmi/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/rmi/rmid/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/log/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/registry/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/runtime/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/server/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/transport/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/transport/proxy/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/rmi/transport/tcp/*.class
-}
-{
- -out:IKVM.OpenJDK.Beans.dll
- -baseaddress:0x5BD90000
- @OPENJDK7@/build/linux-amd64/impsrc/com/sun/activation/registries/*.class
- @OPENJDK7@/build/linux-amd64/impsrc/javax/activation/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/beans/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/beans/decoder/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/beans/finder/*.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/*.class
- @OPENJDK7@/jdk/src/share/classes/java/beans/beancontext/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/beans/editors/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/beans/infos/*.class
-}
-{
- -out:IKVM.OpenJDK.Media.dll
- -baseaddress:0x5BE50000
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.print.*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/META-INF/services/javax.sound.*
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/com/sun/imageio/plugins/common/iio-plugin.properties
- -recurse:@OPENJDK7@/build/linux-amd64/j2re-image/lib/resources.jar/sun/print/*
- -r:System.Drawing.dll
- com/sun/imageio/plugins/jpeg/*.class
- icedtea/rt/com/sun/media/sound/*.class
- sun/print/*.class
- sun/awt/windows/*.class
- @OPENJDK7@/build/linux-amd64/gensrc/sun/print/resources/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/bmp/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/common/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/gif/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/png/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/imageio/stream/*.class
- @OPENJDK7@/jdk/src/share/classes/com/sun/media/sound/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/event/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/metadata/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/plugins/bmp/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/plugins/jpeg/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/imageio/stream/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/print/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/print/attribute/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/print/attribute/standard/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/print/event/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sound/midi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sound/midi/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sound/sampled/*.class
- @OPENJDK7@/jdk/src/share/classes/javax/sound/sampled/spi/*.class
- @OPENJDK7@/jdk/src/share/classes/sun/print/*.class
- @OPENJDK7@/jdk/src/windows/classes/sun/print/*.class
-}
diff --git a/external/ikvm/openjdk/response.txt.REMOVED.git-id b/external/ikvm/openjdk/response.txt.REMOVED.git-id
new file mode 100644
index 0000000000..2213d187fb
--- /dev/null
+++ b/external/ikvm/openjdk/response.txt.REMOVED.git-id
@@ -0,0 +1 @@
+0371c2e17040377153909ef9f19d553f527c5078
\ No newline at end of file
diff --git a/external/ikvm/openjdk/sun/management/FileSystemImpl.java b/external/ikvm/openjdk/sun/management/FileSystemImpl.java
deleted file mode 100644
index 51ed8d77c2..0000000000
--- a/external/ikvm/openjdk/sun/management/FileSystemImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (C) 2011 Jeroen Frijters
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jeroen Frijters
- jeroen@frijters.net
-
-*/
-package sun.management;
-
-import ikvm.internal.NotYetImplementedError;
-import java.io.File;
-
-public class FileSystemImpl extends FileSystem
-{
- public boolean supportsFileSecurity(File f)
- {
- throw new NotYetImplementedError();
- }
-
- public boolean isAccessUserOnly(File f)
- {
- throw new NotYetImplementedError();
- }
-}
diff --git a/external/ikvm/openjdk/sun/management/GcInfoBuilder.java b/external/ikvm/openjdk/sun/management/GcInfoBuilder.java
deleted file mode 100644
index abe5082f5c..0000000000
--- a/external/ikvm/openjdk/sun/management/GcInfoBuilder.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code 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
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.management;
-
-import ikvm.internal.NotYetImplementedError;
-
-import java.lang.management.GarbageCollectorMXBean;
-import java.lang.management.MemoryUsage;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import com.sun.management.GcInfo;
-
-/**
- * Helper class to build composite data.
- */
-public class GcInfoBuilder {
- private final GarbageCollectorMXBean gc;
- private final String[] poolNames;
- private String[] allItemNames;
-
- // GC-specific composite type:
- // Each GarbageCollectorMXBean may have different GC-specific attributes
- // the CompositeType for the GcInfo could be different.
- private CompositeType gcInfoCompositeType;
-
- // GC-specific items
- private final int gcExtItemCount;
- private final String[] gcExtItemNames;
- private final String[] gcExtItemDescs;
- private final char[] gcExtItemTypes;
-
- GcInfoBuilder(GarbageCollectorMXBean gc, String[] poolNames) {
- this.gc = gc;
- this.poolNames = poolNames;
- this.gcExtItemCount = getNumGcExtAttributes(gc);
- this.gcExtItemNames = new String[gcExtItemCount];
- this.gcExtItemDescs = new String[gcExtItemCount];
- this.gcExtItemTypes = new char[gcExtItemCount];
-
- // Fill the information about extension attributes
- fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
- gcExtItemTypes, gcExtItemDescs);
-
- // lazily build the CompositeType for the GcInfo
- // including the GC-specific extension attributes
- this.gcInfoCompositeType = null;
- }
-
- GcInfo getLastGcInfo() {
- MemoryUsage[] usageBeforeGC = new MemoryUsage[poolNames.length];
- MemoryUsage[] usageAfterGC = new MemoryUsage[poolNames.length];
- Object[] values = new Object[gcExtItemCount];
-
- return getLastGcInfo0(gc, gcExtItemCount, values, gcExtItemTypes,
- usageBeforeGC, usageAfterGC);
- }
-
- public String[] getPoolNames() {
- return poolNames;
- }
-
- int getGcExtItemCount() {
- return gcExtItemCount;
- }
-
- // Returns the CompositeType for the GcInfo including
- // the extension attributes
- synchronized CompositeType getGcInfoCompositeType() {
- if (gcInfoCompositeType != null)
- return gcInfoCompositeType;
-
- // First, fill with the attributes in the GcInfo
- String[] gcInfoItemNames = GcInfoCompositeData.getBaseGcInfoItemNames();
- OpenType[] gcInfoItemTypes = GcInfoCompositeData.getBaseGcInfoItemTypes();
- int numGcInfoItems = gcInfoItemNames.length;
-
- int itemCount = numGcInfoItems + gcExtItemCount;
- allItemNames = new String[itemCount];
- String[] allItemDescs = new String[itemCount];
- OpenType[] allItemTypes = new OpenType[itemCount];
-
- System.arraycopy(gcInfoItemNames, 0, allItemNames, 0, numGcInfoItems);
- System.arraycopy(gcInfoItemNames, 0, allItemDescs, 0, numGcInfoItems);
- System.arraycopy(gcInfoItemTypes, 0, allItemTypes, 0, numGcInfoItems);
-
- // Then fill with the extension GC-specific attributes, if any.
- if (gcExtItemCount > 0) {
- fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
- gcExtItemTypes, gcExtItemDescs);
- System.arraycopy(gcExtItemNames, 0, allItemNames,
- numGcInfoItems, gcExtItemCount);
- System.arraycopy(gcExtItemDescs, 0, allItemDescs,
- numGcInfoItems, gcExtItemCount);
- for (int i = numGcInfoItems, j = 0; j < gcExtItemCount; i++, j++) {
- switch (gcExtItemTypes[j]) {
- case 'Z':
- allItemTypes[i] = SimpleType.BOOLEAN;
- break;
- case 'B':
- allItemTypes[i] = SimpleType.BYTE;
- break;
- case 'C':
- allItemTypes[i] = SimpleType.CHARACTER;
- break;
- case 'S':
- allItemTypes[i] = SimpleType.SHORT;
- break;
- case 'I':
- allItemTypes[i] = SimpleType.INTEGER;
- break;
- case 'J':
- allItemTypes[i] = SimpleType.LONG;
- break;
- case 'F':
- allItemTypes[i] = SimpleType.FLOAT;
- break;
- case 'D':
- allItemTypes[i] = SimpleType.DOUBLE;
- break;
- default:
- throw new AssertionError(
- "Unsupported type [" + gcExtItemTypes[i] + "]");
- }
- }
- }
-
- CompositeType gict = null;
- try {
- final String typeName =
- "sun.management." + gc.getName() + ".GcInfoCompositeType";
-
- gict = new CompositeType(typeName,
- "CompositeType for GC info for " +
- gc.getName(),
- allItemNames,
- allItemDescs,
- allItemTypes);
- } catch (OpenDataException e) {
- // shouldn't reach here
- throw Util.newException(e);
- }
- gcInfoCompositeType = gict;
-
- return gcInfoCompositeType;
- }
-
- synchronized String[] getItemNames() {
- if (allItemNames == null) {
- // initialize when forming the composite type
- getGcInfoCompositeType();
- }
- return allItemNames;
- }
-
- // Retrieve information about extension attributes
- private /*native*/ int getNumGcExtAttributes(GarbageCollectorMXBean gc){
- throw new NotYetImplementedError();
- }
-
- private /*native*/ void fillGcAttributeInfo(GarbageCollectorMXBean gc,
- int numAttributes,
- String[] attributeNames,
- char[] types,
- String[] descriptions){
- throw new NotYetImplementedError();
- }
-
- /**
- * Returns the last GcInfo
- *
- * @param gc GarbageCollectorMXBean that the gc info is associated with.
- * @param numExtAtts number of extension attributes
- * @param extAttValues Values of extension attributes to be filled.
- * @param before Memory usage before GC to be filled.
- * @param after Memory usage after GC to be filled.
- */
- private /*native*/ GcInfo getLastGcInfo0(GarbageCollectorMXBean gc,
- int numExtAtts,
- Object[] extAttValues,
- char[] extAttTypes,
- MemoryUsage[] before,
- MemoryUsage[] after){
- throw new NotYetImplementedError();
- }
-}
diff --git a/external/ikvm/openjdk/sun/nio/fs/NetFileSystemProvider.java b/external/ikvm/openjdk/sun/nio/fs/NetFileSystemProvider.java
index 3c569b1e37..3a16383c53 100644
--- a/external/ikvm/openjdk/sun/nio/fs/NetFileSystemProvider.java
+++ b/external/ikvm/openjdk/sun/nio/fs/NetFileSystemProvider.java
@@ -338,7 +338,7 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider
}
}
- return FileChannelImpl.open(open(npath.path, mode, rights, share, options), npath.path, read, write, append, null);
+ return FileChannelImpl.open(open(npath.path, mode, rights, share, options), read, write, append, null);
}
private static FileDescriptor open(String path, int mode, int rights, int share, int options) throws IOException
@@ -1104,7 +1104,7 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider
public long size()
{
- return info.get_Length();
+ return info.get_Exists() ? info.get_Length() : 0;
}
public boolean isArchive()
@@ -1140,7 +1140,12 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider
if (false) throw new cli.System.ArgumentException();
if (false) throw new cli.System.IO.FileNotFoundException();
if (false) throw new cli.System.IO.IOException();
- return new DosFileAttributesImpl(new FileInfo(path));
+ FileInfo info = new FileInfo(path);
+ if (!info.get_Exists())
+ {
+ throw new NoSuchFileException(path);
+ }
+ return new DosFileAttributesImpl(info);
}
catch (cli.System.IO.FileNotFoundException _)
{
@@ -1193,6 +1198,10 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider
info.set_Attributes(cli.System.IO.FileAttributes.wrap(info.get_Attributes().Value & ~attr));
}
}
+ catch (cli.System.IO.FileNotFoundException _)
+ {
+ throw new NoSuchFileException(path);
+ }
catch (cli.System.ArgumentException
| cli.System.IO.IOException x)
{
diff --git a/external/ikvm/openjdk/sun/reflect/annotation/AnnotationType.java b/external/ikvm/openjdk/sun/reflect/annotation/AnnotationType.java
new file mode 100644
index 0000000000..80280018a5
--- /dev/null
+++ b/external/ikvm/openjdk/sun/reflect/annotation/AnnotationType.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.reflect.annotation;
+
+import sun.misc.JavaLangAccess;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Represents an annotation type at run time. Used to type-check annotations
+ * and apply member defaults.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class AnnotationType {
+ /**
+ * Member name -> type mapping. Note that primitive types
+ * are represented by the class objects for the corresponding wrapper
+ * types. This matches the return value that must be used for a
+ * dynamic proxy, allowing for a simple isInstance test.
+ */
+ private final Map> memberTypes;
+
+ /**
+ * Member name -> default value mapping.
+ */
+ private final Map memberDefaults;
+
+ /**
+ * Member name -> Method object mapping. This (and its assoicated
+ * accessor) are used only to generate AnnotationTypeMismatchExceptions.
+ */
+ private final Map members;
+
+ /**
+ * The retention policy for this annotation type.
+ */
+ private final RetentionPolicy retention;
+
+ /**
+ * Whether this annotation type is inherited.
+ */
+ private final boolean inherited;
+
+ /**
+ * Returns an AnnotationType instance for the specified annotation type.
+ *
+ * @throw IllegalArgumentException if the specified class object for
+ * does not represent a valid annotation type
+ */
+ public static AnnotationType getInstance(
+ Class extends Annotation> annotationClass)
+ {
+ JavaLangAccess jla = sun.misc.SharedSecrets.getJavaLangAccess();
+ AnnotationType result = jla.getAnnotationType(annotationClass); // volatile read
+ if (result == null) {
+ result = new AnnotationType(annotationClass);
+ // try to CAS the AnnotationType: null -> result
+ if (!jla.casAnnotationType(annotationClass, null, result)) {
+ // somebody was quicker -> read it's result
+ result = jla.getAnnotationType(annotationClass);
+ assert result != null;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Sole constructor.
+ *
+ * @param annotationClass the class object for the annotation type
+ * @throw IllegalArgumentException if the specified class object for
+ * does not represent a valid annotation type
+ */
+ private AnnotationType(final Class extends Annotation> annotationClass) {
+ if (!annotationClass.isAnnotation())
+ throw new IllegalArgumentException("Not an annotation type");
+
+ Method[] methods =
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Method[] run() {
+ // Initialize memberTypes and defaultValues
+ return annotationClass.getDeclaredMethods();
+ }
+ });
+
+ memberTypes = new HashMap>(methods.length+1, 1.0f);
+ memberDefaults = new HashMap(0);
+ members = new HashMap(methods.length+1, 1.0f);
+
+ for (Method method : methods) {
+ if (method.getParameterTypes().length != 0)
+ throw new IllegalArgumentException(method + " has params");
+ String name = method.getName();
+ Class> type = method.getReturnType();
+ memberTypes.put(name, invocationHandlerReturnType(type));
+ members.put(name, method);
+
+ Object defaultValue = method.getDefaultValue();
+ if (defaultValue != null)
+ memberDefaults.put(name, defaultValue);
+ }
+
+ // Initialize retention, & inherited fields. Special treatment
+ // of the corresponding annotation types breaks infinite recursion.
+ if (annotationClass != Retention.class &&
+ annotationClass != Inherited.class) {
+ Retention ret = (Retention) annotationClass.getDeclaredAnnotation(Retention.class);
+ retention = (ret == null ? RetentionPolicy.CLASS : ret.value());
+ inherited = annotationClass.isAnnotationPresent(Inherited.class);
+ }
+ else {
+ retention = RetentionPolicy.RUNTIME;
+ inherited = false;
+ }
+ }
+
+ /**
+ * Returns the type that must be returned by the invocation handler
+ * of a dynamic proxy in order to have the dynamic proxy return
+ * the specified type (which is assumed to be a legal member type
+ * for an annotation).
+ */
+ public static Class> invocationHandlerReturnType(Class> type) {
+ // Translate primitives to wrappers
+ if (type == byte.class)
+ return Byte.class;
+ if (type == char.class)
+ return Character.class;
+ if (type == double.class)
+ return Double.class;
+ if (type == float.class)
+ return Float.class;
+ if (type == int.class)
+ return Integer.class;
+ if (type == long.class)
+ return Long.class;
+ if (type == short.class)
+ return Short.class;
+ if (type == boolean.class)
+ return Boolean.class;
+
+ // Otherwise, just return declared type
+ return type;
+ }
+
+ /**
+ * Returns member types for this annotation type
+ * (member name -> type mapping).
+ */
+ public Map> memberTypes() {
+ return memberTypes;
+ }
+
+ /**
+ * Returns members of this annotation type
+ * (member name -> associated Method object mapping).
+ */
+ public Map members() {
+ return members;
+ }
+
+ /**
+ * Returns the default values for this annotation type
+ * (Member name -> default value mapping).
+ */
+ public Map memberDefaults() {
+ return memberDefaults;
+ }
+
+ /**
+ * Returns the retention policy for this annotation type.
+ */
+ public RetentionPolicy retention() {
+ return retention;
+ }
+
+ /**
+ * Returns true if this this annotation type is inherited.
+ */
+ public boolean isInherited() {
+ return inherited;
+ }
+
+ /**
+ * For debugging.
+ */
+ public String toString() {
+ return "Annotation Type:\n" +
+ " Member types: " + memberTypes + "\n" +
+ " Member defaults: " + memberDefaults + "\n" +
+ " Retention policy: " + retention + "\n" +
+ " Inherited: " + inherited;
+ }
+}
diff --git a/external/ikvm/reflect/CustomAttributeData.cs b/external/ikvm/reflect/CustomAttributeData.cs
index 98905af89b..70e1b1422b 100644
--- a/external/ikvm/reflect/CustomAttributeData.cs
+++ b/external/ikvm/reflect/CustomAttributeData.cs
@@ -157,7 +157,7 @@ namespace IKVM.Reflection
throw new BadImageFormatException();
}
lazyConstructorArguments = ReadConstructorArguments(module, br, constructor);
- lazyNamedArguments = ReadNamedArguments(module, br, br.ReadUInt16(), constructor.DeclaringType);
+ lazyNamedArguments = ReadNamedArguments(module, br, br.ReadUInt16(), constructor.DeclaringType, true);
}
}
@@ -443,13 +443,17 @@ namespace IKVM.Reflection
return list.AsReadOnly();
}
- private static IList ReadNamedArguments(Module context, ByteReader br, int named, Type type)
+ private static IList ReadNamedArguments(Module context, ByteReader br, int named, Type type, bool required)
{
List list = new List(named);
for (int i = 0; i < named; i++)
{
byte fieldOrProperty = br.ReadByte();
Type fieldOrPropertyType = ReadFieldOrPropType(context, br);
+ if (fieldOrPropertyType.__IsMissing && !required)
+ {
+ return null;
+ }
string name = br.ReadString();
CustomAttributeTypedArgument value = ReadFixedArg(context, br, fieldOrPropertyType);
MemberInfo member;
@@ -580,7 +584,7 @@ namespace IKVM.Reflection
{
if (lazyConstructorArguments == null)
{
- LazyParseArguments();
+ LazyParseArguments(false);
}
return lazyConstructorArguments;
}
@@ -595,21 +599,21 @@ namespace IKVM.Reflection
if (customAttributeIndex >= 0)
{
// 1) Unresolved Custom Attribute
- LazyParseArguments();
+ LazyParseArguments(true);
}
else
{
// 5) Unresolved declarative security
ByteReader br = new ByteReader(declSecurityBlob, 0, declSecurityBlob.Length);
// LAMESPEC the count of named arguments is a compressed integer (instead of UInt16 as NumNamed in custom attributes)
- lazyNamedArguments = ReadNamedArguments(module, br, br.ReadCompressedUInt(), Constructor.DeclaringType);
+ lazyNamedArguments = ReadNamedArguments(module, br, br.ReadCompressedUInt(), Constructor.DeclaringType, true);
}
}
return lazyNamedArguments;
}
}
- private void LazyParseArguments()
+ private void LazyParseArguments(bool requireNameArguments)
{
ByteReader br = module.GetBlob(module.CustomAttribute.records[customAttributeIndex].Value);
if (br.Length == 0)
@@ -625,7 +629,7 @@ namespace IKVM.Reflection
throw new BadImageFormatException();
}
lazyConstructorArguments = ReadConstructorArguments(module, br, Constructor);
- lazyNamedArguments = ReadNamedArguments(module, br, br.ReadUInt16(), Constructor.DeclaringType);
+ lazyNamedArguments = ReadNamedArguments(module, br, br.ReadUInt16(), Constructor.DeclaringType, requireNameArguments);
}
}
diff --git a/external/ikvm/reflect/Emit/AssemblyBuilder.cs b/external/ikvm/reflect/Emit/AssemblyBuilder.cs
index 7732c57ab3..61f7ffa03d 100644
--- a/external/ikvm/reflect/Emit/AssemblyBuilder.cs
+++ b/external/ikvm/reflect/Emit/AssemblyBuilder.cs
@@ -373,9 +373,9 @@ namespace IKVM.Reflection.Emit
foreach (CustomAttributeBuilder cab in customAttributes)
{
// .NET doesn't support copying blob custom attributes into the version info
- if (!cab.HasBlob)
+ if (!cab.HasBlob || universe.DecodeVersionInfoAttributeBlobs)
{
- versionInfo.SetAttribute(cab);
+ versionInfo.SetAttribute(this, cab);
}
}
ByteBuffer versionInfoData = new ByteBuffer(512);
diff --git a/external/ikvm/reflect/IKVM.Reflection.csproj b/external/ikvm/reflect/IKVM.Reflection.csproj
index 5e117288d8..2ded215c2e 100644
--- a/external/ikvm/reflect/IKVM.Reflection.csproj
+++ b/external/ikvm/reflect/IKVM.Reflection.csproj
@@ -3,7 +3,7 @@
DebugAnyCPU
- 9.0.30729
+ 9.0.210222.0{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}Library
@@ -22,6 +22,8 @@
+ true
+ ..\ikvm-fork.snktrue
diff --git a/external/ikvm/reflect/Type.cs b/external/ikvm/reflect/Type.cs
index 3b70c999c1..66606c12e2 100644
--- a/external/ikvm/reflect/Type.cs
+++ b/external/ikvm/reflect/Type.cs
@@ -2040,6 +2040,7 @@ namespace IKVM.Reflection
{
if (this.Assembly == this.Universe.Mscorlib
|| this.Assembly.GetName().Name.Equals("mscorlib", StringComparison.OrdinalIgnoreCase)
+ || this.Assembly.GetName().Name.Equals("System.Runtime", StringComparison.OrdinalIgnoreCase)
// check if mscorlib forwards the type (.NETCore profile reference mscorlib forwards System.Enum and System.ValueType to System.Runtime.dll)
|| this.Universe.Mscorlib.FindType(new TypeName(__Namespace, __Name)) == this)
{
diff --git a/external/ikvm/reflect/Universe.cs b/external/ikvm/reflect/Universe.cs
index 1b4b351a9a..26fb558eb7 100644
--- a/external/ikvm/reflect/Universe.cs
+++ b/external/ikvm/reflect/Universe.cs
@@ -128,6 +128,7 @@ namespace IKVM.Reflection
MetadataOnly = 16,
ResolveMissingMembers = 32,
DisableWindowsRuntimeProjection = 64,
+ DecodeVersionInfoAttributeBlobs = 128,
}
public sealed class Universe : IDisposable
@@ -1216,5 +1217,10 @@ namespace IKVM.Reflection
{
get { return (options & UniverseOptions.DisableWindowsRuntimeProjection) == 0; }
}
+
+ internal bool DecodeVersionInfoAttributeBlobs
+ {
+ get { return (options & UniverseOptions.DecodeVersionInfoAttributeBlobs) != 0; }
+ }
}
}
diff --git a/external/ikvm/reflect/Writer/VersionInfo.cs b/external/ikvm/reflect/Writer/VersionInfo.cs
index 41938a108f..25eb193b4e 100644
--- a/external/ikvm/reflect/Writer/VersionInfo.cs
+++ b/external/ikvm/reflect/Writer/VersionInfo.cs
@@ -50,41 +50,41 @@ namespace IKVM.Reflection.Writer
this.fileName = System.IO.Path.GetFileName(assemblyFileName);
}
- internal void SetAttribute(CustomAttributeBuilder cab)
+ internal void SetAttribute(AssemblyBuilder asm, CustomAttributeBuilder cab)
{
Universe u = cab.Constructor.Module.universe;
Type type = cab.Constructor.DeclaringType;
if (copyright == null && type == u.System_Reflection_AssemblyCopyrightAttribute)
{
- copyright = (string)cab.GetConstructorArgument(0);
+ copyright = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (trademark == null && type == u.System_Reflection_AssemblyTrademarkAttribute)
{
- trademark = (string)cab.GetConstructorArgument(0);
+ trademark = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (product == null && type == u.System_Reflection_AssemblyProductAttribute)
{
- product = (string)cab.GetConstructorArgument(0);
+ product = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (company == null && type == u.System_Reflection_AssemblyCompanyAttribute)
{
- company = (string)cab.GetConstructorArgument(0);
+ company = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (description == null && type == u.System_Reflection_AssemblyDescriptionAttribute)
{
- description = (string)cab.GetConstructorArgument(0);
+ description = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (title == null && type == u.System_Reflection_AssemblyTitleAttribute)
{
- title = (string)cab.GetConstructorArgument(0);
+ title = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (informationalVersion == null && type == u.System_Reflection_AssemblyInformationalVersionAttribute)
{
- informationalVersion = (string)cab.GetConstructorArgument(0);
+ informationalVersion = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
else if (fileVersion == null && type == u.System_Reflection_AssemblyFileVersionAttribute)
{
- fileVersion = (string)cab.GetConstructorArgument(0);
+ fileVersion = (string)cab.DecodeBlob(asm).GetConstructorArgument(0);
}
}
diff --git a/external/ikvm/runtime/AssemblyClassLoader.cs b/external/ikvm/runtime/AssemblyClassLoader.cs
index 960beead75..09653c7334 100644
--- a/external/ikvm/runtime/AssemblyClassLoader.cs
+++ b/external/ikvm/runtime/AssemblyClassLoader.cs
@@ -746,8 +746,16 @@ namespace IKVM.Internal
using (java.io.InputStream inp = url.openStream())
{
byte[] buf = new byte[inp.available()];
- inp.read(buf, 0, buf.Length);
- return TypeWrapper.FromClass(IKVM.NativeCode.java.lang.ClassLoader.defineClass1(GetJavaClassLoader(), name, buf, 0, buf.Length, GetProtectionDomain(), null));
+ for (int pos = 0; pos < buf.Length; )
+ {
+ int read = inp.read(buf, pos, buf.Length - pos);
+ if (read <= 0)
+ {
+ break;
+ }
+ pos += read;
+ }
+ return TypeWrapper.FromClass(Java_java_lang_ClassLoader.defineClass1(GetJavaClassLoader(), name, buf, 0, buf.Length, GetProtectionDomain(), null));
}
}
#endif
@@ -860,7 +868,7 @@ namespace IKVM.Internal
if (!found && unmangledName.EndsWith(".class", StringComparison.Ordinal) && unmangledName.IndexOf('.') == unmangledName.Length - 6)
{
TypeWrapper tw = FindLoadedClass(unmangledName.Substring(0, unmangledName.Length - 6).Replace('/', '.'));
- if (tw != null && tw.GetClassLoader() == this && !tw.IsArray && !(tw is DynamicTypeWrapper))
+ if (tw != null && tw.GetClassLoader() == this && !tw.IsArray && !tw.IsDynamic)
{
#if !FIRST_PASS
yield return new java.io.File(VirtualFileSystem.GetAssemblyClassesPath(assemblyLoader.Assembly) + unmangledName).toURI().toURL();
@@ -1103,28 +1111,23 @@ namespace IKVM.Internal
LazyInitExports();
lock (this)
{
- Array.Resize(ref delegates, delegates.Length + 1);
- delegates[delegates.Length - 1] = acl;
+ delegates = ArrayUtil.Concat(delegates, acl);
}
}
#if !STATIC_COMPILER && !STUB_GENERATOR
- internal string[] GetPackages()
+ internal List> GetPackageInfo()
{
- string[] packages = new string[0];
+ List> list = new List>();
foreach (Module m in assemblyLoader.Assembly.GetModules(false))
{
object[] attr = m.GetCustomAttributes(typeof(PackageListAttribute), false);
foreach (PackageListAttribute p in attr)
{
- string[] mp = p.GetPackages();
- string[] tmp = new string[packages.Length + mp.Length];
- Array.Copy(packages, 0, tmp, 0, packages.Length);
- Array.Copy(mp, 0, tmp, packages.Length, mp.Length);
- packages = tmp;
+ list.Add(new KeyValuePair(p.jar, p.packages));
}
}
- return packages;
+ return list;
}
#endif
@@ -1313,6 +1316,10 @@ namespace IKVM.Internal
return base.GetWrapperFromAssemblyType(type);
}
+ protected override void CheckProhibitedPackage(string className)
+ {
+ }
+
#if !FIRST_PASS && !STATIC_COMPILER && !STUB_GENERATOR
internal override java.lang.ClassLoader GetJavaClassLoader()
{
diff --git a/external/ikvm/runtime/BigEndianBinaryReader.cs b/external/ikvm/runtime/BigEndianBinaryReader.cs
index fcd5dfa5a2..5d9b286869 100644
--- a/external/ikvm/runtime/BigEndianBinaryReader.cs
+++ b/external/ikvm/runtime/BigEndianBinaryReader.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2012 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -164,7 +164,7 @@ sealed class BigEndianBinaryReader
case 0:
if(c == 0)
{
- throw new ClassFormatError("{0} (Illegal UTF8 string in constant pool)", classFile);
+ goto default;
}
break;
case 1: case 2: case 3: case 4: case 5: case 6: case 7:
@@ -175,9 +175,13 @@ sealed class BigEndianBinaryReader
char2 = buf[pos + ++i];
if((char2 & 0xc0) != 0x80 || i >= len)
{
- throw new ClassFormatError("{0} (Illegal UTF8 string in constant pool)", classFile);
+ goto default;
}
c = (((c & 0x1F) << 6) | (char2 & 0x3F));
+ if(c < 0x80 && c != 0)
+ {
+ goto default;
+ }
break;
case 14:
// 1110 xxxx 10xx xxxx 10xx xxxx
@@ -185,12 +189,16 @@ sealed class BigEndianBinaryReader
char3 = buf[pos + ++i];
if((char2 & 0xc0) != 0x80 || (char3 & 0xc0) != 0x80 || i >= len)
{
- throw new ClassFormatError("{0} (Illegal UTF8 string in constant pool)", classFile);
+ goto default;
}
c = (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
+ if(c < 0x800)
+ {
+ goto default;
+ }
break;
default:
- throw new ClassFormatError("{0} (Illegal UTF8 string in constant pool)", classFile);
+ throw new ClassFormatError("Illegal UTF8 string in constant pool in class file {0}", classFile);
}
ch[l++] = (char)c;
}
@@ -224,4 +232,11 @@ sealed class BigEndianBinaryReader
pos += 4;
return i;
}
+
+ internal byte[] ToArray()
+ {
+ byte[] res = new byte[end - pos];
+ Buffer.BlockCopy(buf, pos, res, 0, res.Length);
+ return res;
+ }
}
diff --git a/external/ikvm/runtime/Boxer.cs b/external/ikvm/runtime/Boxer.cs
new file mode 100644
index 0000000000..880e015e43
--- /dev/null
+++ b/external/ikvm/runtime/Boxer.cs
@@ -0,0 +1,212 @@
+/*
+ Copyright (C) 2011-2014 Jeroen Frijters
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jeroen Frijters
+ jeroen@frijters.net
+
+*/
+using System;
+
+namespace IKVM.Internal
+{
+ static class Boxer
+ {
+ private static readonly TypeWrapper javaLangByte;
+ private static readonly MethodWrapper byteValue;
+ private static readonly MethodWrapper valueOfByte;
+ private static readonly TypeWrapper javaLangBoolean;
+ private static readonly MethodWrapper booleanValue;
+ private static readonly MethodWrapper valueOfBoolean;
+ private static readonly TypeWrapper javaLangShort;
+ private static readonly MethodWrapper shortValue;
+ private static readonly MethodWrapper valueOfShort;
+ private static readonly TypeWrapper javaLangCharacter;
+ private static readonly MethodWrapper charValue;
+ private static readonly MethodWrapper valueOfCharacter;
+ private static readonly TypeWrapper javaLangInteger;
+ private static readonly MethodWrapper intValue;
+ private static readonly MethodWrapper valueOfInteger;
+ private static readonly TypeWrapper javaLangFloat;
+ private static readonly MethodWrapper floatValue;
+ private static readonly MethodWrapper valueOfFloat;
+ private static readonly TypeWrapper javaLangLong;
+ private static readonly MethodWrapper longValue;
+ private static readonly MethodWrapper valueOfLong;
+ private static readonly TypeWrapper javaLangDouble;
+ private static readonly MethodWrapper doubleValue;
+ private static readonly MethodWrapper valueOfDouble;
+
+ static Boxer()
+ {
+ ClassLoaderWrapper bootClassLoader = ClassLoaderWrapper.GetBootstrapClassLoader();
+ javaLangByte = bootClassLoader.LoadClassByDottedNameFast("java.lang.Byte");
+ byteValue = javaLangByte.GetMethodWrapper("byteValue", "()B", false);
+ byteValue.Link();
+ valueOfByte = javaLangByte.GetMethodWrapper("valueOf", "(B)Ljava.lang.Byte;", false);
+ valueOfByte.Link();
+ javaLangBoolean = bootClassLoader.LoadClassByDottedNameFast("java.lang.Boolean");
+ booleanValue = javaLangBoolean.GetMethodWrapper("booleanValue", "()Z", false);
+ booleanValue.Link();
+ valueOfBoolean = javaLangBoolean.GetMethodWrapper("valueOf", "(Z)Ljava.lang.Boolean;", false);
+ valueOfBoolean.Link();
+ javaLangShort = bootClassLoader.LoadClassByDottedNameFast("java.lang.Short");
+ shortValue = javaLangShort.GetMethodWrapper("shortValue", "()S", false);
+ shortValue.Link();
+ valueOfShort = javaLangShort.GetMethodWrapper("valueOf", "(S)Ljava.lang.Short;", false);
+ valueOfShort.Link();
+ javaLangCharacter = bootClassLoader.LoadClassByDottedNameFast("java.lang.Character");
+ charValue = javaLangCharacter.GetMethodWrapper("charValue", "()C", false);
+ charValue.Link();
+ valueOfCharacter = javaLangCharacter.GetMethodWrapper("valueOf", "(C)Ljava.lang.Character;", false);
+ valueOfCharacter.Link();
+ javaLangInteger = bootClassLoader.LoadClassByDottedNameFast("java.lang.Integer");
+ intValue = javaLangInteger.GetMethodWrapper("intValue", "()I", false);
+ intValue.Link();
+ valueOfInteger = javaLangInteger.GetMethodWrapper("valueOf", "(I)Ljava.lang.Integer;", false);
+ valueOfInteger.Link();
+ javaLangFloat = bootClassLoader.LoadClassByDottedNameFast("java.lang.Float");
+ floatValue = javaLangFloat.GetMethodWrapper("floatValue", "()F", false);
+ floatValue.Link();
+ valueOfFloat = javaLangFloat.GetMethodWrapper("valueOf", "(F)Ljava.lang.Float;", false);
+ valueOfFloat.Link();
+ javaLangLong = bootClassLoader.LoadClassByDottedNameFast("java.lang.Long");
+ longValue = javaLangLong.GetMethodWrapper("longValue", "()J", false);
+ longValue.Link();
+ valueOfLong = javaLangLong.GetMethodWrapper("valueOf", "(J)Ljava.lang.Long;", false);
+ valueOfLong.Link();
+ javaLangDouble = bootClassLoader.LoadClassByDottedNameFast("java.lang.Double");
+ doubleValue = javaLangDouble.GetMethodWrapper("doubleValue", "()D", false);
+ doubleValue.Link();
+ valueOfDouble = javaLangDouble.GetMethodWrapper("valueOf", "(D)Ljava.lang.Double;", false);
+ valueOfDouble.Link();
+ }
+
+ internal static void EmitUnbox(CodeEmitter ilgen, TypeWrapper tw, bool cast)
+ {
+ if (tw == PrimitiveTypeWrapper.BYTE)
+ {
+ if (cast)
+ {
+ javaLangByte.EmitCheckcast(ilgen);
+ }
+ byteValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.BOOLEAN)
+ {
+ if (cast)
+ {
+ javaLangBoolean.EmitCheckcast(ilgen);
+ }
+ booleanValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.SHORT)
+ {
+ if (cast)
+ {
+ javaLangShort.EmitCheckcast(ilgen);
+ }
+ shortValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.CHAR)
+ {
+ if (cast)
+ {
+ javaLangCharacter.EmitCheckcast(ilgen);
+ }
+ charValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.INT)
+ {
+ if (cast)
+ {
+ javaLangInteger.EmitCheckcast(ilgen);
+ }
+ intValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.FLOAT)
+ {
+ if (cast)
+ {
+ javaLangFloat.EmitCheckcast(ilgen);
+ }
+ floatValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.LONG)
+ {
+ if (cast)
+ {
+ javaLangLong.EmitCheckcast(ilgen);
+ }
+ longValue.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.DOUBLE)
+ {
+ if (cast)
+ {
+ javaLangDouble.EmitCheckcast(ilgen);
+ }
+ doubleValue.EmitCall(ilgen);
+ }
+ else
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ internal static void EmitBox(CodeEmitter ilgen, TypeWrapper tw)
+ {
+ if (tw == PrimitiveTypeWrapper.BYTE)
+ {
+ valueOfByte.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.BOOLEAN)
+ {
+ valueOfBoolean.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.SHORT)
+ {
+ valueOfShort.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.CHAR)
+ {
+ valueOfCharacter.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.INT)
+ {
+ valueOfInteger.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.FLOAT)
+ {
+ valueOfFloat.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.LONG)
+ {
+ valueOfLong.EmitCall(ilgen);
+ }
+ else if (tw == PrimitiveTypeWrapper.DOUBLE)
+ {
+ valueOfDouble.EmitCall(ilgen);
+ }
+ else
+ {
+ throw new InvalidOperationException();
+ }
+ }
+ }
+}
diff --git a/external/ikvm/runtime/ClassFile.cs b/external/ikvm/runtime/ClassFile.cs
index db684117b3..bdb51002a7 100644
--- a/external/ikvm/runtime/ClassFile.cs
+++ b/external/ikvm/runtime/ClassFile.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2013 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -39,8 +39,6 @@ namespace IKVM.Internal
NoSuchMethodError,
LinkageError,
// "exceptions" that are wrapped in an IncompatibleClassChangeError
- NoSuchFieldException,
- NoSuchMethodException,
IllegalAccessException,
// if an error is added here, it must also be added to MethodAnalyzer.SetHardError()
}
@@ -52,6 +50,7 @@ namespace IKVM.Internal
LocalVariableTable = 1,
LineNumberTable = 2,
RelaxedClassNameValidation = 4,
+ TrustedAnnotations = 8,
}
sealed class ClassFile
@@ -66,6 +65,9 @@ namespace IKVM.Internal
private const ushort FLAG_MASK_DEPRECATED = 0x100;
private const ushort FLAG_MASK_INTERNAL = 0x200;
private const ushort FLAG_CALLERSENSITIVE = 0x400;
+ private const ushort FLAG_LAMBDAFORM_COMPILED = 0x800;
+ private const ushort FLAG_LAMBDAFORM_HIDDEN = 0x1000;
+ private const ushort FLAG_FORCEINLINE = 0x2000;
private ConstantPoolItemClass[] interfaces;
private Field[] fields;
private Method[] methods;
@@ -79,11 +81,12 @@ namespace IKVM.Internal
private string signature;
private string[] enclosingMethod;
private BootstrapMethod[] bootstrapMethods;
+ private byte[] runtimeVisibleTypeAnnotations;
private static class SupportedVersions
{
internal static readonly int Minimum = 45;
- internal static readonly int Maximum = Experimental.JDK_8 ? 52 : 51;
+ internal static readonly int Maximum = Experimental.JDK_9 ? 53 : 52;
}
#if STATIC_COMPILER
@@ -160,7 +163,7 @@ namespace IKVM.Internal
}
#endif // STATIC_COMPILER
- internal ClassFile(byte[] buf, int offset, int length, string inputClassName, ClassFileParseOptions options)
+ internal ClassFile(byte[] buf, int offset, int length, string inputClassName, ClassFileParseOptions options, object[] constantPoolPatches)
{
try
{
@@ -242,6 +245,10 @@ namespace IKVM.Internal
throw new ClassFormatError("{0} (Illegal constant pool type 0x{1:X})", inputClassName, tag);
}
}
+ if (constantPoolPatches != null)
+ {
+ PatchConstantPool(constantPoolPatches, utf8_cp, inputClassName);
+ }
for(int i = 1; i < constantpoolcount; i++)
{
if(constantpool[i] != null)
@@ -283,7 +290,7 @@ namespace IKVM.Internal
ValidateConstantPoolItemClass(inputClassName, this_class);
super_class = br.ReadUInt16();
ValidateConstantPoolItemClass(inputClassName, super_class);
- if(IsInterface && (super_class == 0 || this.SuperClass != "java.lang.Object"))
+ if(IsInterface && (super_class == 0 || this.SuperClass.Name != "java.lang.Object"))
{
throw new ClassFormatError("{0} (Interfaces must have java.lang.Object as superclass)", Name);
}
@@ -479,6 +486,14 @@ namespace IKVM.Internal
}
bootstrapMethods = ReadBootstrapMethods(br, this);
break;
+ case "RuntimeVisibleTypeAnnotations":
+ if(majorVersion < 52)
+ {
+ goto default;
+ }
+ CreateUtf8ConstantPoolItems(utf8_cp);
+ runtimeVisibleTypeAnnotations = br.Section(br.ReadUInt32()).ToArray();
+ break;
case "IKVM.NET.Assembly":
if(br.ReadUInt32() != 2)
{
@@ -528,6 +543,17 @@ namespace IKVM.Internal
// }
}
+ private void CreateUtf8ConstantPoolItems(string[] utf8_cp)
+ {
+ for (int i = 0; i < constantpool.Length; i++)
+ {
+ if (constantpool[i] == null && utf8_cp[i] != null)
+ {
+ constantpool[i] = new ConstantPoolItemUtf8(utf8_cp[i]);
+ }
+ }
+ }
+
private void CheckDuplicates(T[] members, string msg)
where T : IEquatable
{
@@ -558,6 +584,66 @@ namespace IKVM.Internal
}
}
+ private void PatchConstantPool(object[] constantPoolPatches, string[] utf8_cp, string inputClassName)
+ {
+#if !STATIC_COMPILER && !FIRST_PASS
+ for (int i = 0; i < constantPoolPatches.Length; i++)
+ {
+ if (constantPoolPatches[i] != null)
+ {
+ if (utf8_cp[i] != null)
+ {
+ if (!(constantPoolPatches[i] is string))
+ {
+ throw new ClassFormatError("Illegal utf8 patch at {0} in class file {1}", i, inputClassName);
+ }
+ utf8_cp[i] = (string)constantPoolPatches[i];
+ }
+ else if (constantpool[i] != null)
+ {
+ switch (constantpool[i].GetConstantType())
+ {
+ case ConstantType.String:
+ constantpool[i] = new ConstantPoolItemLiveObject(constantPoolPatches[i]);
+ break;
+ case ConstantType.Class:
+ java.lang.Class clazz;
+ string name;
+ if ((clazz = constantPoolPatches[i] as java.lang.Class) != null)
+ {
+ TypeWrapper tw = TypeWrapper.FromClass(clazz);
+ constantpool[i] = new ConstantPoolItemClass(tw.Name, tw);
+ }
+ else if ((name = constantPoolPatches[i] as string) != null)
+ {
+ constantpool[i] = new ConstantPoolItemClass(String.Intern(name.Replace('/', '.')), null);
+ }
+ else
+ {
+ throw new ClassFormatError("Illegal class patch at {0} in class file {1}", i, inputClassName);
+ }
+ break;
+ case ConstantType.Integer:
+ ((ConstantPoolItemInteger)constantpool[i]).v = ((java.lang.Integer)constantPoolPatches[i]).intValue();
+ break;
+ case ConstantType.Long:
+ ((ConstantPoolItemLong)constantpool[i]).l = ((java.lang.Long)constantPoolPatches[i]).longValue();
+ break;
+ case ConstantType.Float:
+ ((ConstantPoolItemFloat)constantpool[i]).v = ((java.lang.Float)constantPoolPatches[i]).floatValue();
+ break;
+ case ConstantType.Double:
+ ((ConstantPoolItemDouble)constantpool[i]).d = ((java.lang.Double)constantPoolPatches[i]).doubleValue();
+ break;
+ default:
+ throw new NotImplementedException("ConstantPoolPatch: " + constantPoolPatches[i]);
+ }
+ }
+ }
+ }
+#endif
+ }
+
private void MarkLinkRequiredConstantPoolItem(int index)
{
if (index > 0 && index < constantpool.Length && constantpool[index] != null)
@@ -730,7 +816,7 @@ namespace IKVM.Internal
}
for(int i = 0; i < name.Length; i++)
{
- if(".;/<>".IndexOf(name[i]) != -1)
+ if(".;[/<>".IndexOf(name[i]) != -1)
{
return false;
}
@@ -746,7 +832,7 @@ namespace IKVM.Internal
}
for(int i = 0; i < name.Length; i++)
{
- if(".;/".IndexOf(name[i]) != -1)
+ if(".;[/".IndexOf(name[i]) != -1)
{
return false;
}
@@ -875,6 +961,8 @@ namespace IKVM.Internal
internal void Link(TypeWrapper thisType)
{
+ // this is not just an optimization, it's required for anonymous classes to be able to refer to themselves
+ ((ConstantPoolItemClass)constantpool[this_class]).LinkSelf(thisType);
for(int i = 1; i < constantpool.Length; i++)
{
if(constantpool[i] != null)
@@ -1102,6 +1190,11 @@ namespace IKVM.Internal
return (ConstantPoolItemMethodType)constantpool[index];
}
+ internal object GetConstantPoolConstantLiveObject(int index)
+ {
+ return ((ConstantPoolItemLiveObject)constantpool[index]).Value;
+ }
+
internal string Name
{
get
@@ -1110,11 +1203,11 @@ namespace IKVM.Internal
}
}
- internal string SuperClass
+ internal ConstantPoolItemClass SuperClass
{
get
{
- return GetConstantPoolClass(super_class);
+ return (ConstantPoolItemClass)constantpool[super_class];
}
}
@@ -1184,6 +1277,27 @@ namespace IKVM.Internal
}
}
+ internal byte[] RuntimeVisibleTypeAnnotations
+ {
+ get
+ {
+ return runtimeVisibleTypeAnnotations;
+ }
+ }
+
+ internal object[] GetConstantPool()
+ {
+ object[] cp = new object[constantpool.Length];
+ for (int i = 1; i < cp.Length; i++)
+ {
+ if (constantpool[i] != null)
+ {
+ cp[i] = constantpool[i].GetRuntimeValue();
+ }
+ }
+ return cp;
+ }
+
internal string IKVMAssemblyAttribute
{
get
@@ -1301,6 +1415,7 @@ namespace IKVM.Internal
Class,
MethodHandle,
MethodType,
+ LiveObject, // used by anonymous class constant pool patching
}
internal abstract class ConstantPoolItem
@@ -1321,6 +1436,13 @@ namespace IKVM.Internal
internal virtual void MarkLinkRequired()
{
}
+
+ // this is used for sun.reflect.ConstantPool
+ // it returns a boxed System.Int32, System.Int64, System.Float, System.Double or a string
+ internal virtual object GetRuntimeValue()
+ {
+ return null;
+ }
}
internal sealed class ConstantPoolItemClass : ConstantPoolItem, IEquatable
@@ -1328,15 +1450,26 @@ namespace IKVM.Internal
private ushort name_index;
private string name;
private TypeWrapper typeWrapper;
- private static char[] invalidJava15Characters = { '.', ';' };
+ private static char[] invalidJava15Characters = { '.', ';', '[', ']' };
internal ConstantPoolItemClass(BigEndianBinaryReader br)
{
name_index = br.ReadUInt16();
}
+ internal ConstantPoolItemClass(string name, TypeWrapper typeWrapper)
+ {
+ this.name = name;
+ this.typeWrapper = typeWrapper;
+ }
+
internal override void Resolve(ClassFile classFile, string[] utf8_cp, ClassFileParseOptions options)
{
+ // if the item was patched, we already have a name
+ if(name != null)
+ {
+ return;
+ }
name = classFile.GetConstantPoolUtf8String(utf8_cp, name_index);
if(name.Length > 0)
{
@@ -1383,6 +1516,7 @@ namespace IKVM.Internal
#endif
{
// since 1.5 the restrictions on class names have been greatly reduced
+ int start = 0;
int end = name.Length;
if(name[0] == '[')
{
@@ -1398,8 +1532,12 @@ namespace IKVM.Internal
{
end--;
}
+ while(name[start] == '[')
+ {
+ start++;
+ }
}
- if(name.IndexOfAny(invalidJava15Characters, 0, end) >= 0)
+ if(name.IndexOfAny(invalidJava15Characters, start, end - start) >= 0)
{
goto barf;
}
@@ -1413,7 +1551,15 @@ namespace IKVM.Internal
internal override void MarkLinkRequired()
{
- typeWrapper = VerifierTypeWrapper.Null;
+ if(typeWrapper == null)
+ {
+ typeWrapper = VerifierTypeWrapper.Null;
+ }
+ }
+
+ internal void LinkSelf(TypeWrapper thisType)
+ {
+ this.typeWrapper = thisType;
}
internal override void Link(TypeWrapper thisType)
@@ -1469,7 +1615,7 @@ namespace IKVM.Internal
private sealed class ConstantPoolItemDouble : ConstantPoolItem
{
- private double d;
+ internal double d;
internal ConstantPoolItemDouble(BigEndianBinaryReader br)
{
@@ -1488,6 +1634,11 @@ namespace IKVM.Internal
return d;
}
}
+
+ internal override object GetRuntimeValue()
+ {
+ return d;
+ }
}
internal abstract class ConstantPoolItemFMI : ConstantPoolItem
@@ -1799,7 +1950,7 @@ namespace IKVM.Internal
private sealed class ConstantPoolItemFloat : ConstantPoolItem
{
- private float v;
+ internal float v;
internal ConstantPoolItemFloat(BigEndianBinaryReader br)
{
@@ -1818,11 +1969,16 @@ namespace IKVM.Internal
return v;
}
}
+
+ internal override object GetRuntimeValue()
+ {
+ return v;
+ }
}
private sealed class ConstantPoolItemInteger : ConstantPoolItem
{
- private int v;
+ internal int v;
internal ConstantPoolItemInteger(BigEndianBinaryReader br)
{
@@ -1841,11 +1997,16 @@ namespace IKVM.Internal
return v;
}
}
+
+ internal override object GetRuntimeValue()
+ {
+ return v;
+ }
}
private sealed class ConstantPoolItemLong : ConstantPoolItem
{
- private long l;
+ internal long l;
internal ConstantPoolItemLong(BigEndianBinaryReader br)
{
@@ -1864,6 +2025,11 @@ namespace IKVM.Internal
return l;
}
}
+
+ internal override object GetRuntimeValue()
+ {
+ return l;
+ }
}
private sealed class ConstantPoolItemNameAndType : ConstantPoolItem
@@ -1914,7 +2080,7 @@ namespace IKVM.Internal
case RefKind.invokeStatic:
case RefKind.newInvokeSpecial:
cpi = classFile.GetConstantPoolItem(method_index) as ConstantPoolItemMethodref;
- if (cpi == null && classFile.MajorVersion >= 52 && (RefKind)ref_kind == RefKind.invokeStatic)
+ if (cpi == null && classFile.MajorVersion >= 52 && ((RefKind)ref_kind == RefKind.invokeStatic || (RefKind)ref_kind == RefKind.invokeSpecial))
goto case RefKind.invokeInterface;
break;
case RefKind.invokeInterface:
@@ -2146,6 +2312,38 @@ namespace IKVM.Internal
}
}
+ // this is only used to copy strings into "constantpool" when we see a RuntimeVisibleTypeAnnotations attribute,
+ // because we need a consistent way of exposing constant pool items to the runtime and that case
+ private sealed class ConstantPoolItemUtf8 : ConstantPoolItem
+ {
+ private readonly string str;
+
+ internal ConstantPoolItemUtf8(string str)
+ {
+ this.str = str;
+ }
+
+ internal override object GetRuntimeValue()
+ {
+ return str;
+ }
+ }
+
+ private sealed class ConstantPoolItemLiveObject : ConstantPoolItem
+ {
+ internal readonly object Value;
+
+ internal ConstantPoolItemLiveObject(object value)
+ {
+ this.Value = value;
+ }
+
+ internal override ConstantType GetConstantType()
+ {
+ return ConstantType.LiveObject;
+ }
+ }
+
internal enum Constant
{
Utf8 = 1,
@@ -2173,6 +2371,7 @@ namespace IKVM.Internal
private string descriptor;
protected string signature;
protected object[] annotations;
+ protected byte[] runtimeVisibleTypeAnnotations;
internal FieldOrMethod(ClassFile classFile, string[] utf8_cp, BigEndianBinaryReader br)
{
@@ -2329,6 +2528,14 @@ namespace IKVM.Internal
}
}
+ internal byte[] RuntimeVisibleTypeAnnotations
+ {
+ get
+ {
+ return runtimeVisibleTypeAnnotations;
+ }
+ }
+
public sealed override int GetHashCode()
{
return name.GetHashCode() ^ descriptor.GetHashCode();
@@ -2463,6 +2670,14 @@ namespace IKVM.Internal
#endif
}
break;
+ case "RuntimeVisibleTypeAnnotations":
+ if (classFile.MajorVersion < 52)
+ {
+ goto default;
+ }
+ classFile.CreateUtf8ConstantPoolItems(utf8_cp);
+ runtimeVisibleTypeAnnotations = br.Section(br.ReadUInt32()).ToArray();
+ break;
default:
br.Skip(br.ReadUInt32());
break;
@@ -2568,6 +2783,7 @@ namespace IKVM.Internal
#if STATIC_COMPILER
internal string DllExportName;
internal int DllExportOrdinal;
+ internal string InterlockedCompareAndSetField;
#endif
}
@@ -2655,15 +2871,29 @@ namespace IKVM.Internal
goto default;
}
annotations = ReadAnnotations(br, classFile, utf8_cp);
-#if STATIC_COMPILER
- foreach(object[] annot in annotations)
+ if ((options & ClassFileParseOptions.TrustedAnnotations) != 0)
{
- if(annot[1].Equals("Lsun/reflect/CallerSensitive;"))
+ foreach(object[] annot in annotations)
{
- flags |= FLAG_CALLERSENSITIVE;
+ switch((string)annot[1])
+ {
+#if STATIC_COMPILER
+ case "Lsun/reflect/CallerSensitive;":
+ flags |= FLAG_CALLERSENSITIVE;
+ break;
+#endif
+ case "Ljava/lang/invoke/LambdaForm$Compiled;":
+ flags |= FLAG_LAMBDAFORM_COMPILED;
+ break;
+ case "Ljava/lang/invoke/LambdaForm$Hidden;":
+ flags |= FLAG_LAMBDAFORM_HIDDEN;
+ break;
+ case "Ljava/lang/invoke/ForceInline;":
+ flags |= FLAG_FORCEINLINE;
+ break;
+ }
}
}
-#endif
break;
case "RuntimeVisibleParameterAnnotations":
{
@@ -2763,6 +2993,25 @@ namespace IKVM.Internal
}
}
}
+ if(annot[1].Equals("Likvm/internal/InterlockedCompareAndSet;"))
+ {
+ string field = null;
+ for (int j = 2; j < annot.Length; j += 2)
+ {
+ if (annot[j].Equals("value") && annot[j + 1] is string)
+ {
+ field = (string)annot[j + 1];
+ }
+ }
+ if (field != null)
+ {
+ if (low == null)
+ {
+ low = new LowFreqData();
+ }
+ low.InterlockedCompareAndSetField = field;
+ }
+ }
}
break;
#endif
@@ -2776,20 +3025,17 @@ namespace IKVM.Internal
{
throw new ClassFormatError("{0} (Duplicate MethodParameters attribute)", classFile.Name);
}
- BigEndianBinaryReader rdr = br.Section(br.ReadUInt32());
- byte parameters_count = rdr.ReadByte();
- parameters = new MethodParametersEntry[parameters_count];
- for(int j = 0; j < parameters_count; j++)
- {
- parameters[j].name = classFile.GetConstantPoolUtf8String(utf8_cp, rdr.ReadUInt16());
- parameters[j].flags = rdr.ReadUInt16();
- }
- if(!rdr.IsAtEnd)
- {
- throw new ClassFormatError("{0} (MethodParameters attribute has wrong length)", classFile.Name);
- }
+ parameters = ReadMethodParameters(br, utf8_cp);
break;
}
+ case "RuntimeVisibleTypeAnnotations":
+ if (classFile.MajorVersion < 52)
+ {
+ goto default;
+ }
+ classFile.CreateUtf8ConstantPoolItems(utf8_cp);
+ runtimeVisibleTypeAnnotations = br.Section(br.ReadUInt32()).ToArray();
+ break;
default:
br.Skip(br.ReadUInt32());
break;
@@ -2799,7 +3045,7 @@ namespace IKVM.Internal
{
if(!code.IsEmpty)
{
- throw new ClassFormatError("Abstract or native method cannot have a Code attribute");
+ throw new ClassFormatError("Code attribute in native or abstract methods in class file " + classFile.Name);
}
}
else
@@ -2816,6 +3062,32 @@ namespace IKVM.Internal
}
}
+ private static MethodParametersEntry[] ReadMethodParameters(BigEndianBinaryReader br, string[] utf8_cp)
+ {
+ uint length = br.ReadUInt32();
+ if(length > 0)
+ {
+ BigEndianBinaryReader rdr = br.Section(length);
+ byte parameters_count = rdr.ReadByte();
+ if(length == 1 + parameters_count * 4)
+ {
+ MethodParametersEntry[] parameters = new MethodParametersEntry[parameters_count];
+ for(int j = 0; j < parameters_count; j++)
+ {
+ ushort name = rdr.ReadUInt16();
+ if(name >= utf8_cp.Length || (name != 0 && utf8_cp[name] == null))
+ {
+ return MethodParametersEntry.Malformed;
+ }
+ parameters[j].name = utf8_cp[name];
+ parameters[j].flags = rdr.ReadUInt16();
+ }
+ return parameters;
+ }
+ }
+ throw new ClassFormatError("Invalid MethodParameters method attribute length " + length + " in class file");
+ }
+
protected override void ValidateSig(ClassFile classFile, string descriptor)
{
if(!IsValidMethodSig(descriptor))
@@ -2832,6 +3104,15 @@ namespace IKVM.Internal
}
}
+ internal bool IsVirtual
+ {
+ get
+ {
+ return (access_flags & (Modifiers.Static | Modifiers.Private)) == 0
+ && !IsConstructor;
+ }
+ }
+
// Is this the ()V method?
internal bool IsClassInitializer
{
@@ -2859,6 +3140,30 @@ namespace IKVM.Internal
}
#endif
+ internal bool IsLambdaFormCompiled
+ {
+ get
+ {
+ return (flags & FLAG_LAMBDAFORM_COMPILED) != 0;
+ }
+ }
+
+ internal bool IsLambdaFormHidden
+ {
+ get
+ {
+ return (flags & FLAG_LAMBDAFORM_HIDDEN) != 0;
+ }
+ }
+
+ internal bool IsForceInline
+ {
+ get
+ {
+ return (flags & FLAG_FORCEINLINE) != 0;
+ }
+ }
+
internal string[] ExceptionsAttribute
{
get
@@ -2899,6 +3204,14 @@ namespace IKVM.Internal
return low == null ? -1 : low.DllExportOrdinal;
}
}
+
+ internal string InterlockedCompareAndSetField
+ {
+ get
+ {
+ return low == null ? null : low.InterlockedCompareAndSetField;
+ }
+ }
#endif
internal string VerifyError
@@ -2982,6 +3295,14 @@ namespace IKVM.Internal
}
}
+ internal bool MalformedMethodParameters
+ {
+ get
+ {
+ return parameters == MethodParametersEntry.Malformed;
+ }
+ }
+
internal bool HasJsr
{
get
@@ -3007,9 +3328,9 @@ namespace IKVM.Internal
max_stack = br.ReadUInt16();
max_locals = br.ReadUInt16();
uint code_length = br.ReadUInt32();
- if(code_length > 65535)
+ if(code_length == 0 || code_length > 65535)
{
- throw new ClassFormatError("{0} (Invalid Code length {1})", classFile.Name, code_length);
+ throw new ClassFormatError("Invalid method Code length {1} in class file {0}", classFile.Name, code_length);
}
Instruction[] instructions = new Instruction[code_length + 1];
int basePosition = br.Position;
@@ -3563,12 +3884,6 @@ namespace IKVM.Internal
internal string descriptor;
internal ushort index;
}
-
- internal struct MethodParametersEntry
- {
- internal string name;
- internal ushort flags;
- }
}
internal Field GetField(string name, string sig)
diff --git a/external/ikvm/runtime/ClassLoaderWrapper.cs b/external/ikvm/runtime/ClassLoaderWrapper.cs
index 813e41f604..9eee11a503 100644
--- a/external/ikvm/runtime/ClassLoaderWrapper.cs
+++ b/external/ikvm/runtime/ClassLoaderWrapper.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2013 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -52,16 +52,18 @@ namespace IKVM.Internal
RemoveAsserts = 16,
NoAutomagicSerialization = 32,
DisableDynamicBinding = 64,
+ NoRefEmitHelpers = 128,
}
#if !STUB_GENERATOR
abstract class TypeWrapperFactory
{
internal abstract ModuleBuilder ModuleBuilder { get; }
- internal abstract TypeWrapper DefineClassImpl(Dictionary types, ClassFile f, ClassLoaderWrapper classLoader, ProtectionDomain protectionDomain);
+ internal abstract TypeWrapper DefineClassImpl(Dictionary types, TypeWrapper host, ClassFile f, ClassLoaderWrapper classLoader, ProtectionDomain protectionDomain);
internal abstract bool ReserveName(string name);
internal abstract string AllocMangledName(DynamicTypeWrapper tw);
internal abstract Type DefineUnloadable(string name);
+ internal abstract Type DefineDelegate(int parameterCount, bool returnVoid);
internal abstract bool HasInternalAccess { get; }
#if CLASSGC
internal abstract void AddInternalsVisibleTo(Assembly friend);
@@ -293,6 +295,50 @@ namespace IKVM.Internal
}
}
+ internal bool EmitNoRefEmitHelpers
+ {
+ get
+ {
+ return (codegenoptions & CodeGenOptions.NoRefEmitHelpers) != 0;
+ }
+ }
+
+ internal bool WorkaroundAbstractMethodWidening
+ {
+ get
+ {
+ // pre-Roslyn C# compiler doesn't like widening access to abstract methods
+ return true;
+ }
+ }
+
+ internal bool WorkaroundInterfaceFields
+ {
+ get
+ {
+ // pre-Roslyn C# compiler doesn't allow access to interface fields
+ return true;
+ }
+ }
+
+ internal bool WorkaroundInterfacePrivateMethods
+ {
+ get
+ {
+ // pre-Roslyn C# compiler doesn't like interfaces that have non-public methods
+ return true;
+ }
+ }
+
+ internal bool WorkaroundInterfaceStaticMethods
+ {
+ get
+ {
+ // pre-Roslyn C# compiler doesn't allow access to interface static methods
+ return true;
+ }
+ }
+
#if !STATIC_COMPILER && !STUB_GENERATOR
internal bool RelaxedClassNameValidation
{
@@ -307,6 +353,14 @@ namespace IKVM.Internal
}
#endif // !STATIC_COMPILER && !STUB_GENERATOR
+ protected virtual void CheckProhibitedPackage(string className)
+ {
+ if (className.StartsWith("java.", StringComparison.Ordinal))
+ {
+ throw new JavaSecurityException("Prohibited package name: " + className.Substring(0, className.LastIndexOf('.')));
+ }
+ }
+
#if !STUB_GENERATOR
internal TypeWrapper DefineClass(ClassFile f, ProtectionDomain protectionDomain)
{
@@ -334,6 +388,7 @@ namespace IKVM.Internal
return RegisterInitiatingLoader(tw);
}
#endif
+ CheckProhibitedPackage(f.Name);
// check if the class already exists if we're an AssemblyClassLoader
if(FindLoadedClassLazy(f.Name) != null)
{
@@ -365,7 +420,7 @@ namespace IKVM.Internal
}
try
{
- return GetTypeWrapperFactory().DefineClassImpl(types, f, this, protectionDomain);
+ return GetTypeWrapperFactory().DefineClassImpl(types, null, f, this, protectionDomain);
}
finally
{
@@ -775,15 +830,6 @@ namespace IKVM.Internal
}
#endif
- internal TypeWrapper ExpressionTypeWrapper(string type)
- {
- Debug.Assert(!type.StartsWith("Lret;"));
- Debug.Assert(type != "Lnull");
-
- int index = 0;
- return SigDecoderWrapper(ref index, type, false);
- }
-
// NOTE this exposes potentially unfinished types
internal Type[] ArgTypeListFromSig(string sig)
{
@@ -802,7 +848,7 @@ namespace IKVM.Internal
private TypeWrapper SigDecoderLoadClass(string name, bool nothrow)
{
- return nothrow ? LoadClassNoThrow(this, name) : LoadClassByDottedName(name);
+ return nothrow ? LoadClassNoThrow(this, name, false) : LoadClassByDottedName(name);
}
// NOTE: this will ignore anything following the sig marker (so that it can be used to decode method signatures)
@@ -1038,16 +1084,40 @@ namespace IKVM.Internal
{
Assembly asm = type.Assembly;
#if CLASSGC
- ClassLoaderWrapper loader;
+ ClassLoaderWrapper loader = null;
if(dynamicAssemblies != null && dynamicAssemblies.TryGetValue(asm, out loader))
{
lock(loader.typeToTypeWrapper)
{
- return loader.typeToTypeWrapper[type];
+ TypeWrapper tw;
+ if(loader.typeToTypeWrapper.TryGetValue(type, out tw))
+ {
+ return tw;
+ }
+ // it must be an anonymous type then
+ Debug.Assert(AnonymousTypeWrapper.IsAnonymous(type));
}
}
#endif
#if !STATIC_COMPILER && !STUB_GENERATOR
+ if(AnonymousTypeWrapper.IsAnonymous(type))
+ {
+ Dictionary typeToTypeWrapper;
+#if CLASSGC
+ typeToTypeWrapper = loader != null ? loader.typeToTypeWrapper : globalTypeToTypeWrapper;
+#else
+ typeToTypeWrapper = globalTypeToTypeWrapper;
+#endif
+ TypeWrapper tw = new AnonymousTypeWrapper(type);
+ lock(typeToTypeWrapper)
+ {
+ if(!typeToTypeWrapper.TryGetValue(type, out wrapper))
+ {
+ typeToTypeWrapper.Add(type, wrapper = tw);
+ }
+ }
+ return wrapper;
+ }
if(ReflectUtil.IsReflectionOnly(type))
{
// historically we've always returned null for types that don't have a corresponding TypeWrapper (or java.lang.Class)
@@ -1340,7 +1410,7 @@ namespace IKVM.Internal
}
#endif
- internal static TypeWrapper LoadClassNoThrow(ClassLoaderWrapper classLoader, string name)
+ internal static TypeWrapper LoadClassNoThrow(ClassLoaderWrapper classLoader, string name, bool issueWarning)
{
try
{
@@ -1355,7 +1425,10 @@ namespace IKVM.Internal
elementTypeName = elementTypeName.Substring(skip, elementTypeName.Length - skip - 1);
}
#if STATIC_COMPILER
- classLoader.IssueMessage(Message.ClassNotFound, elementTypeName);
+ if (issueWarning || classLoader.WarningLevelHigh)
+ {
+ classLoader.IssueMessage(Message.ClassNotFound, elementTypeName);
+ }
#else
Tracer.Error(Tracer.ClassLoading, "Class not found: {0}", elementTypeName);
#endif
@@ -1413,6 +1486,54 @@ namespace IKVM.Internal
}
#endif
}
+
+#if !STUB_GENERATOR
+ internal ClassFileParseOptions ClassFileParseOptions
+ {
+ get
+ {
+#if STATIC_COMPILER
+ ClassFileParseOptions cfp = ClassFileParseOptions.LocalVariableTable;
+ if (EmitStackTraceInfo)
+ {
+ cfp |= ClassFileParseOptions.LineNumberTable;
+ }
+ if (bootstrapClassLoader is CompilerClassLoader)
+ {
+ cfp |= ClassFileParseOptions.TrustedAnnotations;
+ }
+ return cfp;
+#else
+ ClassFileParseOptions cfp = ClassFileParseOptions.LineNumberTable;
+ if (EmitDebugInfo)
+ {
+ cfp |= ClassFileParseOptions.LocalVariableTable;
+ }
+ if (RelaxedClassNameValidation)
+ {
+ cfp |= ClassFileParseOptions.RelaxedClassNameValidation;
+ }
+ if (this == bootstrapClassLoader)
+ {
+ cfp |= ClassFileParseOptions.TrustedAnnotations;
+ }
+ return cfp;
+#endif
+ }
+ }
+#endif
+
+#if STATIC_COMPILER
+ internal virtual bool WarningLevelHigh
+ {
+ get { return false; }
+ }
+
+ internal virtual bool NoParameterReflection
+ {
+ get { return false; }
+ }
+#endif
}
sealed class GenericClassLoaderWrapper : ClassLoaderWrapper
@@ -1495,7 +1616,7 @@ namespace IKVM.Internal
if (name.EndsWith(".class", StringComparison.Ordinal) && name.IndexOf('.') == name.Length - 6)
{
TypeWrapper tw = FindLoadedClass(name.Substring(0, name.Length - 6).Replace('/', '.'));
- if (tw != null && !tw.IsArray && !(tw is DynamicTypeWrapper))
+ if (tw != null && !tw.IsArray && !tw.IsDynamic)
{
ClassLoaderWrapper loader = tw.GetClassLoader();
if (loader is GenericClassLoaderWrapper)
@@ -1521,7 +1642,7 @@ namespace IKVM.Internal
if (name.EndsWith(".class", StringComparison.Ordinal) && name.IndexOf('.') == name.Length - 6)
{
TypeWrapper tw = FindLoadedClass(name.Substring(0, name.Length - 6).Replace('/', '.'));
- if (tw != null && tw.GetClassLoader() == this && !tw.IsArray && !(tw is DynamicTypeWrapper))
+ if (tw != null && tw.GetClassLoader() == this && !tw.IsArray && !tw.IsDynamic)
{
return new java.net.URL("ikvmres", "gen", ClassLoaderWrapper.GetGenericClassLoaderId(this), "/" + name);
}
diff --git a/external/ikvm/runtime/DotNetTypeWrapper.cs b/external/ikvm/runtime/DotNetTypeWrapper.cs
index 94e699388d..657a1d46d5 100644
--- a/external/ikvm/runtime/DotNetTypeWrapper.cs
+++ b/external/ikvm/runtime/DotNetTypeWrapper.cs
@@ -272,7 +272,7 @@ namespace IKVM.Internal
{
return false;
}
- if (type.Assembly == IKVM.NativeCode.java.lang.SecurityManager.jniAssembly)
+ if (type.Assembly == Java_java_lang_SecurityManager.jniAssembly)
{
return false;
}
@@ -359,7 +359,7 @@ namespace IKVM.Internal
this.baseWrapper = baseWrapper;
}
- internal override TypeWrapper BaseTypeWrapper
+ internal sealed override TypeWrapper BaseTypeWrapper
{
get { return baseWrapper; }
}
@@ -368,6 +368,11 @@ namespace IKVM.Internal
{
get { return true; }
}
+
+ internal sealed override Modifiers ReflectiveModifiers
+ {
+ get { return Modifiers | Modifiers.Static; }
+ }
}
private sealed class DelegateInnerClassTypeWrapper : FakeTypeWrapper
@@ -450,16 +455,21 @@ namespace IKVM.Internal
{
get { return true; }
}
+
+ internal override MethodParametersEntry[] GetMethodParameters(MethodWrapper mw)
+ {
+ return DeclaringTypeWrapper.GetMethodParameters(DeclaringTypeWrapper.GetMethodWrapper(mw.Name, mw.Signature, false));
+ }
}
- private class DynamicOnlyMethodWrapper : MethodWrapper, ICustomInvoke
+ private class DynamicOnlyMethodWrapper : MethodWrapper
{
internal DynamicOnlyMethodWrapper(TypeWrapper declaringType, string name, string sig, TypeWrapper returnType, TypeWrapper[] parameterTypes, MemberFlags flags)
: base(declaringType, name, sig, null, returnType, parameterTypes, Modifiers.Public | Modifiers.Abstract, flags)
{
}
- internal override bool IsDynamicOnly
+ internal sealed override bool IsDynamicOnly
{
get
{
@@ -468,7 +478,8 @@ namespace IKVM.Internal
}
#if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
- object ICustomInvoke.Invoke(object obj, object[] args)
+ [HideFromJava]
+ internal sealed override object Invoke(object obj, object[] args)
{
// a DynamicOnlyMethodWrapper is an interface method, but now that we've been called on an actual object instance,
// we can resolve to a real method and call that instead
@@ -482,14 +493,9 @@ namespace IKVM.Internal
{
throw new java.lang.IllegalAccessError(tw.Name + "." + this.Name + this.Signature);
}
- if (mw.HasCallerID)
- {
- // an interface method cannot require a CallerID
- throw new InvalidOperationException();
- }
- java.lang.reflect.Method m = (java.lang.reflect.Method)mw.ToMethodOrConstructor(true);
- m.@override = true;
- return m.invoke(obj, args, null);
+ mw.Link();
+ mw.ResolveMethod();
+ return mw.Invoke(obj, args);
}
#endif // !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
}
@@ -508,10 +514,10 @@ namespace IKVM.Internal
#endif
}
-#if !STATIC_COMPILER && !STUB_GENERATOR
+#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
internal object GetUnspecifiedValue()
{
- return ((EnumFieldWrapper)GetFieldWrapper("__unspecified", this.SigName)).GetValue();
+ return GetFieldWrapper("__unspecified", this.SigName).GetValue(null);
}
#endif
@@ -530,8 +536,8 @@ namespace IKVM.Internal
#endif
}
-#if !STATIC_COMPILER && !STUB_GENERATOR
- internal object GetValue()
+#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
+ internal override object GetValue(object obj)
{
if (val == null)
{
@@ -539,9 +545,13 @@ namespace IKVM.Internal
}
return val;
}
+
+ internal override void SetValue(object obj, object value)
+ {
+ }
#endif
-#if !STUB_GENERATOR
+#if EMITTERS
protected override void EmitGetImpl(CodeEmitter ilgen)
{
#if STATIC_COMPILER
@@ -556,10 +566,10 @@ namespace IKVM.Internal
protected override void EmitSetImpl(CodeEmitter ilgen)
{
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
- private sealed class EnumValuesMethodWrapper : MethodWrapper, ICustomInvoke
+ private sealed class EnumValuesMethodWrapper : MethodWrapper
{
internal EnumValuesMethodWrapper(TypeWrapper declaringType)
: base(declaringType, "values", "()[" + declaringType.SigName, null, declaringType.MakeArrayType(1), TypeWrapper.EmptyArray, Modifiers.Public | Modifiers.Static, MemberFlags.None)
@@ -575,20 +585,20 @@ namespace IKVM.Internal
}
#if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
- object ICustomInvoke.Invoke(object obj, object[] args)
+ internal override object Invoke(object obj, object[] args)
{
FieldWrapper[] values = this.DeclaringType.GetFields();
object[] array = (object[])Array.CreateInstance(this.DeclaringType.TypeAsArrayType, values.Length);
for (int i = 0; i < values.Length; i++)
{
- array[i] = ((EnumFieldWrapper)values[i]).GetValue();
+ array[i] = values[i].GetValue(null);
}
return array;
}
#endif // !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
}
- private sealed class EnumValueOfMethodWrapper : MethodWrapper, ICustomInvoke
+ private sealed class EnumValueOfMethodWrapper : MethodWrapper
{
internal EnumValueOfMethodWrapper(TypeWrapper declaringType)
: base(declaringType, "valueOf", "(Ljava.lang.String;)" + declaringType.SigName, null, declaringType, new TypeWrapper[] { CoreClasses.java.lang.String.Wrapper }, Modifiers.Public | Modifiers.Static, MemberFlags.None)
@@ -604,14 +614,14 @@ namespace IKVM.Internal
}
#if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
- object ICustomInvoke.Invoke(object obj, object[] args)
+ internal override object Invoke(object obj, object[] args)
{
FieldWrapper[] values = this.DeclaringType.GetFields();
for (int i = 0; i < values.Length; i++)
{
if (values[i].Name.Equals(args[0]))
{
- return ((EnumFieldWrapper)values[i]).GetValue();
+ return values[i].GetValue(null);
}
}
throw new java.lang.IllegalArgumentException("" + args[0]);
@@ -1800,7 +1810,7 @@ namespace IKVM.Internal
this.iface = iface;
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override bool EmitIntrinsic(EmitIntrinsicContext context)
{
TypeWrapper targetType = context.GetStackTypeWrapper(0, 0);
@@ -1851,7 +1861,7 @@ namespace IKVM.Internal
ilgen.Emit(OpCodes.Call, ByteCodeHelperMethods.DynamicCreateDelegate);
ilgen.Emit(OpCodes.Castclass, delegateConstructor.DeclaringType);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
private sealed class ByRefMethodWrapper : SmartMethodWrapper
@@ -1870,7 +1880,7 @@ namespace IKVM.Internal
#endif
}
-#if !STUB_GENERATOR
+#if EMITTERS
protected override void CallImpl(CodeEmitter ilgen)
{
ConvertByRefArgs(ilgen);
@@ -1912,7 +1922,7 @@ namespace IKVM.Internal
}
}
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
private sealed class EnumWrapMethodWrapper : MethodWrapper
@@ -1922,14 +1932,21 @@ namespace IKVM.Internal
{
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitCall(CodeEmitter ilgen)
{
// We don't actually need to do anything here!
// The compiler will insert a boxing operation after calling us and that will
// result in our argument being boxed (since that's still sitting on the stack).
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
+
+#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
+ internal override object Invoke(object obj, object[] args)
+ {
+ return Enum.ToObject(DeclaringType.TypeAsTBD, args[0]);
+ }
+#endif
}
internal sealed class EnumValueFieldWrapper : FieldWrapper
@@ -1942,7 +1959,7 @@ namespace IKVM.Internal
underlyingType = EnumHelper.GetUnderlyingType(tw.type);
}
-#if !STUB_GENERATOR
+#if EMITTERS
protected override void EmitGetImpl(CodeEmitter ilgen)
{
// NOTE if the reference on the stack is null, we *want* the NullReferenceException, so we don't use TypeWrapper.EmitUnbox
@@ -1960,7 +1977,19 @@ namespace IKVM.Internal
ilgen.Emit(OpCodes.Stobj, underlyingType);
ilgen.ReleaseTempLocal(temp);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
+
+#if !STUB_GENERATOR && !STATIC_COMPILER && !FIRST_PASS
+ internal override object GetValue(object obj)
+ {
+ return obj;
+ }
+
+ internal override void SetValue(object obj, object value)
+ {
+ obj.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance)[0].SetValue(obj, value);
+ }
+#endif
}
private sealed class ValueTypeDefaultCtor : MethodWrapper
@@ -1970,14 +1999,21 @@ namespace IKVM.Internal
{
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitNewobj(CodeEmitter ilgen)
{
CodeEmitterLocal local = ilgen.DeclareLocal(DeclaringType.TypeAsTBD);
ilgen.Emit(OpCodes.Ldloc, local);
ilgen.Emit(OpCodes.Box, DeclaringType.TypeAsTBD);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
+
+#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
+ internal override object CreateInstance(object[] args)
+ {
+ return Activator.CreateInstance(DeclaringType.TypeAsTBD);
+ }
+#endif
}
private sealed class FinalizeMethodWrapper : MethodWrapper
@@ -1987,7 +2023,7 @@ namespace IKVM.Internal
{
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitCall(CodeEmitter ilgen)
{
ilgen.Emit(OpCodes.Pop);
@@ -1997,7 +2033,7 @@ namespace IKVM.Internal
{
ilgen.Emit(OpCodes.Pop);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
private sealed class CloneMethodWrapper : MethodWrapper
@@ -2007,7 +2043,7 @@ namespace IKVM.Internal
{
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitCall(CodeEmitter ilgen)
{
ilgen.Emit(OpCodes.Dup);
@@ -2027,7 +2063,7 @@ namespace IKVM.Internal
{
EmitCall(ilgen);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
protected override void LazyPublishMembers()
@@ -2269,9 +2305,7 @@ namespace IKVM.Internal
&& !typeof(java.io.Serializable.__Interface).IsAssignableFrom(type)
&& !methodsList.ContainsKey("writeReplace()Ljava.lang.Object;"))
{
- methodsList.Add("writeReplace()Ljava.lang.Object;", new SimpleCallMethodWrapper(this, "writeReplace", "()Ljava.lang.Object;",
- typeof(ikvm.@internal.Serialization).GetMethod("writeReplace"), CoreClasses.java.lang.Object.Wrapper, TypeWrapper.EmptyArray,
- Modifiers.Private, MemberFlags.None, SimpleOpCode.Call, SimpleOpCode.Call));
+ methodsList.Add("writeReplace()Ljava.lang.Object;", new ExceptionWriteReplaceMethodWrapper(this));
}
#endif // !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
@@ -2281,6 +2315,31 @@ namespace IKVM.Internal
}
}
+#if !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
+ private sealed class ExceptionWriteReplaceMethodWrapper : MethodWrapper
+ {
+ internal ExceptionWriteReplaceMethodWrapper(TypeWrapper declaringType)
+ : base(declaringType, "writeReplace", "()Ljava.lang.Object;", null, CoreClasses.java.lang.Object.Wrapper, TypeWrapper.EmptyArray, Modifiers.Private, MemberFlags.None)
+ {
+ }
+
+ internal override bool IsDynamicOnly
+ {
+ get { return true; }
+ }
+
+ internal override object Invoke(object obj, object[] args)
+ {
+ Exception x = (Exception)obj;
+ com.sun.xml.@internal.ws.developer.ServerSideException sse
+ = new com.sun.xml.@internal.ws.developer.ServerSideException(ikvm.extensions.ExtensionMethods.getClass(x).getName(), x.Message);
+ sse.initCause(x.InnerException);
+ sse.setStackTrace(ikvm.extensions.ExtensionMethods.getStackTrace(x));
+ return sse;
+ }
+ }
+#endif // !STATIC_COMPILER && !STUB_GENERATOR && !FIRST_PASS
+
private void InterfaceMethodStubHelper(Dictionary methodsList, MethodBase method, string name, string sig, TypeWrapper[] args, TypeWrapper ret)
{
string key = name + sig;
@@ -2317,7 +2376,7 @@ namespace IKVM.Internal
{
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitCall(CodeEmitter ilgen)
{
// we direct EmitCall to EmitCallvirt, because we always want to end up at the instancehelper method
@@ -2329,7 +2388,7 @@ namespace IKVM.Internal
{
m.EmitCallvirt(ilgen);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
}
internal static bool IsUnsupportedAbstractMethod(MethodBase mb)
@@ -2362,7 +2421,11 @@ namespace IKVM.Internal
}
type = type.GetElementType();
}
+#if STATIC_COMPILER || STUB_GENERATOR
+ return type.__IsFunctionPointer;
+#else
return false;
+#endif
}
private bool MakeMethodDescriptor(MethodBase mb, out string name, out string sig, out TypeWrapper[] args, out TypeWrapper ret)
@@ -2493,12 +2556,12 @@ namespace IKVM.Internal
foreach (ParameterInfo p in invoke.GetParameters())
{
// we don't support delegates with pointer parameters
- if (p.ParameterType.IsPointer)
+ if (IsPointerType(p.ParameterType))
{
return false;
}
}
- return true;
+ return !IsPointerType(invoke.ReturnType);
}
}
return false;
@@ -2668,7 +2731,7 @@ namespace IKVM.Internal
}
}
-#if !STUB_GENERATOR
+#if EMITTERS
internal override void EmitInstanceOf(CodeEmitter ilgen)
{
if (IsRemapped)
@@ -2698,7 +2761,7 @@ namespace IKVM.Internal
}
ilgen.EmitCastclass(type);
}
-#endif // !STUB_GENERATOR
+#endif // EMITTERS
internal override void Finish()
{
@@ -2726,6 +2789,38 @@ namespace IKVM.Internal
finished = true;
}
+ internal override MethodParametersEntry[] GetMethodParameters(MethodWrapper mw)
+ {
+ MethodBase mb = mw.GetMethod();
+ if (mb == null)
+ {
+ return null;
+ }
+ ParameterInfo[] parameters = mb.GetParameters();
+ if (parameters.Length == 0)
+ {
+ return null;
+ }
+ MethodParametersEntry[] mp = new MethodParametersEntry[parameters.Length];
+ bool hasName = false;
+ for (int i = 0; i < mp.Length; i++)
+ {
+ string name = parameters[i].Name;
+ bool empty = String.IsNullOrEmpty(name);
+ if (empty)
+ {
+ name = "arg" + i;
+ }
+ mp[i].name = name;
+ hasName |= !empty;
+ }
+ if (!hasName)
+ {
+ return null;
+ }
+ return mp;
+ }
+
#if !STATIC_COMPILER && !STUB_GENERATOR
internal override object[] GetDeclaredAnnotations()
{
@@ -2780,6 +2875,10 @@ namespace IKVM.Internal
// (i.e. injected into the assembly)
internal override bool IsPackageAccessibleFrom(TypeWrapper wrapper)
{
+ if (wrapper == DeclaringTypeWrapper)
+ {
+ return true;
+ }
if (!base.IsPackageAccessibleFrom(wrapper))
{
return false;
diff --git a/external/ikvm/runtime/DynamicClassLoader.cs b/external/ikvm/runtime/DynamicClassLoader.cs
index 593080584a..e31fbc768b 100644
--- a/external/ikvm/runtime/DynamicClassLoader.cs
+++ b/external/ikvm/runtime/DynamicClassLoader.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2013 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -62,6 +62,7 @@ namespace IKVM.Internal
#endif // STATIC_COMPILER
private Dictionary unloadables;
private TypeBuilder unloadableContainer;
+ private Type[] delegates;
#if !STATIC_COMPILER && !CLASSGC
private static DynamicClassLoader instance = new DynamicClassLoader(CreateModuleBuilder(), false);
#endif
@@ -222,21 +223,29 @@ namespace IKVM.Internal
return mangledTypeName;
}
- internal sealed override TypeWrapper DefineClassImpl(Dictionary types, ClassFile f, ClassLoaderWrapper classLoader, ProtectionDomain protectionDomain)
+ internal sealed override TypeWrapper DefineClassImpl(Dictionary types, TypeWrapper host, ClassFile f, ClassLoaderWrapper classLoader, ProtectionDomain protectionDomain)
{
#if STATIC_COMPILER
AotTypeWrapper type = new AotTypeWrapper(f, (CompilerClassLoader)classLoader);
type.CreateStep1();
types[f.Name] = type;
return type;
+#elif FIRST_PASS
+ return null;
#else
// this step can throw a retargettable exception, if the class is incorrect
- DynamicTypeWrapper type = new DynamicTypeWrapper(f, classLoader, protectionDomain);
+ DynamicTypeWrapper type = new DynamicTypeWrapper(host, f, classLoader, protectionDomain);
// This step actually creates the TypeBuilder. It is not allowed to throw any exceptions,
// if an exception does occur, it is due to a programming error in the IKVM or CLR runtime
// and will cause a CriticalFailure and exit the process.
type.CreateStep1();
type.CreateStep2();
+ if(types == null)
+ {
+ // we're defining an anonymous class, so we don't need any locking
+ TieClassAndWrapper(type, protectionDomain);
+ return type;
+ }
lock(types)
{
// in very extreme conditions another thread may have beaten us to it
@@ -248,16 +257,7 @@ namespace IKVM.Internal
if(race == null)
{
types[f.Name] = type;
-#if !FIRST_PASS
- java.lang.Class clazz = new java.lang.Class(null);
-#if __MonoCS__
- TypeWrapper.SetTypeWrapperHack(clazz, type);
-#else
- clazz.typeWrapper = type;
-#endif
- clazz.pd = protectionDomain;
- type.SetClassObject(clazz);
-#endif
+ TieClassAndWrapper(type, protectionDomain);
}
else
{
@@ -268,42 +268,37 @@ namespace IKVM.Internal
#endif // STATIC_COMPILER
}
+#if !STATIC_COMPILER && !FIRST_PASS
+ private static java.lang.Class TieClassAndWrapper(TypeWrapper type, ProtectionDomain protectionDomain)
+ {
+ java.lang.Class clazz = new java.lang.Class(null);
+#if __MonoCS__
+ TypeWrapper.SetTypeWrapperHack(clazz, type);
+#else
+ clazz.typeWrapper = type;
+#endif
+ clazz.pd = protectionDomain;
+ type.SetClassObject(clazz);
+ return clazz;
+ }
+#endif
+
#if STATIC_COMPILER
- internal TypeBuilder DefineProxy(TypeWrapper proxyClass, TypeWrapper[] interfaces)
+ internal TypeBuilder DefineProxy(string name, TypeAttributes typeAttributes, Type parent, Type[] interfaces)
{
if (proxiesContainer == null)
{
- proxiesContainer = moduleBuilder.DefineType("__", TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed | TypeAttributes.Abstract);
+ proxiesContainer = moduleBuilder.DefineType(TypeNameUtil.ProxiesContainer, TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed | TypeAttributes.Abstract);
AttributeHelper.HideFromJava(proxiesContainer);
AttributeHelper.SetEditorBrowsableNever(proxiesContainer);
proxies = new List();
}
- Type[] ifaces = new Type[interfaces.Length];
- for (int i = 0; i < ifaces.Length; i++)
- {
- ifaces[i] = interfaces[i].TypeAsBaseType;
- }
- TypeBuilder tb = proxiesContainer.DefineNestedType(GetProxyNestedName(interfaces), TypeAttributes.NestedPublic | TypeAttributes.Class | TypeAttributes.Sealed, proxyClass.TypeAsBaseType, ifaces);
+ TypeBuilder tb = proxiesContainer.DefineNestedType(name, typeAttributes, parent, interfaces);
proxies.Add(tb);
return tb;
}
#endif
- private static string GetProxyNestedName(TypeWrapper[] interfaces)
- {
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- foreach (TypeWrapper tw in interfaces)
- {
- sb.Append(tw.Name.Length).Append('|').Append(tw.Name);
- }
- return TypeNameUtil.MangleNestedTypeName(sb.ToString());
- }
-
- internal static string GetProxyName(TypeWrapper[] interfaces)
- {
- return "__+" + GetProxyNestedName(interfaces);
- }
-
internal override Type DefineUnloadable(string name)
{
lock(this)
@@ -328,6 +323,47 @@ namespace IKVM.Internal
}
}
+ internal override Type DefineDelegate(int parameterCount, bool returnVoid)
+ {
+ lock (this)
+ {
+ if (delegates == null)
+ {
+ delegates = new Type[512];
+ }
+ int index = parameterCount + (returnVoid ? 256 : 0);
+ Type type = delegates[index];
+ if (type != null)
+ {
+ return type;
+ }
+ TypeBuilder tb = moduleBuilder.DefineType(returnVoid ? "__<>NVIV`" + parameterCount : "__<>NVI`" + (parameterCount + 1), TypeAttributes.NotPublic | TypeAttributes.Sealed, Types.MulticastDelegate);
+ string[] names = new string[parameterCount + (returnVoid ? 0 : 1)];
+ for (int i = 0; i < names.Length; i++)
+ {
+ names[i] = "P" + i;
+ }
+ if (!returnVoid)
+ {
+ names[names.Length - 1] = "R";
+ }
+ Type[] genericParameters = tb.DefineGenericParameters(names);
+ Type[] parameterTypes = genericParameters;
+ if (!returnVoid)
+ {
+ parameterTypes = new Type[genericParameters.Length - 1];
+ Array.Copy(genericParameters, parameterTypes, parameterTypes.Length);
+ }
+ tb.DefineMethod(ConstructorInfo.ConstructorName, MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, Types.Void, new Type[] { Types.Object, Types.IntPtr })
+ .SetImplementationFlags(MethodImplAttributes.Runtime);
+ MethodBuilder mb = tb.DefineMethod("Invoke", MethodAttributes.Public | MethodAttributes.NewSlot | MethodAttributes.Virtual, returnVoid ? Types.Void : genericParameters[genericParameters.Length - 1], parameterTypes);
+ mb.SetImplementationFlags(MethodImplAttributes.Runtime);
+ type = tb.CreateType();
+ delegates[index] = type;
+ return type;
+ }
+ }
+
internal override bool HasInternalAccess
{
get { return hasInternalAccess; }
@@ -403,7 +439,7 @@ namespace IKVM.Internal
{
AssemblyName name = new AssemblyName();
name.Name = "jniproxy";
- jniProxyAssemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.RunAndSave, null, null, null, null, null, true);
+ jniProxyAssemblyBuilder = DefineDynamicAssembly(name, AssemblyBuilderAccess.RunAndSave, null);
return jniProxyAssemblyBuilder.DefineDynamicModule("jniproxy.dll", "jniproxy.dll");
}
#endif
@@ -544,12 +580,7 @@ namespace IKVM.Internal
attribs.Add(new CustomAttributeBuilder(typeof(System.Security.SecurityTransparentAttribute).GetConstructor(Type.EmptyTypes), new object[0]));
}
#endif
- AssemblyBuilder assemblyBuilder =
-#if NET_4_0
- AppDomain.CurrentDomain.DefineDynamicAssembly(name, access, null, true, attribs);
-#else
- AppDomain.CurrentDomain.DefineDynamicAssembly(name, access, null, null, null, null, null, true, attribs);
-#endif
+ AssemblyBuilder assemblyBuilder = DefineDynamicAssembly(name, access, attribs);
AttributeHelper.SetRuntimeCompatibilityAttribute(assemblyBuilder);
bool debug = JVM.EmitSymbols;
CustomAttributeBuilder debugAttr = new CustomAttributeBuilder(typeof(DebuggableAttribute).GetConstructor(new Type[] { typeof(bool), typeof(bool) }), new object[] { true, debug });
@@ -558,6 +589,15 @@ namespace IKVM.Internal
moduleBuilder.SetCustomAttribute(new CustomAttributeBuilder(typeof(IKVM.Attributes.JavaModuleAttribute).GetConstructor(Type.EmptyTypes), new object[0]));
return moduleBuilder;
}
+
+ private static AssemblyBuilder DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, IEnumerable assemblyAttributes)
+ {
+#if NET_4_0
+ return AppDomain.CurrentDomain.DefineDynamicAssembly(name, access, null, true, assemblyAttributes);
+#else
+ return AppDomain.CurrentDomain.DefineDynamicAssembly(name, access, null, null, null, null, null, true, assemblyAttributes);
+#endif
+ }
#endif // !STATIC_COMPILER
}
}
diff --git a/external/ikvm/runtime/DynamicTypeWrapper.cs.REMOVED.git-id b/external/ikvm/runtime/DynamicTypeWrapper.cs.REMOVED.git-id
index 3c6b369ccb..259dba8c03 100644
--- a/external/ikvm/runtime/DynamicTypeWrapper.cs.REMOVED.git-id
+++ b/external/ikvm/runtime/DynamicTypeWrapper.cs.REMOVED.git-id
@@ -1 +1 @@
-ad0861972ed1ac0e9caf2cde6149145bd346f957
\ No newline at end of file
+c40b0a040f514f61c3bce5ca397280b4247710bf
\ No newline at end of file
diff --git a/external/ikvm/runtime/ExceptionHelper.cs b/external/ikvm/runtime/ExceptionHelper.cs
index e69ae970bf..ff40d16765 100644
--- a/external/ikvm/runtime/ExceptionHelper.cs
+++ b/external/ikvm/runtime/ExceptionHelper.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2013 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -197,13 +197,14 @@ namespace IKVM.Internal
{
StackFrame frame = st.GetFrame(i);
MethodBase m = frame.GetMethod();
- if (m == null || m.DeclaringType == null)
+ if (m == null)
{
continue;
}
Type type = m.DeclaringType;
if (cleanStackTrace &&
- (typeof(MethodBase).IsAssignableFrom(type)
+ (type == null
+ || typeof(MethodBase).IsAssignableFrom(type)
|| type == typeof(RuntimeMethodHandle)
|| (type == typeof(Throwable) && m.Name == "instancehelper_fillInStackTrace")
|| (m.Name == "ToJava" && typeof(RetargetableJavaException).IsAssignableFrom(type))
@@ -298,6 +299,14 @@ namespace IKVM.Internal
{
return mb.Name.Substring(NamePrefix.DefaultMethod.Length);
}
+ else if(mb.Name.StartsWith(NamePrefix.Bridge, StringComparison.Ordinal))
+ {
+ return mb.Name.Substring(NamePrefix.Bridge.Length);
+ }
+ else if(mb.IsSpecialName)
+ {
+ return UnicodeUtil.UnescapeInvalidSurrogates(mb.Name);
+ }
else
{
return mb.Name;
@@ -309,12 +318,17 @@ namespace IKVM.Internal
#if FIRST_PASS
return false;
#else
- return Java_sun_reflect_Reflection.IsHideFromJava(mb) || (mb.DeclaringType == typeof(ikvm.runtime.Util) && mb.Name == "mapException");
+ return (Java_sun_reflect_Reflection.GetHideFromJavaFlags(mb) & HideFromJavaFlags.StackTrace) != 0
+ || (mb.DeclaringType == typeof(ikvm.runtime.Util) && mb.Name == "mapException");
#endif
}
private static string getClassNameFromType(Type type)
{
+ if(type == null)
+ {
+ return "";
+ }
if(ClassLoaderWrapper.IsRemappedType(type))
{
return DotNetTypeWrapper.GetName(type);
@@ -326,6 +340,12 @@ namespace IKVM.Internal
{
return DotNetTypeWrapper.GetName(type);
}
+#if !FIRST_PASS
+ if(tw.IsUnsafeAnonymous)
+ {
+ return tw.ClassObject.getName();
+ }
+#endif
return tw.Name;
}
return type.FullName;
@@ -337,7 +357,7 @@ namespace IKVM.Internal
if(ilOffset != StackFrame.OFFSET_UNKNOWN)
{
MethodBase mb = frame.GetMethod();
- if(mb != null)
+ if(mb != null && mb.DeclaringType != null)
{
if(ClassLoaderWrapper.IsRemappedType(mb.DeclaringType))
{
@@ -356,7 +376,7 @@ namespace IKVM.Internal
private static string GetFileName(StackFrame frame)
{
MethodBase mb = frame.GetMethod();
- if(mb != null)
+ if(mb != null && mb.DeclaringType != null)
{
if(ClassLoaderWrapper.IsRemappedType(mb.DeclaringType))
{
diff --git a/external/ikvm/runtime/IKVM.Runtime.8.csproj b/external/ikvm/runtime/IKVM.Runtime.8.csproj
index 15f4814c5e..0418b8ed1e 100644
--- a/external/ikvm/runtime/IKVM.Runtime.8.csproj
+++ b/external/ikvm/runtime/IKVM.Runtime.8.csproj
@@ -36,7 +36,7 @@
false
- TRACE;DEBUG
+ TRACE;DEBUG;EMITTERStrue
@@ -87,6 +87,7 @@
Code
+ Code
@@ -94,6 +95,7 @@
Code
+ Code
@@ -120,6 +122,7 @@
Code
+ Code
@@ -141,15 +144,28 @@
Code
+ Code
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
diff --git a/external/ikvm/runtime/JavaException.cs b/external/ikvm/runtime/JavaException.cs
index e41fad7226..e2a1d8e3c2 100644
--- a/external/ikvm/runtime/JavaException.cs
+++ b/external/ikvm/runtime/JavaException.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -216,3 +216,18 @@ sealed class UnsupportedClassVersionError : ClassFormatError
}
#endif
}
+
+sealed class JavaSecurityException : RetargetableJavaException
+{
+ internal JavaSecurityException(string msg)
+ : base(msg)
+ {
+ }
+
+#if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR
+ internal override Exception ToJava()
+ {
+ return new java.lang.SecurityException(Message);
+ }
+#endif
+}
diff --git a/external/ikvm/runtime/LambdaMetafactory.cs b/external/ikvm/runtime/LambdaMetafactory.cs
new file mode 100644
index 0000000000..e3a2a31bf0
--- /dev/null
+++ b/external/ikvm/runtime/LambdaMetafactory.cs
@@ -0,0 +1,1024 @@
+/*
+ Copyright (C) 2014 Jeroen Frijters
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jeroen Frijters
+ jeroen@frijters.net
+
+*/
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+#if STATIC_COMPILER
+using IKVM.Reflection;
+using IKVM.Reflection.Emit;
+using Type = IKVM.Reflection.Type;
+#else
+using System.Reflection;
+using System.Reflection.Emit;
+#endif
+
+namespace IKVM.Internal
+{
+ sealed class LambdaMetafactory
+ {
+ private MethodBuilder ctor;
+
+ internal static bool Emit(DynamicTypeWrapper.FinishContext context, ClassFile classFile, int constantPoolIndex, ClassFile.ConstantPoolItemInvokeDynamic cpi, CodeEmitter ilgen)
+ {
+ ClassFile.BootstrapMethod bsm = classFile.GetBootstrapMethod(cpi.BootstrapMethod);
+ if (!IsLambdaMetafactory(classFile, bsm) && !IsLambdaAltMetafactory(classFile, bsm))
+ {
+ return false;
+ }
+ LambdaMetafactory lmf = context.GetValue(constantPoolIndex);
+ if (lmf.ctor == null && !lmf.EmitImpl(context, classFile, cpi, bsm, ilgen))
+ {
+#if STATIC_COMPILER
+ if (context.TypeWrapper.GetClassLoader().DisableDynamicBinding)
+ {
+ StaticCompiler.IssueMessage(Message.UnableToCreateLambdaFactory);
+ }
+#endif
+ return false;
+ }
+ ilgen.Emit(OpCodes.Newobj, lmf.ctor);
+ // the CLR verification rules about type merging mean we have to explicitly cast to the interface type here
+ ilgen.Emit(OpCodes.Castclass, cpi.GetRetType().TypeAsBaseType);
+ return true;
+ }
+
+ private bool EmitImpl(DynamicTypeWrapper.FinishContext context, ClassFile classFile, ClassFile.ConstantPoolItemInvokeDynamic cpi, ClassFile.BootstrapMethod bsm, CodeEmitter ilgen)
+ {
+ if (HasUnloadable(cpi))
+ {
+ Fail("cpi has unloadable");
+ return false;
+ }
+ bool serializable = false;
+ TypeWrapper[] markers = TypeWrapper.EmptyArray;
+ ClassFile.ConstantPoolItemMethodType[] bridges = null;
+ if (bsm.ArgumentCount > 3)
+ {
+ AltFlags flags = (AltFlags)classFile.GetConstantPoolConstantInteger(bsm.GetArgument(3));
+ serializable = (flags & AltFlags.Serializable) != 0;
+ int argpos = 4;
+ if ((flags & AltFlags.Markers) != 0)
+ {
+ markers = new TypeWrapper[classFile.GetConstantPoolConstantInteger(bsm.GetArgument(argpos++))];
+ for (int i = 0; i < markers.Length; i++)
+ {
+ if ((markers[i] = classFile.GetConstantPoolClassType(bsm.GetArgument(argpos++))).IsUnloadable)
+ {
+ Fail("unloadable marker");
+ return false;
+ }
+ }
+ }
+ if ((flags & AltFlags.Bridges) != 0)
+ {
+ bridges = new ClassFile.ConstantPoolItemMethodType[classFile.GetConstantPoolConstantInteger(bsm.GetArgument(argpos++))];
+ for (int i = 0; i < bridges.Length; i++)
+ {
+ bridges[i] = classFile.GetConstantPoolConstantMethodType(bsm.GetArgument(argpos++));
+ if (HasUnloadable(bridges[i]))
+ {
+ Fail("unloadable bridge");
+ return false;
+ }
+ }
+ }
+ }
+ ClassFile.ConstantPoolItemMethodType samMethodType = classFile.GetConstantPoolConstantMethodType(bsm.GetArgument(0));
+ ClassFile.ConstantPoolItemMethodHandle implMethod = classFile.GetConstantPoolConstantMethodHandle(bsm.GetArgument(1));
+ ClassFile.ConstantPoolItemMethodType instantiatedMethodType = classFile.GetConstantPoolConstantMethodType(bsm.GetArgument(2));
+ if (HasUnloadable(samMethodType)
+ || HasUnloadable((ClassFile.ConstantPoolItemMI)implMethod.MemberConstantPoolItem)
+ || HasUnloadable(instantiatedMethodType))
+ {
+ Fail("bsm args has unloadable");
+ return false;
+ }
+ TypeWrapper interfaceType = cpi.GetRetType();
+ MethodWrapper[] methodList;
+ if (!CheckSupportedInterfaces(context.TypeWrapper, interfaceType, markers, bridges, out methodList))
+ {
+ Fail("unsupported interface");
+ return false;
+ }
+ if (serializable && Array.Exists(methodList, delegate(MethodWrapper mw) { return mw.Name == "writeReplace" && mw.Signature == "()Ljava.lang.Object;"; }))
+ {
+ Fail("writeReplace");
+ return false;
+ }
+ if (!IsSupportedImplMethod(implMethod, context.TypeWrapper, cpi.GetArgTypes(), instantiatedMethodType))
+ {
+ Fail("implMethod " + implMethod.MemberConstantPoolItem.Class + "::" + implMethod.MemberConstantPoolItem.Name + implMethod.MemberConstantPoolItem.Signature);
+ return false;
+ }
+ TypeWrapper[] implParameters = GetImplParameters(implMethod);
+ CheckConstraints(instantiatedMethodType, samMethodType, cpi.GetArgTypes(), implParameters);
+ if (bridges != null)
+ {
+ foreach (ClassFile.ConstantPoolItemMethodType bridge in bridges)
+ {
+ if (bridge.Signature == samMethodType.Signature)
+ {
+ Fail("bridge signature matches sam");
+ return false;
+ }
+ if (!CheckConstraints(instantiatedMethodType, bridge, cpi.GetArgTypes(), implParameters))
+ {
+ Fail("bridge constraints");
+ return false;
+ }
+ }
+ }
+ if (instantiatedMethodType.GetRetType() != PrimitiveTypeWrapper.VOID)
+ {
+ TypeWrapper Rt = instantiatedMethodType.GetRetType();
+ TypeWrapper Ra = GetImplReturnType(implMethod);
+ if (Ra == PrimitiveTypeWrapper.VOID || !IsAdaptable(Ra, Rt, true))
+ {
+ Fail("The return type Rt is void, or the return type Ra is not void and is adaptable to Rt");
+ return false;
+ }
+ }
+ MethodWrapper interfaceMethod = null;
+ List methods = new List();
+ foreach (MethodWrapper mw in methodList)
+ {
+ if (mw.Name == cpi.Name && mw.Signature == samMethodType.Signature)
+ {
+ interfaceMethod = mw;
+ methods.Add(mw);
+ }
+ else if (mw.IsAbstract && !IsObjectMethod(mw))
+ {
+ methods.Add(mw);
+ }
+ }
+ if (interfaceMethod == null || !interfaceMethod.IsAbstract || IsObjectMethod(interfaceMethod) || !MatchSignatures(interfaceMethod, samMethodType))
+ {
+ Fail("interfaceMethod");
+ return false;
+ }
+
+ TypeBuilder tb = context.DefineAnonymousClass();
+ // we're not implementing the interfaces recursively (because we don't care about .NET Compact anymore),
+ // but should we decide to do that, we'd need to somehow communicate to AnonymousTypeWrapper what the 'real' interface is
+ tb.AddInterfaceImplementation(interfaceType.TypeAsBaseType);
+ if (serializable && Array.IndexOf(markers, CoreClasses.java.io.Serializable.Wrapper) == -1)
+ {
+ tb.AddInterfaceImplementation(CoreClasses.java.io.Serializable.Wrapper.TypeAsBaseType);
+ }
+ foreach (TypeWrapper marker in markers)
+ {
+ tb.AddInterfaceImplementation(marker.TypeAsBaseType);
+ }
+ ctor = CreateConstructorAndDispatch(context, cpi, tb, methods, implParameters, samMethodType, implMethod, instantiatedMethodType, serializable);
+ AddDefaultInterfaceMethods(context, methodList, tb);
+ return true;
+ }
+
+ [Conditional("TRACE_LAMBDA_METAFACTORY")]
+ private static void Fail(string msg)
+ {
+ Console.WriteLine("Fail: " + msg);
+ }
+
+ private static bool CheckConstraints(ClassFile.ConstantPoolItemMethodType instantiatedMethodType, ClassFile.ConstantPoolItemMethodType methodType, TypeWrapper[] args, TypeWrapper[] implParameters)
+ {
+ if (!IsSubTypeOf(instantiatedMethodType, methodType))
+ {
+ Fail("instantiatedMethodType <= methodType");
+ return false;
+ }
+ if (args.Length + methodType.GetArgTypes().Length != implParameters.Length)
+ {
+ Fail("K + N = M");
+ return false;
+ }
+ for (int i = 0, K = args.Length; i < K; i++)
+ {
+ if (!args[i].IsSubTypeOf(implParameters[i]))
+ {
+ Fail("For i=1..K, Di = Ai");
+ return false;
+ }
+ }
+ for (int i = 0, N = methodType.GetArgTypes().Length, k = args.Length; i < N; i++)
+ {
+ if (!IsAdaptable(instantiatedMethodType.GetArgTypes()[i], implParameters[i + k], false))
+ {
+ Fail("For i=1..N, Ti is adaptable to Aj, where j=i+k");
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static TypeWrapper[] GetImplParameters(ClassFile.ConstantPoolItemMethodHandle implMethod)
+ {
+ MethodWrapper mw = (MethodWrapper)implMethod.Member;
+ TypeWrapper[] parameters = mw.GetParameters();
+ if (mw.IsStatic || mw.IsConstructor)
+ {
+ return parameters;
+ }
+ return ArrayUtil.Concat(mw.DeclaringType, parameters);
+ }
+
+ private static TypeWrapper GetImplReturnType(ClassFile.ConstantPoolItemMethodHandle implMethod)
+ {
+ return implMethod.Kind == ClassFile.RefKind.newInvokeSpecial
+ ? implMethod.Member.DeclaringType
+ : ((MethodWrapper)implMethod.Member).ReturnType;
+ }
+
+ private static bool IsAdaptable(TypeWrapper Q, TypeWrapper S, bool isReturn)
+ {
+ if (Q == S)
+ {
+ return true;
+ }
+
+ if (Q.IsPrimitive)
+ {
+ if (S.IsPrimitive)
+ {
+ // Q can be converted to S via a primitive widening conversion
+ switch (Q.SigName[0] | S.SigName[0] << 8)
+ {
+ case 'B' | 'S' << 8:
+ case 'B' | 'I' << 8:
+ case 'B' | 'J' << 8:
+ case 'B' | 'F' << 8:
+ case 'B' | 'D' << 8:
+ case 'S' | 'I' << 8:
+ case 'S' | 'J' << 8:
+ case 'S' | 'F' << 8:
+ case 'S' | 'D' << 8:
+ case 'C' | 'I' << 8:
+ case 'C' | 'J' << 8:
+ case 'C' | 'F' << 8:
+ case 'C' | 'D' << 8:
+ case 'I' | 'J' << 8:
+ case 'I' | 'F' << 8:
+ case 'I' | 'D' << 8:
+ case 'J' | 'F' << 8:
+ case 'J' | 'D' << 8:
+ case 'F' | 'D' << 8:
+ return true;
+ default:
+ return false;
+ }
+ }
+ else
+ {
+ // S is a supertype of the Wrapper(Q)
+ return GetWrapper(Q).IsAssignableTo(S);
+ }
+ }
+ else if (isReturn)
+ {
+ return true;
+ }
+ else
+ {
+ if (S.IsPrimitive)
+ {
+ // If Q is a primitive wrapper, check that Primitive(Q) can be widened to S
+ TypeWrapper primitive = GetPrimitiveFromWrapper(Q);
+ return primitive != null && IsAdaptable(primitive, S, isReturn);
+ }
+ else
+ {
+ // for parameter types: S is a supertype of Q
+ return Q.IsAssignableTo(S);
+ }
+ }
+ }
+
+ private static TypeWrapper GetWrapper(TypeWrapper primitive)
+ {
+ Debug.Assert(primitive.IsPrimitive);
+ switch (primitive.SigName[0])
+ {
+ case 'Z':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Boolean");
+ case 'B':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Byte");
+ case 'S':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Short");
+ case 'C':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Character");
+ case 'I':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Integer");
+ case 'J':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Long");
+ case 'F':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Float");
+ case 'D':
+ return ClassLoaderWrapper.LoadClassCritical("java.lang.Double");
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ private static TypeWrapper GetPrimitiveFromWrapper(TypeWrapper wrapper)
+ {
+ switch (wrapper.Name)
+ {
+ case "java.lang.Boolean":
+ return PrimitiveTypeWrapper.BOOLEAN;
+ case "java.lang.Byte":
+ return PrimitiveTypeWrapper.BYTE;
+ case "java.lang.Short":
+ return PrimitiveTypeWrapper.SHORT;
+ case "java.lang.Character":
+ return PrimitiveTypeWrapper.CHAR;
+ case "java.lang.Integer":
+ return PrimitiveTypeWrapper.INT;
+ case "java.lang.Long":
+ return PrimitiveTypeWrapper.LONG;
+ case "java.lang.Float":
+ return PrimitiveTypeWrapper.FLOAT;
+ case "java.lang.Double":
+ return PrimitiveTypeWrapper.DOUBLE;
+ default:
+ return null;
+ }
+ }
+
+ private static bool IsSubTypeOf(ClassFile.ConstantPoolItemMethodType instantiatedMethodType, ClassFile.ConstantPoolItemMethodType samMethodType)
+ {
+ TypeWrapper[] T = instantiatedMethodType.GetArgTypes();
+ TypeWrapper[] U = samMethodType.GetArgTypes();
+ if (T.Length != U.Length)
+ {
+ return false;
+ }
+ for (int i = 0; i < T.Length; i++)
+ {
+ if (!T[i].IsAssignableTo(U[i]))
+ {
+ return false;
+ }
+ }
+ TypeWrapper Rt = instantiatedMethodType.GetRetType();
+ TypeWrapper Ru = samMethodType.GetRetType();
+ return Rt.IsAssignableTo(Ru);
+ }
+
+ private static MethodBuilder CreateConstructorAndDispatch(DynamicTypeWrapper.FinishContext context, ClassFile.ConstantPoolItemInvokeDynamic cpi, TypeBuilder tb,
+ List methods, TypeWrapper[] implParameters, ClassFile.ConstantPoolItemMethodType samMethodType, ClassFile.ConstantPoolItemMethodHandle implMethod,
+ ClassFile.ConstantPoolItemMethodType instantiatedMethodType, bool serializable)
+ {
+ TypeWrapper[] args = cpi.GetArgTypes();
+
+ // captured values
+ Type[] capturedTypes = new Type[args.Length];
+ FieldBuilder[] capturedFields = new FieldBuilder[capturedTypes.Length];
+ for (int i = 0; i < capturedTypes.Length; i++)
+ {
+ capturedTypes[i] = args[i].TypeAsSignatureType;
+ FieldAttributes attr = FieldAttributes.Private;
+ if (i > 0 || !args[0].IsGhost)
+ {
+ attr |= FieldAttributes.InitOnly;
+ }
+ capturedFields[i] = tb.DefineField("arg$" + (i + 1), capturedTypes[i], attr);
+ }
+
+ // constructor
+ MethodBuilder ctor = ReflectUtil.DefineConstructor(tb, MethodAttributes.Assembly, capturedTypes);
+ CodeEmitter ilgen = CodeEmitter.Create(ctor);
+ ilgen.Emit(OpCodes.Ldarg_0);
+ ilgen.Emit(OpCodes.Call, Types.Object.GetConstructor(Type.EmptyTypes));
+ for (int i = 0; i < capturedTypes.Length; i++)
+ {
+ ilgen.EmitLdarg(0);
+ ilgen.EmitLdarg(i + 1);
+ ilgen.Emit(OpCodes.Stfld, capturedFields[i]);
+ }
+ ilgen.Emit(OpCodes.Ret);
+ ilgen.DoEmit();
+
+ // dispatch methods
+ foreach (MethodWrapper mw in methods)
+ {
+ EmitDispatch(context, args, tb, mw, implParameters, implMethod, instantiatedMethodType, capturedFields);
+ }
+
+ // writeReplace method
+ if (serializable)
+ {
+ MethodBuilder writeReplace = tb.DefineMethod("writeReplace", MethodAttributes.Private, Types.Object, Type.EmptyTypes);
+ ilgen = CodeEmitter.Create(writeReplace);
+ context.TypeWrapper.EmitClassLiteral(ilgen);
+ ilgen.Emit(OpCodes.Ldstr, cpi.GetRetType().Name.Replace('.', '/'));
+ ilgen.Emit(OpCodes.Ldstr, cpi.Name);
+ ilgen.Emit(OpCodes.Ldstr, samMethodType.Signature.Replace('.', '/'));
+ ilgen.EmitLdc_I4((int)implMethod.Kind);
+ ilgen.Emit(OpCodes.Ldstr, implMethod.Class.Replace('.', '/'));
+ ilgen.Emit(OpCodes.Ldstr, implMethod.Name);
+ ilgen.Emit(OpCodes.Ldstr, implMethod.Signature.Replace('.', '/'));
+ ilgen.Emit(OpCodes.Ldstr, instantiatedMethodType.Signature.Replace('.', '/'));
+ ilgen.EmitLdc_I4(capturedFields.Length);
+ ilgen.Emit(OpCodes.Newarr, Types.Object);
+ for (int i = 0; i < capturedFields.Length; i++)
+ {
+ ilgen.Emit(OpCodes.Dup);
+ ilgen.EmitLdc_I4(i);
+ ilgen.EmitLdarg(0);
+ ilgen.Emit(OpCodes.Ldfld, capturedFields[i]);
+ if (args[i].IsPrimitive)
+ {
+ Boxer.EmitBox(ilgen, args[i]);
+ }
+ else if (args[i].IsGhost)
+ {
+ args[i].EmitConvSignatureTypeToStackType(ilgen);
+ }
+ ilgen.Emit(OpCodes.Stelem, Types.Object);
+ }
+ MethodWrapper ctorSerializedLambda = ClassLoaderWrapper.LoadClassCritical("java.lang.invoke.SerializedLambda").GetMethodWrapper(StringConstants.INIT,
+ "(Ljava.lang.Class;Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;ILjava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;[Ljava.lang.Object;)V", false);
+ ctorSerializedLambda.Link();
+ ctorSerializedLambda.EmitNewobj(ilgen);
+ ilgen.Emit(OpCodes.Ret);
+ ilgen.DoEmit();
+
+ if (!context.TypeWrapper.GetClassLoader().NoAutomagicSerialization)
+ {
+ // add .NET serialization interop support
+ Serialization.MarkSerializable(tb);
+ Serialization.AddGetObjectData(tb);
+ }
+ }
+
+ return ctor;
+ }
+
+ private static void EmitDispatch(DynamicTypeWrapper.FinishContext context, TypeWrapper[] args, TypeBuilder tb, MethodWrapper interfaceMethod, TypeWrapper[] implParameters,
+ ClassFile.ConstantPoolItemMethodHandle implMethod, ClassFile.ConstantPoolItemMethodType instantiatedMethodType, FieldBuilder[] capturedFields)
+ {
+ MethodBuilder mb = interfaceMethod.GetDefineMethodHelper().DefineMethod(context.TypeWrapper, tb, interfaceMethod.Name, MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final);
+ if (interfaceMethod.Name != interfaceMethod.RealName)
+ {
+ tb.DefineMethodOverride(mb, (MethodInfo)interfaceMethod.GetMethod());
+ }
+ CodeEmitter ilgen = CodeEmitter.Create(mb);
+ for (int i = 0; i < capturedFields.Length; i++)
+ {
+ ilgen.EmitLdarg(0);
+ OpCode opc = OpCodes.Ldfld;
+ if (i == 0 && args[0].IsGhost)
+ {
+ switch (implMethod.Kind)
+ {
+ case ClassFile.RefKind.invokeInterface:
+ case ClassFile.RefKind.invokeVirtual:
+ case ClassFile.RefKind.invokeSpecial:
+ opc = OpCodes.Ldflda;
+ break;
+ }
+ }
+ ilgen.Emit(opc, capturedFields[i]);
+ }
+ for (int i = 0, count = interfaceMethod.GetParameters().Length, k = capturedFields.Length; i < count; i++)
+ {
+ ilgen.EmitLdarg(i + 1);
+ TypeWrapper Ui = interfaceMethod.GetParameters()[i];
+ TypeWrapper Ti = instantiatedMethodType.GetArgTypes()[i];
+ TypeWrapper Aj = implParameters[i + k];
+ if (Ui == PrimitiveTypeWrapper.BYTE)
+ {
+ ilgen.Emit(OpCodes.Conv_I1);
+ }
+ if (Ti != Ui)
+ {
+ if (Ti.IsGhost)
+ {
+ Ti.EmitConvStackTypeToSignatureType(ilgen, Ui);
+ }
+ else if (Ui.IsGhost)
+ {
+ Ui.EmitConvSignatureTypeToStackType(ilgen);
+ }
+ else
+ {
+ Ti.EmitCheckcast(ilgen);
+ }
+ }
+ if (Ti != Aj)
+ {
+ if (Ti.IsPrimitive && !Aj.IsPrimitive)
+ {
+ Boxer.EmitBox(ilgen, Ti);
+ }
+ else if (!Ti.IsPrimitive && Aj.IsPrimitive)
+ {
+ TypeWrapper primitive = GetPrimitiveFromWrapper(Ti);
+ Boxer.EmitUnbox(ilgen, primitive, false);
+ if (primitive == PrimitiveTypeWrapper.BYTE)
+ {
+ ilgen.Emit(OpCodes.Conv_I1);
+ }
+ }
+ else if (Aj == PrimitiveTypeWrapper.LONG)
+ {
+ ilgen.Emit(OpCodes.Conv_I8);
+ }
+ else if (Aj == PrimitiveTypeWrapper.FLOAT)
+ {
+ ilgen.Emit(OpCodes.Conv_R4);
+ }
+ else if (Aj == PrimitiveTypeWrapper.DOUBLE)
+ {
+ ilgen.Emit(OpCodes.Conv_R8);
+ }
+ }
+ }
+ switch (implMethod.Kind)
+ {
+ case ClassFile.RefKind.invokeVirtual:
+ case ClassFile.RefKind.invokeInterface:
+ ((MethodWrapper)implMethod.Member).EmitCallvirt(ilgen);
+ break;
+ case ClassFile.RefKind.newInvokeSpecial:
+ ((MethodWrapper)implMethod.Member).EmitNewobj(ilgen);
+ break;
+ case ClassFile.RefKind.invokeStatic:
+ case ClassFile.RefKind.invokeSpecial:
+ ((MethodWrapper)implMethod.Member).EmitCall(ilgen);
+ break;
+ default:
+ throw new InvalidOperationException();
+ }
+ TypeWrapper Ru = interfaceMethod.ReturnType;
+ TypeWrapper Ra = GetImplReturnType(implMethod);
+ TypeWrapper Rt = instantiatedMethodType.GetRetType();
+ if (Ra == PrimitiveTypeWrapper.BYTE)
+ {
+ ilgen.Emit(OpCodes.Conv_I1);
+ }
+ if (Ra != Ru)
+ {
+ if (Ru == PrimitiveTypeWrapper.VOID)
+ {
+ ilgen.Emit(OpCodes.Pop);
+ }
+ else if (Ra.IsGhost)
+ {
+ Ra.EmitConvSignatureTypeToStackType(ilgen);
+ }
+ else if (Ru.IsGhost)
+ {
+ Ru.EmitConvStackTypeToSignatureType(ilgen, Ra);
+ }
+ }
+ if (Ra != Rt)
+ {
+ if (Rt.IsPrimitive)
+ {
+ if (Rt == PrimitiveTypeWrapper.VOID)
+ {
+ // already popped
+ }
+ else if (!Ra.IsPrimitive)
+ {
+ TypeWrapper primitive = GetPrimitiveFromWrapper(Ra);
+ if (primitive != null)
+ {
+ Boxer.EmitUnbox(ilgen, primitive, false);
+ }
+ else
+ {
+ // If Q is not a primitive wrapper, cast Q to the base Wrapper(S); for example Number for numeric types
+ EmitConvertingUnbox(ilgen, Rt);
+ }
+ }
+ else if (Rt == PrimitiveTypeWrapper.LONG)
+ {
+ ilgen.Emit(OpCodes.Conv_I8);
+ }
+ else if (Rt == PrimitiveTypeWrapper.FLOAT)
+ {
+ ilgen.Emit(OpCodes.Conv_R4);
+ }
+ else if (Rt == PrimitiveTypeWrapper.DOUBLE)
+ {
+ ilgen.Emit(OpCodes.Conv_R8);
+ }
+ }
+ else if (Ra.IsPrimitive)
+ {
+ Boxer.EmitBox(ilgen, GetPrimitiveFromWrapper(Rt));
+ }
+ else
+ {
+ Rt.EmitCheckcast(ilgen);
+ }
+ }
+ ilgen.EmitTailCallPrevention();
+ ilgen.Emit(OpCodes.Ret);
+ ilgen.DoEmit();
+ }
+
+ private static void EmitConvertingUnbox(CodeEmitter ilgen, TypeWrapper tw)
+ {
+ switch (tw.SigName[0])
+ {
+ case 'Z':
+ case 'C':
+ Boxer.EmitUnbox(ilgen, tw, true);
+ break;
+ case 'B':
+ EmitUnboxNumber(ilgen, "byteValue", "()B");
+ break;
+ case 'S':
+ EmitUnboxNumber(ilgen, "shortValue", "()S");
+ break;
+ case 'I':
+ EmitUnboxNumber(ilgen, "intValue", "()I");
+ break;
+ case 'J':
+ EmitUnboxNumber(ilgen, "longValue", "()J");
+ break;
+ case 'F':
+ EmitUnboxNumber(ilgen, "floatValue", "()F");
+ break;
+ case 'D':
+ EmitUnboxNumber(ilgen, "doubleValue", "()D");
+ break;
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ private static void EmitUnboxNumber(CodeEmitter ilgen, string methodName, string methodSig)
+ {
+ TypeWrapper tw = ClassLoaderWrapper.LoadClassCritical("java.lang.Number");
+ tw.EmitCheckcast(ilgen);
+ MethodWrapper mw = tw.GetMethodWrapper(methodName, methodSig, false);
+ mw.Link();
+ mw.EmitCallvirt(ilgen);
+ }
+
+ private static void AddDefaultInterfaceMethods(DynamicTypeWrapper.FinishContext context, MethodWrapper[] methodList, TypeBuilder tb)
+ {
+ // we use special name to hide these from Java reflection
+ const MethodAttributes attr = MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final | MethodAttributes.SpecialName;
+ TypeWrapperFactory factory = context.TypeWrapper.GetClassLoader().GetTypeWrapperFactory();
+ foreach (MethodWrapper mw in methodList)
+ {
+ if (!mw.IsAbstract)
+ {
+ MethodBuilder mb = mw.GetDefineMethodHelper().DefineMethod(factory, tb, mw.Name, attr);
+ if (mw.Name != mw.RealName)
+ {
+ tb.DefineMethodOverride(mb, (MethodInfo)mw.GetMethod());
+ }
+ DynamicTypeWrapper.FinishContext.EmitCallDefaultInterfaceMethod(mb, mw);
+ }
+ else if (IsObjectMethod(mw))
+ {
+ MethodBuilder mb = mw.GetDefineMethodHelper().DefineMethod(factory, tb, mw.Name, attr);
+ if (mw.Name != mw.RealName)
+ {
+ tb.DefineMethodOverride(mb, (MethodInfo)mw.GetMethod());
+ }
+ CodeEmitter ilgen = CodeEmitter.Create(mb);
+ for (int i = 0, count = mw.GetParameters().Length; i <= count; i++)
+ {
+ ilgen.EmitLdarg(i);
+ }
+ CoreClasses.java.lang.Object.Wrapper.GetMethodWrapper(mw.Name, mw.Signature, false).EmitCallvirt(ilgen);
+ ilgen.Emit(OpCodes.Ret);
+ ilgen.DoEmit();
+ }
+ }
+ }
+
+ private static bool IsSupportedImplMethod(ClassFile.ConstantPoolItemMethodHandle implMethod, TypeWrapper caller, TypeWrapper[] captured, ClassFile.ConstantPoolItemMethodType instantiatedMethodType)
+ {
+ switch (implMethod.Kind)
+ {
+ case ClassFile.RefKind.invokeVirtual:
+ case ClassFile.RefKind.invokeInterface:
+ case ClassFile.RefKind.newInvokeSpecial:
+ case ClassFile.RefKind.invokeStatic:
+ case ClassFile.RefKind.invokeSpecial:
+ break;
+ default:
+ return false;
+ }
+ MethodWrapper mw = (MethodWrapper)implMethod.Member;
+ if (mw == null || mw.HasCallerID || DynamicTypeWrapper.RequiresDynamicReflectionCallerClass(mw.DeclaringType.Name, mw.Name, mw.Signature))
+ {
+ return false;
+ }
+ TypeWrapper instance;
+ if (mw.IsConstructor)
+ {
+ instance = mw.DeclaringType;
+ }
+ else if (mw.IsStatic)
+ {
+ instance = null;
+ }
+ else
+ {
+ // if implMethod is an instance method, the type of the first captured value must be subtype of implMethod.DeclaringType
+ instance = captured.Length == 0 ? instantiatedMethodType.GetArgTypes()[0] : captured[0];
+ if (!instance.IsAssignableTo(mw.DeclaringType))
+ {
+ return false;
+ }
+ }
+ if (!mw.IsAccessibleFrom(mw.DeclaringType, caller, instance))
+ {
+ return false;
+ }
+ mw.Link();
+ return true;
+ }
+
+ private static bool IsSupportedInterface(TypeWrapper tw, TypeWrapper caller)
+ {
+ return tw.IsInterface
+ && !tw.IsGhost
+ && tw.IsAccessibleFrom(caller)
+ && !Serialization.IsISerializable(tw);
+ }
+
+ private static bool CheckSupportedInterfaces(TypeWrapper caller, TypeWrapper tw, TypeWrapper[] markers, ClassFile.ConstantPoolItemMethodType[] bridges, out MethodWrapper[] methodList)
+ {
+ // we don't need to check for unloadable, because we already did that while validating the invoke signature
+ if (!IsSupportedInterface(tw, caller))
+ {
+ methodList = null;
+ return false;
+ }
+ Dictionary methods = new Dictionary();
+ int abstractMethodCount = 0;
+ int bridgeMethodCount = 0;
+ if (GatherAllInterfaceMethods(tw, bridges, methods, ref abstractMethodCount, ref bridgeMethodCount) && abstractMethodCount == 1)
+ {
+ foreach (TypeWrapper marker in markers)
+ {
+ if (!IsSupportedInterface(marker, caller))
+ {
+ methodList = null;
+ return false;
+ }
+ if (!GatherAllInterfaceMethods(marker, null, methods, ref abstractMethodCount, ref bridgeMethodCount) || abstractMethodCount != 1)
+ {
+ methodList = null;
+ return false;
+ }
+ }
+ if (bridges != null && bridgeMethodCount != bridges.Length)
+ {
+ methodList = null;
+ return false;
+ }
+ methodList = new MethodWrapper[methods.Count];
+ methods.Values.CopyTo(methodList, 0);
+ return true;
+ }
+ methodList = null;
+ return false;
+ }
+
+ private static bool GatherAllInterfaceMethods(TypeWrapper tw, ClassFile.ConstantPoolItemMethodType[] bridges, Dictionary methods,
+ ref int abstractMethodCount, ref int bridgeMethodCount)
+ {
+ foreach (MethodWrapper mw in tw.GetMethods())
+ {
+ if (mw.IsVirtual)
+ {
+ MirandaMethodWrapper mmw = mw as MirandaMethodWrapper;
+ if (mmw != null)
+ {
+ if (mmw.Error != null)
+ {
+ return false;
+ }
+ continue;
+ }
+ MethodKey key = new MethodKey("", mw.Name, mw.Signature);
+ MethodWrapper current;
+ if (methods.TryGetValue(key, out current))
+ {
+ if (!MatchSignatures(mw, current))
+ {
+ // linkage error (or unloadable type)
+ return false;
+ }
+ }
+ else
+ {
+ methods.Add(key, mw);
+ if (mw.IsAbstract && !IsObjectMethod(mw))
+ {
+ if (bridges != null && IsBridge(mw, bridges))
+ {
+ bridgeMethodCount++;
+ }
+ else
+ {
+ abstractMethodCount++;
+ }
+ }
+ }
+ mw.Link();
+ if (mw.GetMethod() == null)
+ {
+ return false;
+ }
+ if (current != null && mw.RealName != current.RealName)
+ {
+ return false;
+ }
+ }
+ }
+ foreach (TypeWrapper tw1 in tw.Interfaces)
+ {
+ if (!GatherAllInterfaceMethods(tw1, bridges, methods, ref abstractMethodCount, ref bridgeMethodCount))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static bool IsBridge(MethodWrapper mw, ClassFile.ConstantPoolItemMethodType[] bridges)
+ {
+ foreach (ClassFile.ConstantPoolItemMethodType bridge in bridges)
+ {
+ if (bridge.Signature == mw.Signature)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static bool IsObjectMethod(MethodWrapper mw)
+ {
+ MethodWrapper objectMethod;
+ return (objectMethod = CoreClasses.java.lang.Object.Wrapper.GetMethodWrapper(mw.Name, mw.Signature, false)) != null
+ && objectMethod.IsPublic;
+ }
+
+ private static bool MatchSignatures(MethodWrapper interfaceMethod, ClassFile.ConstantPoolItemMethodType samMethodType)
+ {
+ return interfaceMethod.ReturnType == samMethodType.GetRetType()
+ && MatchTypes(interfaceMethod.GetParameters(), samMethodType.GetArgTypes());
+ }
+
+ private static bool MatchSignatures(MethodWrapper mw1, MethodWrapper mw2)
+ {
+ return mw1.ReturnType == mw2.ReturnType
+ && MatchTypes(mw1.GetParameters(), mw2.GetParameters());
+ }
+
+ private static bool MatchTypes(TypeWrapper[] ar1, TypeWrapper[] ar2)
+ {
+ if (ar1.Length != ar2.Length)
+ {
+ return false;
+ }
+ for (int i = 0; i < ar1.Length; i++)
+ {
+ if (ar1[i] != ar2[i])
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static bool IsLambdaMetafactory(ClassFile classFile, ClassFile.BootstrapMethod bsm)
+ {
+ ClassFile.ConstantPoolItemMethodHandle mh;
+ return bsm.ArgumentCount == 3
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(0)) == ClassFile.ConstantType.MethodType
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(1)) == ClassFile.ConstantType.MethodHandle
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(2)) == ClassFile.ConstantType.MethodType
+ && (mh = classFile.GetConstantPoolConstantMethodHandle(bsm.BootstrapMethodIndex)).Kind == ClassFile.RefKind.invokeStatic
+ && IsLambdaMetafactory(mh.Member);
+ }
+
+ private static bool IsLambdaMetafactory(MemberWrapper mw)
+ {
+ return mw.Name == "metafactory"
+ && mw.Signature == "(Ljava.lang.invoke.MethodHandles$Lookup;Ljava.lang.String;Ljava.lang.invoke.MethodType;Ljava.lang.invoke.MethodType;Ljava.lang.invoke.MethodHandle;Ljava.lang.invoke.MethodType;)Ljava.lang.invoke.CallSite;"
+ && mw.DeclaringType.Name == "java.lang.invoke.LambdaMetafactory";
+ }
+
+ [Flags]
+ enum AltFlags
+ {
+ Serializable = 1,
+ Markers = 2,
+ Bridges = 4,
+ Mask = Serializable | Markers | Bridges
+ }
+
+ private static bool IsLambdaAltMetafactory(ClassFile classFile, ClassFile.BootstrapMethod bsm)
+ {
+ ClassFile.ConstantPoolItemMethodHandle mh;
+ AltFlags flags;
+ int argpos = 4;
+ return bsm.ArgumentCount >= 4
+ && (mh = classFile.GetConstantPoolConstantMethodHandle(bsm.BootstrapMethodIndex)).Kind == ClassFile.RefKind.invokeStatic
+ && IsLambdaAltMetafactory(mh.Member)
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(0)) == ClassFile.ConstantType.MethodType
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(1)) == ClassFile.ConstantType.MethodHandle
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(2)) == ClassFile.ConstantType.MethodType
+ && classFile.GetConstantPoolConstantType(bsm.GetArgument(3)) == ClassFile.ConstantType.Integer
+ && ((flags = (AltFlags)classFile.GetConstantPoolConstantInteger(bsm.GetArgument(3))) & ~AltFlags.Mask) == 0
+ && ((flags & AltFlags.Markers) == 0 || CheckOptionalArgs(classFile, bsm, ClassFile.ConstantType.Class, ref argpos))
+ && ((flags & AltFlags.Bridges) == 0 || CheckOptionalArgs(classFile, bsm, ClassFile.ConstantType.MethodType, ref argpos))
+ && argpos == bsm.ArgumentCount;
+ }
+
+ private static bool IsLambdaAltMetafactory(MemberWrapper mw)
+ {
+ return mw.Name == "altMetafactory"
+ && mw.Signature == "(Ljava.lang.invoke.MethodHandles$Lookup;Ljava.lang.String;Ljava.lang.invoke.MethodType;[Ljava.lang.Object;)Ljava.lang.invoke.CallSite;"
+ && mw.DeclaringType.Name == "java.lang.invoke.LambdaMetafactory";
+ }
+
+ private static bool CheckOptionalArgs(ClassFile classFile, ClassFile.BootstrapMethod bsm, ClassFile.ConstantType type, ref int argpos)
+ {
+ if (bsm.ArgumentCount - argpos < 1)
+ {
+ return false;
+ }
+ if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos)) != ClassFile.ConstantType.Integer)
+ {
+ return false;
+ }
+ int count = classFile.GetConstantPoolConstantInteger(bsm.GetArgument(argpos++));
+ if (count < 0 || bsm.ArgumentCount - argpos < count)
+ {
+ return false;
+ }
+ for (int i = 0; i < count; i++)
+ {
+ if (classFile.GetConstantPoolConstantType(bsm.GetArgument(argpos++)) != type)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static bool HasUnloadable(ClassFile.ConstantPoolItemInvokeDynamic cpi)
+ {
+ return HasUnloadable(cpi.GetArgTypes()) || cpi.GetRetType().IsUnloadable;
+ }
+
+ private static bool HasUnloadable(ClassFile.ConstantPoolItemMethodType cpi)
+ {
+ return HasUnloadable(cpi.GetArgTypes()) || cpi.GetRetType().IsUnloadable;
+ }
+
+ private static bool HasUnloadable(ClassFile.ConstantPoolItemMI cpi)
+ {
+ return HasUnloadable(cpi.GetArgTypes()) || cpi.GetRetType().IsUnloadable;
+ }
+
+ private static bool HasUnloadable(TypeWrapper[] wrappers)
+ {
+ foreach (TypeWrapper tw in wrappers)
+ {
+ if (tw.IsUnloadable)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/external/ikvm/runtime/Serialization.cs b/external/ikvm/runtime/Serialization.cs
index 1145d35108..024c12d6a4 100644
--- a/external/ikvm/runtime/Serialization.cs
+++ b/external/ikvm/runtime/Serialization.cs
@@ -52,6 +52,11 @@ namespace IKVM.Internal
psetSerializationFormatter.AddPermission(new SecurityPermission(SecurityPermissionFlag.SerializationFormatter));
}
+ internal static bool IsISerializable(TypeWrapper wrapper)
+ {
+ return wrapper == iserializable;
+ }
+
private static bool IsSafeForAutomagicSerialization(TypeWrapper wrapper)
{
if (wrapper.TypeAsBaseType.IsSerializable)
@@ -147,15 +152,21 @@ namespace IKVM.Internal
return null;
}
- private static void MarkSerializable(TypeBuilder tb)
+ internal static void MarkSerializable(TypeBuilder tb)
{
tb.SetCustomAttribute(serializableAttribute);
}
- private static void AddGetObjectData(TypeBuilder tb)
+ internal static void AddGetObjectData(TypeBuilder tb)
{
+ string name = tb.IsSealed
+ ? "System.Runtime.Serialization.ISerializable.GetObjectData"
+ : "GetObjectData";
+ MethodAttributes attr = tb.IsSealed
+ ? MethodAttributes.Private | MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.Final
+ : MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.NewSlot | MethodAttributes.CheckAccessOnOverride;
tb.AddInterfaceImplementation(JVM.Import(typeof(ISerializable)));
- MethodBuilder getObjectData = tb.DefineMethod("GetObjectData", MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.NewSlot, null,
+ MethodBuilder getObjectData = tb.DefineMethod(name, attr, null,
new Type[] { JVM.Import(typeof(SerializationInfo)), JVM.Import(typeof(StreamingContext)) });
getObjectData.SetCustomAttribute(securityCriticalAttribute);
AttributeHelper.HideFromJava(getObjectData);
diff --git a/external/ikvm/runtime/TypeWrapper.cs.REMOVED.git-id b/external/ikvm/runtime/TypeWrapper.cs.REMOVED.git-id
index 4afe4adc42..326fea284f 100644
--- a/external/ikvm/runtime/TypeWrapper.cs.REMOVED.git-id
+++ b/external/ikvm/runtime/TypeWrapper.cs.REMOVED.git-id
@@ -1 +1 @@
-3ed1d9cc7e683c9f379f858859a155d3b4c778a1
\ No newline at end of file
+fabd1aa5c712bc82971cd56b6f8a9d6cf648740c
\ No newline at end of file
diff --git a/external/ikvm/runtime/attributes.cs b/external/ikvm/runtime/attributes.cs
index 1605837d57..78ab40b019 100644
--- a/external/ikvm/runtime/attributes.cs
+++ b/external/ikvm/runtime/attributes.cs
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2002-2011 Jeroen Frijters
+ Copyright (C) 2002-2014 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -22,6 +22,8 @@
*/
using System;
+using System.Collections.Generic;
+using IKVM.Internal;
#if STATIC_COMPILER || STUB_GENERATOR
using IKVM.Reflection;
using Type = IKVM.Reflection.Type;
@@ -388,7 +390,7 @@ namespace IKVM.Attributes
public JavaModuleAttribute(string[] classMap)
{
- this.classMap = classMap;
+ this.classMap = UnicodeUtil.UnescapeInvalidSurrogates(classMap);
}
public string[] GetClassMap()
@@ -418,11 +420,33 @@ namespace IKVM.Attributes
[AttributeUsage(AttributeTargets.All)]
public sealed class HideFromJavaAttribute : Attribute
{
+ private readonly HideFromJavaFlags flags;
+
+ public HideFromJavaAttribute()
+ {
+ flags = HideFromJavaFlags.All;
+ }
+
+ public HideFromJavaAttribute(HideFromJavaFlags flags)
+ {
+ this.flags = flags;
+ }
+
+ public HideFromJavaFlags Flags
+ {
+ get { return flags; }
+ }
}
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property)]
- public sealed class HideFromReflectionAttribute : Attribute
+ [Flags]
+ public enum HideFromJavaFlags : byte
{
+ All = Code | Reflection | StackWalk | StackTrace,
+ None = 0,
+ Code = 1,
+ Reflection = 2,
+ StackWalk = 4, // used for LambdaForm$Compiled
+ StackTrace = 8, // used for LambdaForm$Hidden
}
[Flags]
@@ -493,8 +517,8 @@ namespace IKVM.Attributes
public NameSigAttribute(string name, string sig)
{
- this.name = name;
- this.sig = sig;
+ this.name = UnicodeUtil.UnescapeInvalidSurrogates(name);
+ this.sig = UnicodeUtil.UnescapeInvalidSurrogates(sig);
}
public string Name
@@ -523,7 +547,7 @@ namespace IKVM.Attributes
// this constructor is used by ikvmc, the other constructors are for use in other .NET languages
public ThrowsAttribute(string[] classes)
{
- this.classes = classes;
+ this.classes = UnicodeUtil.UnescapeInvalidSurrogates(classes);
}
public ThrowsAttribute(Type type)
@@ -555,7 +579,7 @@ namespace IKVM.Attributes
// NOTE this is not CLS compliant, so maybe we should have a couple of overloads
public ImplementsAttribute(string[] interfaces)
{
- this.interfaces = interfaces;
+ this.interfaces = UnicodeUtil.UnescapeInvalidSurrogates(interfaces);
}
public string[] Interfaces
@@ -577,7 +601,7 @@ namespace IKVM.Attributes
public InnerClassAttribute(string innerClassName, Modifiers modifiers)
{
- this.innerClassName = innerClassName;
+ this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName);
this.modifiers = modifiers;
}
@@ -605,7 +629,7 @@ namespace IKVM.Attributes
public NonNestedInnerClassAttribute(string innerClassName)
{
- this.innerClassName = innerClassName;
+ this.innerClassName = UnicodeUtil.UnescapeInvalidSurrogates(innerClassName);
}
public string InnerClassName
@@ -624,7 +648,7 @@ namespace IKVM.Attributes
public NonNestedOuterClassAttribute(string outerClassName)
{
- this.outerClassName = outerClassName;
+ this.outerClassName = UnicodeUtil.UnescapeInvalidSurrogates(outerClassName);
}
public string OuterClassName
@@ -662,7 +686,7 @@ namespace IKVM.Attributes
public SignatureAttribute(string signature)
{
- this.signature = signature;
+ this.signature = UnicodeUtil.UnescapeInvalidSurrogates(signature);
}
public string Signature
@@ -683,9 +707,9 @@ namespace IKVM.Attributes
public EnclosingMethodAttribute(string className, string methodName, string methodSig)
{
- this.className = className;
- this.methodName = methodName;
- this.methodSig = methodSig;
+ this.className = UnicodeUtil.UnescapeInvalidSurrogates(className);
+ this.methodName = UnicodeUtil.UnescapeInvalidSurrogates(methodName);
+ this.methodSig = UnicodeUtil.UnescapeInvalidSurrogates(methodSig);
}
internal EnclosingMethodAttribute SetClassName(Type type)
@@ -749,7 +773,7 @@ namespace IKVM.Attributes
// new object[] { (byte)'?', "", "" }
public AnnotationDefaultAttribute(object defaultValue)
{
- this.defaultValue = defaultValue;
+ this.defaultValue = Unescape(defaultValue);
}
public object Value
@@ -759,6 +783,36 @@ namespace IKVM.Attributes
return defaultValue;
}
}
+
+ internal static object Escape(object obj)
+ {
+ return EscapeOrUnescape(obj, true);
+ }
+
+ internal static object Unescape(object obj)
+ {
+ return EscapeOrUnescape(obj, false);
+ }
+
+ private static object EscapeOrUnescape(object obj, bool escape)
+ {
+ string str = obj as string;
+ if (str != null)
+ {
+ return escape
+ ? UnicodeUtil.EscapeInvalidSurrogates(str)
+ : UnicodeUtil.UnescapeInvalidSurrogates(str);
+ }
+ object[] arr = obj as object[];
+ if (arr != null)
+ {
+ for (int i = 0; i < arr.Length; i++)
+ {
+ arr[i] = EscapeOrUnescape(arr[i], escape);
+ }
+ }
+ return obj;
+ }
}
[AttributeUsage(AttributeTargets.Interface)]
@@ -768,7 +822,7 @@ namespace IKVM.Attributes
public AnnotationAttributeAttribute(string attributeType)
{
- this.attributeType = attributeType;
+ this.attributeType = UnicodeUtil.UnescapeInvalidSurrogates(attributeType);
}
public string AttributeType
@@ -780,14 +834,16 @@ namespace IKVM.Attributes
}
}
- [AttributeUsage(AttributeTargets.Module)]
+ [AttributeUsage(AttributeTargets.Module, AllowMultiple = true)]
public sealed class PackageListAttribute : Attribute
{
- private string[] packages;
+ internal string jar;
+ internal string[] packages;
- public PackageListAttribute(string[] packages)
+ public PackageListAttribute(string jar, string[] packages)
{
- this.packages = packages;
+ this.jar = jar;
+ this.packages = UnicodeUtil.UnescapeInvalidSurrogates(packages);
}
public string[] GetPackages()
@@ -826,7 +882,7 @@ namespace IKVM.Attributes
public DynamicAnnotationAttribute(object[] definition)
{
- this.definition = definition;
+ this.definition = (object[])AnnotationDefaultAttribute.Unescape(definition);
}
public object[] Definition
@@ -835,6 +891,120 @@ namespace IKVM.Attributes
}
}
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor)]
+ public sealed class MethodParametersAttribute : Attribute
+ {
+ private readonly Modifiers[] modifiers;
+
+ public MethodParametersAttribute(Modifiers[] modifiers)
+ {
+ this.modifiers = modifiers;
+ }
+
+ public Modifiers[] Modifiers
+ {
+ get { return modifiers; }
+ }
+
+ public bool IsMalformed
+ {
+ get { return modifiers == null; }
+ }
+ }
+
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
+ public sealed class ConstantPoolAttribute : Attribute
+ {
+ internal readonly object[] constantPool;
+
+ public ConstantPoolAttribute(object[] constantPool)
+ {
+ this.constantPool = Decompress(constantPool);
+ }
+
+ internal static object[] Decompress(object[] constantPool)
+ {
+ List
-
+
@@ -70,6 +97,9 @@
+
+
+
@@ -107,9 +137,11 @@
+
+
@@ -120,14 +152,16 @@
+
+
-
+
@@ -151,10 +185,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external/ikvm/runtime/stubgen/ClassFileWriter.cs b/external/ikvm/runtime/stubgen/ClassFileWriter.cs
index ded626741b..9438a5f8c3 100644
--- a/external/ikvm/runtime/stubgen/ClassFileWriter.cs
+++ b/external/ikvm/runtime/stubgen/ClassFileWriter.cs
@@ -72,6 +72,11 @@ namespace IKVM.StubGen
stream.WriteByte(b);
}
+ public void WriteBytes(byte[] data)
+ {
+ stream.Write(data, 0, data.Length);
+ }
+
public void WriteUtf8(string str)
{
byte[] buf = new byte[str.Length * 3 + 1];
@@ -728,6 +733,24 @@ namespace IKVM.StubGen
}
}
+ sealed class RuntimeVisibleTypeAnnotationsAttribute : ClassFileAttribute
+ {
+ private readonly byte[] data;
+
+ internal RuntimeVisibleTypeAnnotationsAttribute(ClassFileWriter classFile, byte[] data)
+ : base(classFile.AddUtf8("RuntimeVisibleTypeAnnotations"))
+ {
+ this.data = data;
+ }
+
+ public override void Write(BigEndianStream bes)
+ {
+ base.Write(bes);
+ bes.WriteUInt32((uint)data.Length);
+ bes.WriteBytes(data);
+ }
+ }
+
sealed class AnnotationDefaultClassFileAttribute : ClassFileAttribute
{
private ClassFileWriter classFile;
@@ -834,23 +857,31 @@ namespace IKVM.StubGen
{
private readonly ClassFileWriter classFile;
private readonly ushort[] names;
+ private readonly ushort[] flags;
- internal MethodParametersAttribute(ClassFileWriter classFile, ushort[] names)
+ internal MethodParametersAttribute(ClassFileWriter classFile, ushort[] names, ushort[] flags)
: base(classFile.AddUtf8("MethodParameters"))
{
this.classFile = classFile;
this.names = names;
+ this.flags = flags;
}
public override void Write(BigEndianStream bes)
{
base.Write(bes);
+ if (flags == null || names == null || flags.Length != names.Length)
+ {
+ // write a malformed MethodParameters attribute
+ bes.WriteUInt32(0);
+ return;
+ }
bes.WriteUInt32((uint)(1 + names.Length * 4));
bes.WriteByte((byte)names.Length);
- foreach (ushort idx in names)
+ for (int i = 0; i < names.Length; i++)
{
- bes.WriteUInt16(idx);
- bes.WriteUInt16(0);
+ bes.WriteUInt16(names[i]);
+ bes.WriteUInt16(flags[i]);
}
}
}
diff --git a/external/ikvm/runtime/stubgen/StubGenerator.cs b/external/ikvm/runtime/stubgen/StubGenerator.cs
index 1aa6f9373a..2f6938428f 100644
--- a/external/ikvm/runtime/stubgen/StubGenerator.cs
+++ b/external/ikvm/runtime/stubgen/StubGenerator.cs
@@ -93,6 +93,7 @@ namespace IKVM.StubGen
writer.AddStringAttribute("Signature", genericTypeSignature);
}
AddAnnotations(writer, writer, tw.TypeAsBaseType);
+ AddTypeAnnotations(writer, writer, tw, tw.GetRawTypeAnnotations());
writer.AddStringAttribute("IKVM.NET.Assembly", GetAssemblyName(tw));
if (tw.TypeAsBaseType.IsDefined(JVM.Import(typeof(ObsoleteAttribute)), false))
{
@@ -103,7 +104,11 @@ namespace IKVM.StubGen
if (!mw.IsHideFromReflection && (mw.IsPublic || mw.IsProtected || includeNonPublicMembers))
{
FieldOrMethod m;
- if (mw.Name == "")
+ // HACK javac has a bug in com.sun.tools.javac.code.Types.isSignaturePolymorphic() where it assumes that
+ // MethodHandle doesn't have any native methods with an empty argument list
+ // (or at least it throws a NPE when it examines the signature of a method without any parameters when it
+ // accesses argtypes.tail.tail)
+ if (mw.Name == "" || (tw == CoreClasses.java.lang.invoke.MethodHandle.Wrapper && (mw.Modifiers & Modifiers.Native) == 0))
{
m = writer.AddMethod(mw.Modifiers, mw.Name, mw.Signature.Replace('.', '/'));
CodeAttribute code = new CodeAttribute(writer);
@@ -187,18 +192,24 @@ namespace IKVM.StubGen
}
if (includeParameterNames)
{
- ParameterInfo[] parameters = mb.GetParameters();
- if (parameters.Length != 0)
+ MethodParametersEntry[] mp = tw.GetMethodParameters(mw);
+ if (mp == MethodParametersEntry.Malformed)
{
- ushort[] names = new ushort[parameters.Length];
+ m.AddAttribute(new MethodParametersAttribute(writer, null, null));
+ }
+ else if (mp != null)
+ {
+ ushort[] names = new ushort[mp.Length];
+ ushort[] flags = new ushort[mp.Length];
for (int i = 0; i < names.Length; i++)
{
- if (parameters[i].Name != null)
+ if (mp[i].name != null)
{
- names[i] = writer.AddUtf8(parameters[i].Name);
+ names[i] = writer.AddUtf8(mp[i].name);
}
+ flags[i] = mp[i].flags;
}
- m.AddAttribute(new MethodParametersAttribute(writer, names));
+ m.AddAttribute(new MethodParametersAttribute(writer, names, flags));
}
}
}
@@ -209,6 +220,7 @@ namespace IKVM.StubGen
}
AddAnnotations(writer, m, mw.GetMethod());
AddParameterAnnotations(writer, m, mw.GetMethod());
+ AddTypeAnnotations(writer, m, tw, tw.GetMethodRawTypeAnnotations(mw));
}
}
bool hasSerialVersionUID = false;
@@ -240,6 +252,7 @@ namespace IKVM.StubGen
f.AddAttribute(new DeprecatedAttribute(writer));
}
AddAnnotations(writer, f, fw.GetField());
+ AddTypeAnnotations(writer, f, tw, tw.GetFieldRawTypeAnnotations(fw));
}
}
}
@@ -322,6 +335,143 @@ namespace IKVM.StubGen
#endif
}
+ private static void AddTypeAnnotations(ClassFileWriter writer, IAttributeOwner target, TypeWrapper tw, byte[] typeAnnotations)
+ {
+#if !FIRST_PASS && !STUB_GENERATOR
+ if (typeAnnotations != null)
+ {
+ typeAnnotations = (byte[])typeAnnotations.Clone();
+ object[] constantPool = tw.GetConstantPool();
+ try
+ {
+ int pos = 0;
+ ushort num_annotations = ReadUInt16BE(typeAnnotations, ref pos);
+ for (int i = 0; i < num_annotations; i++)
+ {
+ FixupTypeAnnotationConstantPoolIndexes(writer, typeAnnotations, constantPool, ref pos);
+ }
+ }
+ catch (IndexOutOfRangeException)
+ {
+ // if the attribute is malformed, we add it anyway and hope the Java parser will agree and throw the right error
+ }
+ target.AddAttribute(new RuntimeVisibleTypeAnnotationsAttribute(writer, typeAnnotations));
+ }
+#endif
+ }
+
+ private static void FixupTypeAnnotationConstantPoolIndexes(ClassFileWriter writer, byte[] typeAnnotations, object[] constantPool, ref int pos)
+ {
+ switch (typeAnnotations[pos++]) // target_type
+ {
+ case 0x00:
+ case 0x01:
+ case 0x16:
+ pos++;
+ break;
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ case 0x17:
+ pos += 2;
+ break;
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ break;
+ default:
+ throw new IndexOutOfRangeException();
+ }
+ byte path_length = typeAnnotations[pos++];
+ pos += path_length * 2;
+ FixupAnnotationConstantPoolIndexes(writer, typeAnnotations, constantPool, ref pos);
+ }
+
+ private static void FixupAnnotationConstantPoolIndexes(ClassFileWriter writer, byte[] typeAnnotations, object[] constantPool, ref int pos)
+ {
+ FixupConstantPoolIndex(writer, typeAnnotations, constantPool, ref pos);
+ ushort num_components = ReadUInt16BE(typeAnnotations, ref pos);
+ for (int i = 0; i < num_components; i++)
+ {
+ FixupConstantPoolIndex(writer, typeAnnotations, constantPool, ref pos);
+ FixupAnnotationComponentValueConstantPoolIndexes(writer, typeAnnotations, constantPool, ref pos);
+ }
+ }
+
+ private static void FixupConstantPoolIndex(ClassFileWriter writer, byte[] typeAnnotations, object[] constantPool, ref int pos)
+ {
+ ushort index = ReadUInt16BE(typeAnnotations, ref pos);
+ object item = constantPool[index];
+ if (item is int)
+ {
+ index = writer.AddInt((int)item);
+ }
+ else if (item is long)
+ {
+ index = writer.AddLong((long)item);
+ }
+ else if (item is float)
+ {
+ index = writer.AddFloat((float)item);
+ }
+ else if (item is double)
+ {
+ index = writer.AddDouble((double)item);
+ }
+ else if (item is string)
+ {
+ index = writer.AddUtf8((string)item);
+ }
+ else
+ {
+ throw new IndexOutOfRangeException();
+ }
+ typeAnnotations[pos - 2] = (byte)(index >> 8);
+ typeAnnotations[pos - 1] = (byte)(index >> 0);
+ }
+
+ private static void FixupAnnotationComponentValueConstantPoolIndexes(ClassFileWriter writer, byte[] typeAnnotations, object[] constantPool, ref int pos)
+ {
+ switch ((char)typeAnnotations[pos++]) // tag
+ {
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'I':
+ case 'J':
+ case 'S':
+ case 'Z':
+ case 's':
+ case 'c':
+ FixupConstantPoolIndex(writer, typeAnnotations, constantPool, ref pos);
+ break;
+ case 'e':
+ FixupConstantPoolIndex(writer, typeAnnotations, constantPool, ref pos);
+ FixupConstantPoolIndex(writer, typeAnnotations, constantPool, ref pos);
+ break;
+ case '@':
+ FixupAnnotationConstantPoolIndexes(writer, typeAnnotations, constantPool, ref pos);
+ break;
+ case '[':
+ ushort num_values = ReadUInt16BE(typeAnnotations, ref pos);
+ for (int i = 0; i < num_values; i++)
+ {
+ FixupAnnotationComponentValueConstantPoolIndexes(writer, typeAnnotations, constantPool, ref pos);
+ }
+ break;
+ default:
+ throw new IndexOutOfRangeException();
+ }
+ }
+
+ private static ushort ReadUInt16BE(byte[] buf, ref int pos)
+ {
+ ushort s = (ushort)((buf[pos] << 8) + buf[pos + 1]);
+ pos += 2;
+ return s;
+ }
+
#if !FIRST_PASS && !STUB_GENERATOR
private static object[] GetAnnotation(CustomAttributeData cad)
{
@@ -525,7 +675,7 @@ namespace IKVM.StubGen
"value",
targets.ToArray()
});
- if (Experimental.JDK_8 && IsRepeatableAnnotation(tw))
+ if (IsRepeatableAnnotation(tw))
{
annot.Add(new object[] {
AnnotationDefaultAttribute.TAG_ANNOTATION,
diff --git a/external/ikvm/runtime/verifier.cs.REMOVED.git-id b/external/ikvm/runtime/verifier.cs.REMOVED.git-id
index 873c71d443..934c0f60c0 100644
--- a/external/ikvm/runtime/verifier.cs.REMOVED.git-id
+++ b/external/ikvm/runtime/verifier.cs.REMOVED.git-id
@@ -1 +1 @@
-81b479291c9b3c8f98f03a54e464caea811df044
\ No newline at end of file
+c0168e79b1441480a125c7c6db72132875a3f366
\ No newline at end of file
diff --git a/external/ikvm/runtime/vfs.cs b/external/ikvm/runtime/vfs.cs
index 3ff13c3ecf..4439af8fe2 100644
--- a/external/ikvm/runtime/vfs.cs
+++ b/external/ikvm/runtime/vfs.cs
@@ -577,7 +577,7 @@ namespace IKVM.Internal
{
System.IO.MemoryStream mem = new System.IO.MemoryStream();
bool includeNonPublicInterfaces = !"true".Equals(java.lang.Props.props.getProperty("ikvm.stubgen.skipNonPublicInterfaces"), StringComparison.OrdinalIgnoreCase);
- IKVM.StubGen.StubGenerator.WriteClass(mem, tw, includeNonPublicInterfaces, false, false, false);
+ IKVM.StubGen.StubGenerator.WriteClass(mem, tw, includeNonPublicInterfaces, false, false, true);
buf = mem.ToArray();
}
#endif
@@ -756,6 +756,7 @@ namespace IKVM.Internal
AddDummyLibrary(bin, "net");
AddDummyLibrary(bin, "splashscreen");
AddDummyLibrary(bin, "osx");
+ AddDummyLibrary(bin, "management");
bin.Add("java", new VfsJavaExe());
bin.Add("javaw", new VfsJavaExe());
bin.Add("java.exe", new VfsJavaExe());
@@ -985,7 +986,7 @@ namespace IKVM.Internal
#if FIRST_PASS
return false;
#else
- return access == Java_java_io_Win32FileSystem.ACCESS_READ && GetVfsEntry(path) != null;
+ return access == Java_java_io_WinNTFileSystem.ACCESS_READ && GetVfsEntry(path) != null;
#endif
}
diff --git a/external/ikvm/website/build/site/devguide/concepts.html b/external/ikvm/website/build/site/devguide/concepts.html
index ad38a807e1..504de3b001 100644
--- a/external/ikvm/website/build/site/devguide/concepts.html
+++ b/external/ikvm/website/build/site/devguide/concepts.html
@@ -90,11 +90,11 @@
Use the ikvmstub application to generate a Java jar file for each dll you identified in step 2.
+
Use the ikvmstub application to generate a Java jar file for each dll you identified in step 2.
The ikvmstub tool analyzes the .NET classes in the designated dll
and generates a jar file containing Java interfaces and stub classes. This information is needed by the Java source compiler, which
knows nothing about .NET assemblies.
@@ -259,7 +259,7 @@
.NET classes you used; do not include the ikvmstub-generated jar files on the compiler classpath.
Convert the Java API to .NET CIL using ikvmc.
This produces a .NET dll that you can reference in your project.
Use the Java reflection API's to dynamically load and execute the Java bytecode using the
diff --git a/external/ikvm/website/build/site/download.html b/external/ikvm/website/build/site/download.html
index 7f1d065d3b..5ae0c44465 100644
--- a/external/ikvm/website/build/site/download.html
+++ b/external/ikvm/website/build/site/download.html
@@ -90,11 +90,11 @@
The ikvm application included with the distribution is a .NET
implementation of a Java Virtual Machine. In many cases, you can use it
as a drop-in replacement for java. For example, instead of typing
@@ -239,7 +239,7 @@
Use Java libraries in your .NET applications
-
IKVM.NET includes ikvmc, a Java bytecode to .NET IL translator.
+
IKVM.NET includes ikvmc, a Java bytecode to .NET IL translator.
If you have a Java library that you would like to use in a .NET application,
run ikvmc -target:library mylib.jar to create mylib.dll.
@@ -258,7 +258,7 @@
you can use any Java compiler to compile Java source code to JVM bytecode, then use
ikvmc -target:exe myapp.jar
to produce a .NET executable. You can even use .NET API's in your
- Java code using the included ikvmstub application.
+ Java code using the included ikvmstub application.
diff --git a/external/ikvm/website/src/documentation/content/xdocs/site.xml b/external/ikvm/website/src/documentation/content/xdocs/site.xml
index fad4d22355..78d2086d4c 100644
--- a/external/ikvm/website/src/documentation/content/xdocs/site.xml
+++ b/external/ikvm/website/src/documentation/content/xdocs/site.xml
@@ -21,15 +21,15 @@ See http://xml.apache.org/forrest/linking.html for more info
-
-
+
+
-
-
-
-
+
+
+
+
@@ -51,10 +51,10 @@ See http://xml.apache.org/forrest/linking.html for more info
-->
-
-
-
-
+
+
+
+
diff --git a/libgc/configure.REMOVED.git-id b/libgc/configure.REMOVED.git-id
index eec630ea9d..5501c4807f 100644
--- a/libgc/configure.REMOVED.git-id
+++ b/libgc/configure.REMOVED.git-id
@@ -1 +1 @@
-ec75f52b4a09d98c0cc1707b0a0f796e4c7a91c0
\ No newline at end of file
+8f066765940517df1ea0554208196aab32b6b19b
\ No newline at end of file
diff --git a/libgc/configure.ac b/libgc/configure.ac
index 7dc04985a9..ac992abfaf 100644
--- a/libgc/configure.ac
+++ b/libgc/configure.ac
@@ -114,6 +114,17 @@ case "$THREADS" in
AC_DEFINE(THREAD_LOCAL_ALLOC)
THREADDLLIBS="-lpthread -lrt"
;;
+ *-*-kfreebsd*-gnu)
+ AC_DEFINE(GC_FREEBSD_THREADS)
+ INCLUDES="$INCLUDES -pthread"
+ THREADDLLIBS=-pthread
+ AC_DEFINE(_REENTRANT)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ AC_DEFINE(USE_COMPILER_TLS)
+ ;;
*-*-freebsd*)
AC_DEFINE(GC_FREEBSD_THREADS)
if test "x$PTHREAD_CFLAGS" != "x"; then
diff --git a/libgc/dyn_load.c b/libgc/dyn_load.c
index ca7ce54f19..5db3503aac 100644
--- a/libgc/dyn_load.c
+++ b/libgc/dyn_load.c
@@ -26,7 +26,7 @@
* None of this is safe with dlclose and incremental collection.
* But then not much of anything is safe in the presence of dlclose.
*/
-#if (defined(__linux__) || defined(__native_client__)) && !defined(_GNU_SOURCE)
+#if (defined(__linux__) || defined(__GLIBC__) || defined(__native_client__)) && !defined(_GNU_SOURCE)
/* Can't test LINUX, since this must be define before other includes */
# define _GNU_SOURCE
#endif
@@ -394,7 +394,7 @@ GC_bool GC_register_main_static_data()
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
/* versions. Thanks to Jakub Jelinek for most of the code. */
-# if (defined(LINUX) || defined(NACL)) /* Are others OK here, too? */ \
+# if (defined(LINUX) || defined (__GLIBC__) || defined(NACL)) /* Are others OK here, too? */ \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
diff --git a/libgc/include/gc.h b/libgc/include/gc.h
index 4693a3d9a5..2265fdbd34 100644
--- a/libgc/include/gc.h
+++ b/libgc/include/gc.h
@@ -497,7 +497,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
# define GC_RETURN_ADDR (GC_word)__return_address
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
# include
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
&& !defined(__ia64__)
diff --git a/libgc/include/private/gcconfig.h b/libgc/include/private/gcconfig.h
index 418e046ae1..3cbab919b9 100644
--- a/libgc/include/private/gcconfig.h
+++ b/libgc/include/private/gcconfig.h
@@ -55,7 +55,7 @@
# endif
/* And one for FreeBSD: */
-# if defined(__FreeBSD__) && !defined(FREEBSD)
+# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
# define FREEBSD
# endif
@@ -1371,8 +1371,15 @@
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGTSTP
+# define SIG_THR_RESTART SIGCONT
+# endif
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
@@ -2132,8 +2139,15 @@
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
# define NEED_FIND_LIMIT
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
@@ -2230,7 +2244,7 @@
# define SUNOS5SIGS
# endif
-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
+# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
# define SUNOS5SIGS
# endif
@@ -2293,7 +2307,7 @@
# define CACHE_LINE_SIZE 32 /* Wild guess */
# endif
-# ifdef LINUX
+# if defined(LINUX) || defined(__GLIBC__)
# define REGISTER_LIBRARIES_EARLY
/* We sometimes use dl_iterate_phdr, which may acquire an internal */
/* lock. This isn't safe after the world has stopped. So we must */
@@ -2374,7 +2388,7 @@
#if defined(SPARC)
# define CAN_SAVE_CALL_ARGS
#endif
-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
+#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
/* SAVE_CALL_CHAIN is supported if the code is compiled to save */
/* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
# define CAN_SAVE_CALL_ARGS
diff --git a/man/mono.1 b/man/mono.1
index ac2808e25f..3d4bd54e98 100644
--- a/man/mono.1
+++ b/man/mono.1
@@ -1216,6 +1216,17 @@ is used.
Performs a check to make sure that no references are left to an
unloaded AppDomain.
.TP
+\fBclear-at-tlab-creation\fR
+Clears the nursery incrementally when the thread local allocation
+buffers (TLAB) are created. The default setting clears the whole
+nursery at GC time.
+.TP
+\fBdebug-clear-at-tlab-creation\fR
+Clears the nursery incrementally when the thread local allocation
+buffers (TLAB) are created, but at GC time fills it with the byte
+`0xff`, which should result in a crash more quickly if
+`clear-at-tlab-creation` doesn't work properly.
+.TP
\fBclear-at-gc\fR
This clears the nursery at GC time instead of doing it when the thread
local allocation buffer (TLAB) is created. The default is to clear
diff --git a/mcs/Makefile b/mcs/Makefile
index a10dfa504c..af4495e919 100644
--- a/mcs/Makefile
+++ b/mcs/Makefile
@@ -82,7 +82,7 @@ all-local $(STD_TARGETS:=-local):
@:
dir-check:
- @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then make -C ../runtime; fi
+ @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then $(MAKE) -C ../runtime; fi
# fun specialty targets
diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs
index a1884da3d0..b01a325a1c 100644
--- a/mcs/build/common/Consts.cs
+++ b/mcs/build/common/Consts.cs
@@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
- public const string MonoVersion = "3.8.0.0";
+ public const string MonoVersion = "3.10.0.0";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";
diff --git a/mcs/build/profiles/net_4_0.make b/mcs/build/profiles/net_4_0.make
index a5bec4cd2c..99782bd526 100644
--- a/mcs/build/profiles/net_4_0.make
+++ b/mcs/build/profiles/net_4_0.make
@@ -17,3 +17,6 @@ FRAMEWORK_VERSION = 4.0
XBUILD_VERSION = 4.0
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+
+# Ignore tests on net_4_0 as the 4.0 IL code is never used for running (just for metadata), so it doesn't make sense to execute tests there
+NO_TEST = yes
diff --git a/mcs/class/Accessibility/Assembly/AssemblyInfo.cs b/mcs/class/Accessibility/Assembly/AssemblyInfo.cs
index 82a24e7fa8..2b7c5494fe 100644
--- a/mcs/class/Accessibility/Assembly/AssemblyInfo.cs
+++ b/mcs/class/Accessibility/Assembly/AssemblyInfo.cs
@@ -55,10 +55,8 @@ using System.Runtime.InteropServices;
[assembly: Guid ("1ea4dbf0-3c3b-11cf-810c-00aa00389b71")]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: ImportedFromTypeLib ("Accessibility")]
diff --git a/mcs/class/Makefile b/mcs/class/Makefile
index b3d367cb2e..47cf334888 100644
--- a/mcs/class/Makefile
+++ b/mcs/class/Makefile
@@ -16,15 +16,6 @@ build_SUBDIRS := \
Mono.Posix \
System.Core
-net_1_1_java_SUBDIRS = \
- System.Xml \
- System.Data \
- System.Drawing \
- Novell.Directory.Ldap \
- System.DirectoryServices \
- System.Runtime.Serialization.Formatters.Soap \
- System.Runtime.Remoting
-
net_2_0_dirs := \
corlib \
System \
diff --git a/mcs/class/Managed.Windows.Forms/Makefile b/mcs/class/Managed.Windows.Forms/Makefile
index 37a323899b..556fab1dc3 100644
--- a/mcs/class/Managed.Windows.Forms/Makefile
+++ b/mcs/class/Managed.Windows.Forms/Makefile
@@ -100,7 +100,7 @@ TEST_DISTFILES = \
EXTRA_DISTFILES = \
README System.Windows.Forms.dll.resources \
- $(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) build-csproj build-csproj2k5 \
+ $(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) \
$(IMAGES_RESOURCES) \
$(TEST_DISTFILES)
diff --git a/mcs/class/Managed.Windows.Forms/build-csproj b/mcs/class/Managed.Windows.Forms/build-csproj
deleted file mode 100755
index 8479a337f0..0000000000
--- a/mcs/class/Managed.Windows.Forms/build-csproj
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/bin/bash
-#
-# I got tired of editing the SWF.csproj
-# This script will generate it from our System.Windows.Forms.dll.sources
-#
-#
-
-tr=tr
-OutFile=SWF.csproj
-Source=System.Windows.Forms.dll.sources
-Resource=System.Windows.Forms.dll.resources
-
-SWFhead()
-{
-cat << EOT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-EOT
-}
-
-SWFfilelist()
-{
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
-SRC=`echo $SRC | $tr '/' '\\\\'`
-cat << EOT
-
-EOT
-fi
-done
-}
-
-SWFresourcelist()
-{
-cat $Resource | while read SRC; do
-SRC=`echo $SRC | $tr '/' '\\\\'`
-SRC=`echo $SRC | sed 's/-resource://' | awk -F , '{print " RelPath = \"" $1 "\"\n CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
-
-cat << EOT
-
-EOT
-done
-}
-
-SWFtail()
-{
-cat << EOT
-
-
-
-
-
-
-EOT
-}
-
-SWFhead > $OutFile
-SWFfilelist >> $OutFile
-SWFresourcelist >> $OutFile
-SWFtail >> $OutFile
-
diff --git a/mcs/class/Managed.Windows.Forms/build-csproj2k5 b/mcs/class/Managed.Windows.Forms/build-csproj2k5
deleted file mode 100755
index 4e444186a4..0000000000
--- a/mcs/class/Managed.Windows.Forms/build-csproj2k5
+++ /dev/null
@@ -1,247 +0,0 @@
-#!/bin/bash
-#
-# This script will generate SWF.cs.target from our System.Windows.Forms.dll.sources
-#
-#
-
-exec > SWF2k5.csproj
-
-Source=System.Windows.Forms.dll.sources
-Resource=System.Windows.Forms.dll.resources
-
-SWFhead()
-{
- cat <
-
- Local
- 8.0.50727
- 2.0
- {5E6430B2-6B9F-4E76-802E-20207EF80391}
- Debug
- AnyCPU
-
-
-
-
- System.Windows.Forms
-
-
- JScript
- Grid
- IE50
- false
- Library
-
-
- OnBuildSuccess
-
-
-
-
-
-
-
-
- bin\Debug\
- true
- 285212672
- false
-
-
- NET_1_1 NET_2_0 MWF_ON_MSRUNTIME
-
-
- true
- 4096
- false
- 612,618,3021
- false
- false
- false
- false
- 3
- full
- prompt
- Library
- System.Windows.Forms
-
-
- bin\Release\
- true
- 285212672
- false
-
-
- NET_1_1 NET_2_0 MWF_ON_MSRUNTIME
-
-
- false
- 4096
- false
- 612,618,3021
- false
- false
- false
- false
- 3
- none
- prompt
- Library
- System.Windows.Forms
-
-
- bin\Debug\
- true
- 285212672
- false
-
-
- NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME
-
-
- true
- 4096
- false
- 612,618,3021
- false
- false
- false
- false
- 3
- full
- prompt
- Library
- System.Windows.Forms
-
-
- bin\Release\
- true
- 285212672
- false
-
-
- NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME
-
-
- false
- 4096
- false
- 612,618,3021
- false
- false
- false
- false
- 3
- none
- prompt
- Library
- System.Windows.Forms
-
-
-
- Accessibility
-
-
- System
-
-
-
- System.Data
-
-
- System.Data
-
-
- System.Drawing
-
-
- System.Xml
-
-
- Mono.WebBrowser2K5
-
-
-
-
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}
- Mono.WebBrowser2K5
-
-
-EOF
-}
-
-SWFtail()
-{
- cat <
-
-
-
-
-
-
-
-
-
-
-
-
-
-EOF
-}
-
-SWFfilelist()
-{
-echo " "
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
-SRC=`echo $SRC | sed 's/..\/..\/build\///'`
-SRC=`echo $SRC | tr '/' '\\\\'`
-cat <
-EOF
-fi
-done
-echo " "
-}
-
-SWFresourcelist()
-{
-echo " "
- cat $Resource | while read SRC; do
- CUSTOMTOOLNAMESPACE=""
-
- # strip out that -resource:
- SRC=`echo $SRC | sed 's/-resource://'`
-
- CUSTOMTOOLNAMESPACE=`echo $SRC | awk -F, '{print $2}'`
-
- INCLUDE=`echo $SRC | awk -F, '{print $1}'`
-
- if test -f $INCLUDE.prebuilt; then
- INCLUDE=$INCLUDE.prebuilt
- fi
-
- # strip off the path from the name of the resource and the .prebuilt if there is one
- LOGICALNAME=`echo $INCLUDE | sed 's/resources\///;s/.prebuilt//'`
-
- # convert all /'s to \\'s
- INCLUDE=`echo $INCLUDE | sed 's/\//\\\\/'`
-
- echo " "
- if test "x$CUSTOMTOOLNAMESPACE" != "x"; then
- echo " $CUSTOMTOOLNAMESPACE"
- else
- echo " $LOGICALNAME"
- fi
- echo " "
- done
-echo " "
-}
-
-SWFhead
-SWFfilelist
-SWFresourcelist
-SWFtail
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
index d0048815a1..3ffeaeb16b 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
@@ -78,43 +78,38 @@ namespace Microsoft.Build.BuildEngine {
if (propertyName != null)
element.SetAttribute ("PropertyName", propertyName);
}
-
- [MonoTODO]
+
public bool Execute ()
{
- bool result = false;
TaskEngine taskEngine;
LogTaskStarted ();
- ITask task = null;
+ ITask task;
try {
- try {
- task = InitializeTask ();
- } catch (Exception e) {
- LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
- LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
- taskElement.LocalName, e.ToString ());
- return false;
- }
-
- try {
- taskEngine = new TaskEngine (parentTarget.Project);
- taskEngine.Prepare (task, this.taskElement, GetParameters (), this.Type);
- result = taskEngine.Execute ();
- if (result)
- taskEngine.PublishOutput ();
- } catch (Exception e) {
- task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
- task_logger.LogMessage (MessageImportance.Low,
- "Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
- result = false;
- }
- } finally {
- LogTaskFinished (result);
+ task = InitializeTask ();
+ } catch (Exception e) {
+ LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
+ LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
+ taskElement.LocalName, e.ToString ());
+ return false;
}
- return result;
+ try {
+ taskEngine = new TaskEngine (parentTarget.Project, task, Type);
+ taskEngine.Prepare (GetParameters ());
+ var result = taskEngine.Execute ();
+ if (result)
+ taskEngine.PublishOutput (taskElement, taskEngine.ValueFromExecution);
+
+ LogTaskFinished (result);
+ return result;
+ } catch (Exception e) {
+ task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
+ task_logger.LogMessage (MessageImportance.Low,
+ "Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
+ return false;
+ }
}
@@ -140,6 +135,21 @@ namespace Microsoft.Build.BuildEngine {
return taskElement.GetAttribute (attributeName);
}
+
+ bool IBuildTask.ResolveOutputItems ()
+ {
+ var taskEngine = new TaskEngine (parentTarget.Project, null, Type);
+
+ taskEngine.PublishOutput (taskElement, l => {
+ var pv = GetParameterValue (l.Name);
+
+ Expression exp = new Expression ();
+ exp.Parse (pv, ParseOptions.AllowItemsMetadataAndSplit);
+ return exp.ConvertTo (parentTarget.Project, l.PropertyType);
+ });
+
+ return true;
+ }
public void SetParameterValue (string parameterName,
string parameterValue)
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskItem.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskItem.cs
index 3fc4f14807..fb1f788925 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskItem.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskItem.cs
@@ -73,6 +73,11 @@ namespace Microsoft.Build.BuildEngine
foreach (XmlAttribute attrib in XmlElement.Attributes)
yield return attrib.Value;
}
+
+ public bool ResolveOutputItems ()
+ {
+ return true;
+ }
}
}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs
index b5482ae166..38cef0f0d0 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTaskPropertyGroup.cs
@@ -52,7 +52,11 @@ namespace Microsoft.Build.BuildEngine {
{
return GetAttributes ();
}
-
+
+ public bool ResolveOutputItems ()
+ {
+ return true;
+ }
}
}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IBuildTask.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IBuildTask.cs
index aa182487b6..d1553720f1 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IBuildTask.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IBuildTask.cs
@@ -38,6 +38,7 @@ namespace Microsoft.Build.BuildEngine {
}
bool Execute ();
+ bool ResolveOutputItems ();
IEnumerable GetAttributes ();
}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
index 3873a93c49..8597b026b3 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
@@ -36,7 +36,6 @@ using System.Xml;
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
-
internal class TargetBatchingImpl : BatchingImplBase
{
string inputs;
@@ -58,17 +57,6 @@ namespace Microsoft.Build.BuildEngine {
{
executeOnErrors = false;
try {
- string reason;
- if (!BuildTargetNeeded (out reason)) {
- LogTargetStarted (target);
- LogTargetSkipped (target, reason);
- LogTargetFinished (target, true);
- return true;
- }
-
- if (!String.IsNullOrEmpty (reason))
- target.Engine.LogMessage (MessageImportance.Low, reason);
-
Init ();
ParseTargetAttributes (target);
@@ -104,24 +92,52 @@ namespace Microsoft.Build.BuildEngine {
executeOnErrors = false;
LogTargetStarted (target);
+
if (bucket != null)
project.PushBatch (bucket, commonItemsByName);
- try {
- string reason;
- if (!BuildTargetNeeded (out reason)) {
- LogTargetSkipped (target, reason);
- return true;
- }
- if (!String.IsNullOrEmpty (reason))
- target.Engine.LogMessage (MessageImportance.Low, reason);
+ try {
+ TaskExecutionMode taskExecutionMode;
+ string reason;
+ bool skip_completely;
+ if (!BuildTargetNeeded (out reason, out skip_completely)) {
+ LogTargetSkipped (target, reason);
+ if (skip_completely)
+ return true;
+
+ taskExecutionMode = TaskExecutionMode.SkipAndSetOutput;
+ } else {
+ taskExecutionMode = TaskExecutionMode.Complete;
+
+ if (!String.IsNullOrEmpty (reason))
+ target.Engine.LogMessage (MessageImportance.Low, reason);
+ }
for (int i = 0; i < target.BuildTasks.Count; i ++) {
//FIXME: parsing attributes repeatedly
IBuildTask bt = target.BuildTasks [i];
+ // HACK: need some form of cross references checks
+ var tem = taskExecutionMode;
+ if (tem == TaskExecutionMode.SkipAndSetOutput) {
+ var bti = bt as BuildTask;
+
+ //
+ // BuildTargetNeeded checks only files timestamps but ignores any metadata dependencies
+ // that way we can end up in the situation when output metadata are populated but from
+ // incomplete dependencies.
+ //
+ // E.g.
+ //
+ //
+ //
+ //
+ if (bti != null && bti.Name == "CreateItem")
+ tem = TaskExecutionMode.Complete;
+ }
+
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
- bool task_result = batchingImpl.Build (bt, out executeOnErrors);
+ bool task_result = batchingImpl.Build (bt, tem, out executeOnErrors);
if (task_result)
continue;
@@ -138,6 +154,7 @@ namespace Microsoft.Build.BuildEngine {
} finally {
if (bucket != null)
project.PopBatch ();
+
LogTargetFinished (target, target_result);
}
@@ -155,15 +172,17 @@ namespace Microsoft.Build.BuildEngine {
ParseAttribute (outputs);
}
- bool BuildTargetNeeded (out string reason)
+ bool BuildTargetNeeded (out string reason, out bool skipCompletely)
{
reason = String.Empty;
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime youngestInput, oldestOutput;
+ skipCompletely = false;
- if (String.IsNullOrEmpty (inputs.Trim ()))
+ if (String.IsNullOrEmpty (inputs.Trim ())) {
return true;
+ }
if (String.IsNullOrEmpty (outputs.Trim ())) {
project.ParentEngine.LogError ("Target {0} has inputs but no outputs specified.", name);
@@ -184,6 +203,7 @@ namespace Microsoft.Build.BuildEngine {
}
if (inputFiles == null || inputFiles.Length == 0) {
+ skipCompletely = true;
reason = String.Format ("No input files were specified for target {0}, skipping.", name);
return false;
}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
index 80e1d5272a..b262838564 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
@@ -40,7 +40,7 @@ namespace Microsoft.Build.BuildEngine {
{
}
- public bool Build (IBuildTask buildTask, out bool executeOnErrors)
+ public bool Build (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
try {
@@ -49,15 +49,11 @@ namespace Microsoft.Build.BuildEngine {
// populate list of referenced items and metadata
ParseTaskAttributes (buildTask);
if (consumedMetadataReferences.Count == 0) {
- // No batching required
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project))
- return buildTask.Execute ();
- else // skipped, it should be logged
- return true;
+ return Execute (buildTask, taskExecutionMode);
}
BatchAndPrepareBuckets ();
- return Run (buildTask, out executeOnErrors);
+ return Run (buildTask, taskExecutionMode, out executeOnErrors);
} finally {
consumedItemsByName = null;
consumedMetadataReferences = null;
@@ -68,7 +64,7 @@ namespace Microsoft.Build.BuildEngine {
}
}
- bool Run (IBuildTask buildTask, out bool executeOnErrors)
+ bool Run (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
@@ -76,11 +72,9 @@ namespace Microsoft.Build.BuildEngine {
bool retval = true;
if (buckets.Count == 0) {
// batched mode, but no values in the corresponding items!
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
- retval = buildTask.Execute ();
- if (!retval && !buildTask.ContinueOnError)
- executeOnErrors = true;
- }
+ retval = Execute (buildTask, taskExecutionMode);
+ if (!retval && !buildTask.ContinueOnError)
+ executeOnErrors = true;
return retval;
}
@@ -89,12 +83,10 @@ namespace Microsoft.Build.BuildEngine {
foreach (Dictionary bucket in buckets) {
project.PushBatch (bucket, commonItemsByName);
try {
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
- retval = buildTask.Execute ();
- if (!retval && !buildTask.ContinueOnError) {
- executeOnErrors = true;
- break;
- }
+ retval = Execute (buildTask, taskExecutionMode);
+ if (!retval && !buildTask.ContinueOnError) {
+ executeOnErrors = true;
+ break;
}
} finally {
project.PopBatch ();
@@ -104,6 +96,22 @@ namespace Microsoft.Build.BuildEngine {
return retval;
}
+ bool Execute (IBuildTask buildTask, TaskExecutionMode taskExecutionMode)
+ {
+ if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
+ switch (taskExecutionMode) {
+ case TaskExecutionMode.Complete:
+ return buildTask.Execute ();
+ case TaskExecutionMode.SkipAndSetOutput:
+ return buildTask.ResolveOutputItems ();
+ default:
+ throw new NotImplementedException ();
+ }
+ }
+
+ return true;
+ }
+
// Parse task attributes to get list of referenced metadata and items
// to determine batching
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
index 335c66b459..7e7c0c148e 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
@@ -38,10 +38,9 @@ using Microsoft.Build.Utilities;
namespace Microsoft.Build.BuildEngine {
internal class TaskEngine {
- ITask task;
- XmlElement taskElement;
Type taskType;
Project parentProject;
+ ITask task;
static Type requiredAttribute;
static Type outputAttribute;
@@ -52,9 +51,11 @@ namespace Microsoft.Build.BuildEngine {
outputAttribute = typeof (Microsoft.Build.Framework.OutputAttribute);
}
- public TaskEngine (Project project)
+ public TaskEngine (Project project, ITask task, Type taskType)
{
parentProject = project;
+ this.task = task;
+ this.taskType = taskType;
}
// Rules (inferred) for property values incase of empty data
@@ -69,17 +70,13 @@ namespace Microsoft.Build.BuildEngine {
// string/
// ITaskItem[] empty/whitespace null No
- public void Prepare (ITask task, XmlElement taskElement,
- IDictionary parameters, Type taskType)
+ public void Prepare (IDictionary parameters)
{
Dictionary values;
PropertyInfo currentProperty;
PropertyInfo[] properties;
object value;
- this.task = task;
- this.taskElement = taskElement;
- this.taskType = taskType;
values = new Dictionary (StringComparer.OrdinalIgnoreCase);
foreach (KeyValuePair de in parameters) {
@@ -131,20 +128,18 @@ namespace Microsoft.Build.BuildEngine {
InitializeParameter (pi, val);
}
}
-
+
public bool Execute ()
{
return task.Execute ();
}
- public void PublishOutput ()
+ public void PublishOutput (XmlElement taskElement, Func valueProvider)
{
XmlElement xmlElement;
- PropertyInfo propertyInfo;
string propertyName;
string taskParameter;
string itemName;
- object o;
foreach (XmlNode xmlNode in taskElement.ChildNodes) {
if (!(xmlNode is XmlElement))
@@ -165,16 +160,17 @@ namespace Microsoft.Build.BuildEngine {
taskParameter = xmlElement.GetAttribute ("TaskParameter");
itemName = xmlElement.GetAttribute ("ItemName");
propertyName = xmlElement.GetAttribute ("PropertyName");
-
- propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.IgnoreCase);
+
+ var propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
+
if (propertyInfo == null)
- throw new InvalidProjectFileException (String.Format (
- "The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
+ throw new InvalidProjectFileException (String.Format ("The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
+
if (!propertyInfo.IsDefined (outputAttribute, false))
- throw new InvalidProjectFileException ("This is not output property.");
+ throw new InvalidProjectFileException ("This is not output property.");
- o = propertyInfo.GetValue (task, null);
+ var o = valueProvider (propertyInfo);
+
if (itemName != String.Empty) {
PublishItemGroup (propertyInfo, o, itemName);
} else {
@@ -260,5 +256,10 @@ namespace Microsoft.Build.BuildEngine {
return true;
}
+
+ public object ValueFromExecution (PropertyInfo propertyInfo)
+ {
+ return propertyInfo.GetValue (task, null);
+ }
}
}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskExecutionMode.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskExecutionMode.cs
new file mode 100644
index 0000000000..268cffb7e9
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskExecutionMode.cs
@@ -0,0 +1,36 @@
+//
+// TaskExecutionMode.cs
+//
+// Authors:
+// Marek Safar
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace Microsoft.Build.BuildEngine
+{
+ enum TaskExecutionMode
+ {
+ Complete = 0,
+ SkipAndSetOutput = 1
+ }
+}
\ No newline at end of file
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
index 5c4612001e..a25d7363cd 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
@@ -65,6 +65,7 @@ Microsoft.Build.BuildEngine/TargetCollection.cs
Microsoft.Build.BuildEngine/Target.cs
Microsoft.Build.BuildEngine/TaskDatabase.cs
Microsoft.Build.BuildEngine/TaskEngine.cs
+Microsoft.Build.BuildEngine/TaskExecutionMode.cs
Microsoft.Build.BuildEngine/Token.cs
Microsoft.Build.BuildEngine/Toolset.cs
Microsoft.Build.BuildEngine/ToolsetCollection.cs
diff --git a/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs b/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
index ee93c4b932..3a07eb289f 100755
--- a/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
@@ -1402,6 +1402,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
}
[Test]
+ // Fails on wrench
+ [Category ("NotWorking")]
public void TestItemsWithWildcards ()
{
Engine engine = new Engine (Consts.BinPath);
@@ -1476,6 +1478,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
}
[Test]
+ // Fails on wrench
+ [Category ("NotWorking")]
public void TestReservedMetadata ()
{
Engine engine = new Engine (Consts.BinPath);
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
index c23e7427cc..20566ffe21 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventArgs.cs
@@ -83,6 +83,11 @@ namespace Microsoft.Build.Framework
get {
return message;
}
+#if NET_4_0
+ protected set {
+ message = value;
+ }
+#endif
}
public string SenderName {
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs
index 2a550f46dc..f65feb3848 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/BuildEventContext.cs
@@ -26,12 +26,12 @@ namespace Microsoft.Build.Framework
{
}
- public BuildEventContext (int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
- : this (rnd.Next (), nodeId, projectInstanceId, targetId, projectContextId, taskId)
+ public BuildEventContext (int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
+ : this (rnd.Next (), nodeId, projectInstanceId, projectContextId, targetId, taskId)
{
}
- public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
+ public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
{
SubmissionId = submissionId;
NodeId = nodeId;
@@ -56,9 +56,9 @@ namespace Microsoft.Build.Framework
public int TaskId { get; private set; }
// MSDN document says "true if the references are equal, false otherwise." but that doesn't make sense.
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var o = other as BuildEventContext;
+ var o = obj as BuildEventContext;
return (object) o != null &&
o.NodeId == NodeId &&
o.ProjectContextId == ProjectContextId &&
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs
index ad629ec180..26a0306278 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/LazyFormattedBuildEventArgs.cs
@@ -32,7 +32,7 @@ using System;
namespace Microsoft.Build.Framework
{
[Serializable]
- public abstract class LazyFormattedBuildEventArgs : BuildEventArgs {
+ public class LazyFormattedBuildEventArgs : BuildEventArgs {
string message, format;
object[] args;
diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs
index 121107824c..e8ecdaecf0 100644
--- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs
+++ b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework/RegisteredTaskObjectLifetime.cs
@@ -3,8 +3,8 @@ namespace Microsoft.Build.Framework
{
public enum RegisteredTaskObjectLifetime
{
- AppDomain,
- Build
+ Build,
+ AppDomain
}
}
#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CodeTaskFactory.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CodeTaskFactory.cs
index 5e85303698..fcb56e166e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CodeTaskFactory.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CodeTaskFactory.cs
@@ -41,7 +41,7 @@ using System.Collections.Specialized;
namespace Microsoft.Build.Tasks
{
- public class CodeTaskFactory : ITaskFactory2
+ public class CodeTaskFactory : ITaskFactory
{
public CodeTaskFactory ()
{
@@ -51,11 +51,12 @@ namespace Microsoft.Build.Tasks
public void CleanupTask (ITask task)
{
}
- public ITask CreateTask (IBuildEngine taskFactoryLoggingHost)
+ public ITask CreateTask (IBuildEngine loggingHost)
{
- return CreateTask (taskFactoryLoggingHost, null);
+ return CreateTask (loggingHost, null);
}
- public ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary taskIdentityParameters)
+
+ ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary taskIdentityParameters)
{
if (assembly == null)
return null;
@@ -66,11 +67,11 @@ namespace Microsoft.Build.Tasks
{
return parameter_group != null ? parameter_group.Values.ToArray () : new TaskPropertyInfo [0];
}
- public bool Initialize (string taskName, IDictionary parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
+ public bool Initialize (string taskName, IDictionary taskParameters, string taskElementContents, IBuildEngine taskFactoryLoggingHost)
{
- return Initialize (taskName, null, parameterGroup, taskBody, taskFactoryLoggingHost);
+ return Initialize (taskName, null, taskParameters, taskElementContents, taskFactoryLoggingHost);
}
- public bool Initialize (string taskName, IDictionary factoryIdentityParameters, IDictionary parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
+ bool Initialize (string taskName, IDictionary factoryIdentityParameters, IDictionary parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
{
task_name = taskName;
if (parameterGroup != null)
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
index 0388364f8b..f3b78a6302 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
@@ -122,7 +122,7 @@ namespace Microsoft.Build.Tasks {
protected abstract string CreateManifestName (string fileName,
string linkFileName,
- string rootNamespace,
+ string rootNamespaceName,
string dependentUponFileName,
Stream binaryStream);
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateTemporaryVCProject.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateTemporaryVCProject.cs
index c905f6b1f5..ebabe1103a 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateTemporaryVCProject.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateTemporaryVCProject.cs
@@ -26,7 +26,7 @@
///// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/////
-#if NET_2_0
+#if !NET_4_0
using System;
using Microsoft.Build.Framework;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
index 142e73edde..06b04b2670 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs
@@ -25,8 +25,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_2_0
-
using System;
using System.IO;
using Microsoft.Build.Framework;
@@ -102,12 +100,12 @@ namespace Microsoft.Build.Tasks {
//
if (References != null)
foreach (ITaskItem item in References) {
- string aliases = item.GetMetadata ("Aliases") ?? String.Empty;
- aliases = aliases.Trim ();
- if (aliases.Length > 0)
- commandLine.AppendSwitchIfNotNull ("/reference:" + aliases + "=", item.ItemSpec);
- else
+ string aliases = item.GetMetadata ("Aliases");
+ if (!string.IsNullOrEmpty (aliases)) {
+ AddAliasesReference (commandLine, aliases, item.ItemSpec);
+ } else {
commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
+ }
}
if (ResponseFiles != null)
@@ -125,6 +123,21 @@ namespace Microsoft.Build.Tasks {
commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
}
+ static void AddAliasesReference (CommandLineBuilderExtension commandLine, string aliases, string reference)
+ {
+ foreach (var alias in aliases.Split (',')) {
+ var a = alias.Trim ();
+ if (a.Length == null)
+ continue;
+
+ var r = "/reference:";
+ if (!string.Equals (a, "global", StringComparison.OrdinalIgnoreCase))
+ r += a + "=";
+
+ commandLine.AppendSwitchIfNotNull (r, reference);
+ }
+ }
+
[MonoTODO]
protected override bool CallHostObjectToExecute ()
{
@@ -232,4 +245,3 @@ namespace Microsoft.Build.Tasks {
}
}
-#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
index 33beac3038..cfcc2d6589 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
@@ -122,13 +122,13 @@ namespace Microsoft.Build.Tasks {
Log.LogMessage (MessageImportance.Normal, "Executing: " + command);
}
- protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
#if NET_4_0
if (IgnoreStandardErrorWarningFormat ||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
#endif
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
}
#if NET_4_0
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs
index 5630482be2..99c7602942 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs
@@ -36,7 +36,7 @@ using Microsoft.Build.Utilities;
namespace Microsoft.Build.Tasks {
//FIXME: This should be in v3.5 only
- public sealed class FindAppConfigFile : TaskExtension {
+ public class FindAppConfigFile : TaskExtension {
public FindAppConfigFile ()
{
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
index e78b92dc8f..a8ad35c8e6 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs
@@ -222,7 +222,6 @@ namespace Microsoft.Build.Tasks
"It should have either 2 or 3 comma separated components.", moniker_literal);
}
- [Required]
public string TargetFrameworkMoniker { get; set; }
public string RootPath { get; set; }
@@ -233,10 +232,10 @@ namespace Microsoft.Build.Tasks
public string TargetFrameworkMonikerDisplayName { get; set; }
[Output]
- public string[] ReferenceAssemblyPaths { get; set; }
+ public string[] ReferenceAssemblyPaths { get; private set; }
[Output]
- public string[] FullFrameworkReferenceAssemblyPaths { get; set; }
+ public string[] FullFrameworkReferenceAssemblyPaths { get; private set; }
static string DefaultFrameworksBasePath {
get {
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
index 491d1c5a18..5a40c8e0c1 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
@@ -53,7 +53,6 @@ namespace Microsoft.Build.Tasks {
bool findRelatedFiles;
bool findSatellites;
bool findSerializationAssemblies;
- string[] installedAssemblyTables;
ITaskItem[] relatedFiles;
ITaskItem[] resolvedDependencyFiles;
ITaskItem[] resolvedFiles;
@@ -156,6 +155,9 @@ namespace Microsoft.Build.Tasks {
LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference {0}", item.ItemSpec);
ResolvedReference resolved_ref = ResolveReference (item, searchPaths, true);
+ if (resolved_ref == null)
+ resolved_ref = ResolveWithAlternateName (item, allowedAssemblyExtensions ?? default_assembly_extensions);
+
if (resolved_ref == null) {
Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal);
@@ -182,6 +184,19 @@ namespace Microsoft.Build.Tasks {
}
}
+
+ ResolvedReference ResolveWithAlternateName (ITaskItem item, string[] extensions)
+ {
+ foreach (string extn in extensions) {
+ if (item.ItemSpec.EndsWith (extn)) {
+ ITaskItem altitem = new TaskItem (item.ItemSpec.Substring (0, item.ItemSpec.Length - extn.Length));
+ item.CopyMetadataTo (altitem);
+ return ResolveReference (altitem, searchPaths, true);
+ }
+ }
+ return null;
+ }
+
// Use @search_paths to resolve the reference
ResolvedReference ResolveReference (ITaskItem item, IEnumerable search_paths, bool set_copy_local)
{
@@ -610,12 +625,15 @@ namespace Microsoft.Build.Tasks {
get { return findSerializationAssemblies; }
set { findSerializationAssemblies = value; }
}
-
- public string[] InstalledAssemblyTables {
- get { return installedAssemblyTables; }
- set { installedAssemblyTables = value; }
- }
-
+
+ public
+#if NET_4_0
+ ITaskItem[]
+#else
+ string[]
+#endif
+ InstalledAssemblyTables { get; set; }
+
[Output]
public ITaskItem[] RelatedFiles {
get { return relatedFiles; }
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/VCBuild.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/VCBuild.cs
index 53e6f32e5b..23e7e2c3c7 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/VCBuild.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/VCBuild.cs
@@ -1,5 +1,5 @@
//
-// UpdateManifest.cs
+// VCBuild.cs
//
// Author:
// Leszek Ciesielski
@@ -26,7 +26,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
+#if !NET_4_0
using System;
using System.Collections.Specialized;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
index 107f9eb289..a004b65ac6 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Vbc.cs
@@ -158,7 +158,7 @@ namespace Microsoft.Build.Tasks {
return true;
}
- protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
singleLine = singleLine.Trim ();
if (singleLine.Length == 0)
@@ -173,7 +173,7 @@ namespace Microsoft.Build.Tasks {
Match match = ErrorRegex.Match (singleLine);
if (!match.Success) {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
return;
}
@@ -198,7 +198,7 @@ namespace Microsoft.Build.Tasks {
Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
-1, text, null);
} else {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
}
}
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CscTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CscTest.cs
index 846f47e627..711bdb26af 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CscTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CscTest.cs
@@ -433,6 +433,24 @@ namespace MonoTests.Microsoft.Build.Tasks {
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
}
+ [Test]
+ public void TestReferencesAlias ()
+ {
+ CscExtended csc = new CscExtended ();
+ CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
+ CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
+
+ TaskItem ti1 = new TaskItem ("A");
+ ti1.SetMetadata ("Aliases", "r1,global,r2");
+
+ csc.References = new ITaskItem[2] { ti1, new TaskItem ("B") };
+ csc.ARFC (c1);
+ csc.ACLC (c2);
+
+ Assert.AreEqual ("/reference:r1=A /reference:A /reference:r2=A /reference:B", c1.ToString (), "A1");
+ Assert.AreEqual (String.Empty, c2.ToString (), "A2");
+ }
+
[Test]
public void TestResponseFiles ()
{
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
index 60dda50317..5d802a32fa 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
@@ -227,6 +227,52 @@ namespace MonoTests.Microsoft.Build.Tasks {
";
}
+ [Test]
+ public void TestSystemDll ()
+ {
+ var gacDir = GetGacDir ();
+
+ if (gacDir == null || !System.IO.Directory.Exists (gacDir))
+ Assert.Ignore ("GAC not found.");
+
+ string documentString = @"
+
+
+
+
+
+
+ {CandidateAssemblyFiles};
+ $(ReferencePath);
+ {HintPathFromItem};
+ {TargetFrameworkDirectory};
+ {AssemblyFolders};
+ {GAC};
+ {RawFileName};
+ $(OutputPath)
+
+
+
+
+
+
+
+
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
+ }
+
string GetGacDir ()
{
// copied from mcs/tools/gacutil/driver.cs
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Logger.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Logger.cs
index ac1153bbdd..075575e1aa 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Logger.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Logger.cs
@@ -112,9 +112,9 @@ namespace Microsoft.Build.Utilities
}
[MonoTODO]
- public bool IsVerbosityAtLeast (LoggerVerbosity verbosity)
+ public bool IsVerbosityAtLeast (LoggerVerbosity checkVerbosity)
{
- return (this.verbosity >= verbosity) ? true : false;
+ return this.verbosity >= checkVerbosity;
}
}
}
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
index 11a9229539..089d0a40c0 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
@@ -127,31 +127,31 @@ namespace Microsoft.Build.Utilities
hasLoggedErrors = true;
}
- public void LogErrorFromException (Exception e)
+ public void LogErrorFromException (Exception exception)
{
- LogErrorFromException (e, true);
+ LogErrorFromException (exception, true);
}
- public void LogErrorFromException (Exception e,
+ public void LogErrorFromException (Exception exception,
bool showStackTrace)
{
- LogErrorFromException (e, showStackTrace, true, String.Empty);
+ LogErrorFromException (exception, showStackTrace, true, String.Empty);
}
[MonoTODO ("Arguments @showDetail and @file are not honored")]
- public void LogErrorFromException (Exception e,
+ public void LogErrorFromException (Exception exception,
bool showStackTrace, bool showDetail, string file)
{
- if (e == null)
- throw new ArgumentNullException ("e");
+ if (exception == null)
+ throw new ArgumentNullException ("exception");
StringBuilder sb = new StringBuilder ();
- sb.Append (e.Message);
+ sb.Append (exception.Message);
if (showStackTrace == true)
- sb.Append (e.StackTrace);
+ sb.Append (exception.StackTrace);
BuildErrorEventArgs beea = new BuildErrorEventArgs (
null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, sb.ToString (),
- e.HelpLink, e.Source);
+ exception.HelpLink, exception.Source);
buildEngine.LogErrorEvent (beea);
hasLoggedErrors = true;
}
@@ -239,16 +239,16 @@ namespace Microsoft.Build.Utilities
messageResourceName), messageArgs);
}
- public bool LogMessagesFromFile (string filename)
+ public bool LogMessagesFromFile (string fileName)
{
- return LogMessagesFromFile (filename, MessageImportance.Normal);
+ return LogMessagesFromFile (fileName, MessageImportance.Normal);
}
- public bool LogMessagesFromFile (string filename,
+ public bool LogMessagesFromFile (string fileName,
MessageImportance messageImportance)
{
try {
- StreamReader sr = new StreamReader (filename);
+ StreamReader sr = new StreamReader (fileName);
LogMessage (messageImportance, sr.ReadToEnd (),
null);
sr.Close ();
@@ -276,14 +276,14 @@ namespace Microsoft.Build.Utilities
}
public bool LogMessageFromText (string lineOfText,
- MessageImportance importance)
+ MessageImportance messageImportance)
{
if (lineOfText == null)
throw new ArgumentNullException ("lineOfText");
BuildMessageEventArgs bmea = new BuildMessageEventArgs (
lineOfText, helpKeywordPrefix,
- null, importance);
+ null, messageImportance);
buildEngine.LogMessageEvent (bmea);
return true;
@@ -313,18 +313,18 @@ namespace Microsoft.Build.Utilities
buildEngine.LogWarningEvent (bwea);
}
- public void LogWarningFromException (Exception e)
+ public void LogWarningFromException (Exception exception)
{
- LogWarningFromException (e, false);
+ LogWarningFromException (exception, false);
}
- public void LogWarningFromException (Exception e,
+ public void LogWarningFromException (Exception exception,
bool showStackTrace)
{
StringBuilder sb = new StringBuilder ();
- sb.Append (e.Message);
+ sb.Append (exception.Message);
if (showStackTrace)
- sb.Append (e.StackTrace);
+ sb.Append (exception.StackTrace);
LogWarning (null, null, null, null, 0, 0, 0, 0,
sb.ToString (), null);
}
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
index 82b576272a..ded4b425c6 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
@@ -233,10 +233,10 @@ namespace Microsoft.Build.Utilities
}
}
- protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
if (singleLine.Length == 0) {
- Log.LogMessage (singleLine, importance);
+ Log.LogMessage (singleLine, messageImportance);
return;
}
@@ -254,7 +254,7 @@ namespace Microsoft.Build.Utilities
var result = MSBuildErrorParser.TryParseLine (singleLine);
if (result == null) {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
return;
}
@@ -304,7 +304,7 @@ namespace Microsoft.Build.Utilities
return String.Format ("@{0}", responseFilePath);
}
- protected virtual ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
+ protected ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
{
var pinfo = new ProcessStartInfo (pathToTool, String.Format ("{0} {1}", commandLineCommands, responseFileSwitch));
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs
index 5b13e20240..8791eee590 100644
--- a/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs
+++ b/mcs/class/Microsoft.Build/Microsoft.Build.Construction/ProjectItemElement.cs
@@ -62,14 +62,28 @@ namespace Microsoft.Build.Construction
}
string @remove;
public string Remove { get { return @remove ?? String.Empty; } set { @remove = value; } }
- #if NET_4_5
string keepDuplicates;
- public string KeepDuplicates { get { return keepDuplicates ?? String.Empty; } set { keepDuplicates = value; } }
- string keepMetadata;
- public string KeepMetadata { get { return keepMetadata ?? String.Empty; } set { keepMetadata = value; } }
- string removeMetadata;
- public string RemoveMetadata { get { return removeMetadata ?? String.Empty; } set { removeMetadata = value; } }
+ string keepMetadata;
+ string removeMetadata;
+ #if NET_4_5
+ public
+ #else
+ internal
#endif
+ string KeepDuplicates { get { return keepDuplicates ?? String.Empty; } set { keepDuplicates = value; } }
+ #if NET_4_5
+ public
+ #else
+ internal
+ #endif
+ string KeepMetadata { get { return keepMetadata ?? String.Empty; } set { keepMetadata = value; } }
+ #if NET_4_5
+ public
+ #else
+ internal
+ #endif
+ string RemoveMetadata { get { return removeMetadata ?? String.Empty; } set { removeMetadata = value; } }
+
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
{
var metadata = ContainingProject.CreateMetadataElement (name, unevaluatedValue);
@@ -83,11 +97,9 @@ namespace Microsoft.Build.Construction
{
SaveAttribute (writer, "Include", Include);
SaveAttribute (writer, "Exclude", Exclude);
-#if NET_4_5
SaveAttribute (writer, "KeepDuplicates", KeepDuplicates);
SaveAttribute (writer, "KeepMetadata", KeepMetadata);
SaveAttribute (writer, "RemoveMetadata", RemoveMetadata);
-#endif
SaveAttribute (writer, "Remove", Remove);
base.SaveValue (writer);
}
@@ -101,7 +113,6 @@ namespace Microsoft.Build.Construction
case "Exclude":
Exclude = value;
break;
-#if NET_4_5
case "KeepDuplicates":
KeepDuplicates = value;
break;
@@ -111,7 +122,6 @@ namespace Microsoft.Build.Construction
case "RemoveMetadata":
RemoveMetadata = value;
break;
-#endif
case "Remove":
Remove = value;
break;
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs
index 0c179afa48..ea1e146a0d 100644
--- a/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs
+++ b/mcs/class/Microsoft.Build/Microsoft.Build.Execution/BuildManager.cs
@@ -61,7 +61,6 @@ namespace Microsoft.Build.Execution
~BuildManager ()
{
// maybe processes created by out-of-process nodes should be signaled.
- BuildNodeManager.Stop ();
}
readonly List submissions = new List ();
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs
index 4dc8b32c94..76f7f906e8 100644
--- a/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs
+++ b/mcs/class/Microsoft.Build/Microsoft.Build.Internal/BuildEngine4.cs
@@ -595,6 +595,10 @@ namespace Microsoft.Build.Internal
foreach (DictionaryEntry p in globalProperties)
globalPropertiesThatMakeSense [(string) p.Key] = (string) p.Value;
var projectToBuild = new ProjectInstance (ProjectRootElement.Create (XmlReader.Create (projectFileName)), globalPropertiesThatMakeSense, toolsVersion, Projects);
+ // Not very sure if ALL of these properties should be added, but some are certainly needed.
+ foreach (var p in this.project.Properties.Where (p => !globalProperties.Contains (p.Name)))
+ projectToBuild.SetProperty (p.Name, p.EvaluatedValue);
+
IDictionary outs;
var ret = projectToBuild.Build (targetNames ?? new string [] {"Build"}, Projects.Loggers, out outs);
foreach (var p in outs)
diff --git a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources
index 10ae513e22..7b65749c86 100644
--- a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources
+++ b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources
@@ -15,6 +15,7 @@ Microsoft.Build.Execution/BuildSubmissionTest.cs
Microsoft.Build.Execution/ProjectInstanceTest.cs
Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs
Microsoft.Build.Execution/ProjectTargetInstanceTest.cs
+Microsoft.Build.Execution/ProjectTaskInstanceTest.cs
Microsoft.Build.Internal/CollectionFromEnumerableTest.cs
Microsoft.Build.Internal/ExpressionParserTest.cs
Microsoft.Build.Logging/ConsoleLoggerTest.cs
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs
index 2430ecce09..970240fa74 100644
--- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs
+++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs
@@ -40,15 +40,13 @@ namespace MonoTests.Microsoft.Build.Evaluation
public class ProjectCollectionTest
{
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void GlobalProperties ()
{
var g = ProjectCollection.GlobalProjectCollection;
Assert.AreEqual (0, g.GlobalProperties.Count, "#1");
+ #if NET_4_5
Assert.IsTrue (g.GlobalProperties.IsReadOnly, "#2");
+ #endif
}
[Test]
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs
index f5f880a0b5..f5de47d4a7 100644
--- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs
+++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs
@@ -143,12 +143,12 @@ namespace MonoTests.Microsoft.Build.Evaluation
[Test]
public void BuildCSharpTargetGetFrameworkPaths ()
{
- string project_xml = @"
+ string project_xml = @"";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
- var proj = new Project (root);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new Project (root);
root.FullPath = "ProjectTest.BuildCSharpTargetGetFrameworkPaths.proj";
Assert.IsTrue (proj.Build ("GetFrameworkPaths", new ILogger [] {/*new ConsoleLogger ()*/}));
}
@@ -156,14 +156,14 @@ namespace MonoTests.Microsoft.Build.Evaluation
[Test]
public void ProperiesMustBeDistinct ()
{
- string project_xml = @"
+ string project_xml = @"FooTest";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj";
var proj = new Project (root);
var list = new List ();
@@ -173,20 +173,16 @@ namespace MonoTests.Microsoft.Build.Evaluation
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void BuildCSharpTargetBuild ()
{
- string project_xml = @"
+ string project_xml = @"Foo";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj";
var proj = new Project (root, null, "4.0");
Assert.IsFalse (proj.Build ("Build", new ILogger [] {/*new ConsoleLogger (LoggerVerbosity.Diagnostic)*/})); // missing mandatory properties
@@ -195,7 +191,7 @@ namespace MonoTests.Microsoft.Build.Evaluation
[Test]
public void EvaluateItemConditionThenIgnored ()
{
- string project_xml = @"
+ string project_xml = @"
@@ -218,7 +214,7 @@ namespace MonoTests.Microsoft.Build.Evaluation
public void EvaluateSamePropertiesInOrder ()
{
// used in Microsoft.Common.targets
- string project_xml = @"
+ string project_xml = @"obj\
@@ -258,52 +254,44 @@ namespace MonoTests.Microsoft.Build.Evaluation
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void CreateProjectInstance ()
{
- string project_xml = @"
+ string project_xml = @"Foo";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
var proj = new Project (root, null, "4.0");
var inst = proj.CreateProjectInstance ();
Assert.AreEqual ("4.0", inst.ToolsVersion, "#1");
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void LoadCaseInsensitive ()
{
- string project_xml = @"
+ string project_xml = @"Foo";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
new Project (root, null, "4.0");
}
[Test]
public void SameNameTargets ()
{
- string project_xml = @"
+ string project_xml = @"";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
var proj = new Project (root, null, "4.0");
var sw = new StringWriter ();
proj.Build (new ConsoleLogger (LoggerVerbosity.Diagnostic, sw.WriteLine, null, null));
@@ -338,4 +326,3 @@ namespace MonoTests.Microsoft.Build.Evaluation
}
}
}
-
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs
index 30524ffd27..4e23c2a7a5 100644
--- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs
+++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs
@@ -310,6 +310,34 @@ namespace MonoTests.Microsoft.Build.Execution
Assert.AreEqual (";_AddCorlibReference", p.EvaluatedValue, "#2");
}
+ [Test]
+ public void ItemsAndPostEvaluationCondition ()
+ {
+ // target-assigned property X is not considered when evaluating condition for C.
+ string project_xml = @"
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ root.FullPath = "ProjectInstanceTest.ItemsAndPostEvaluationCondition.proj";
+ var proj = new ProjectInstance (root);
+ Assert.AreEqual (1, proj.Items.Count, "Count1");
+ Assert.IsFalse (proj.Build (), "Build");
+ Assert.AreEqual (1, proj.Items.Count, "Count2");
+ }
+
[Test]
[Category ("NotWorking")] // until we figure out why it fails on wrench.
public void ItemsInTargets ()
@@ -341,6 +369,33 @@ namespace MonoTests.Microsoft.Build.Execution
Assert.IsTrue (items.Any (), "items.Any");
Assert.IsTrue (!string.IsNullOrEmpty (items.First ().EvaluatedInclude), "item.EvaluatedInclude");
}
+
+ [Test]
+ [Category ("NotWorking")]
+ public void ConditionalCyclicDependence ()
+ {
+ string project_xml = @"
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ root.FullPath = "ProjectInstanceTest.ConditionalCyclicDependence.proj";
+ var proj = new ProjectInstance (root, null, "4.0", ProjectCollection.GlobalProjectCollection);
+ Assert.IsTrue (proj.Build (), "#1");
+ Assert.IsFalse (proj.Build ("Build2", new ILogger [0]), "#2");
+ }
}
namespace SubNamespace
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTaskInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTaskInstanceTest.cs
new file mode 100644
index 0000000000..c94bef7d69
--- /dev/null
+++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectTaskInstanceTest.cs
@@ -0,0 +1,84 @@
+//
+// ProjectInstanceTest.cs
+//
+// Author:
+// Atsushi Enomoto (atsushi@xamarin.com)
+//
+// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.IO;
+using System.Linq;
+using System.Xml;
+using Microsoft.Build.Construction;
+using Microsoft.Build.Execution;
+using NUnit.Framework;
+using Microsoft.Build.Evaluation;
+using Microsoft.Build.Utilities;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Logging;
+
+namespace MonoTests.Microsoft.Build.Execution
+{
+ [TestFixture]
+ public class ProjectTaskInstanceTest
+ {
+#if NET_4_5
+ [Test]
+ public void OutputPropertyExists ()
+ {
+ string project_xml = @"
+
+
+ False
+
+
+
+
+
+
+
+
+
+
+
+";
+ var xml = XmlReader.Create (new StringReader(project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new ProjectInstance (root);
+ Assert.AreEqual (5, proj.Targets.Count, "#1");
+ var foo = proj.Targets ["Foo"];
+ Assert.IsNotNull (foo, "#2");
+ Assert.AreEqual (1, foo.Tasks.Count, "#3");
+ var cp = foo.Tasks.First ();
+ Assert.AreEqual (1, cp.Outputs.Count, "#4");
+ var po = cp.Outputs.First () as ProjectTaskOutputPropertyInstance;
+ Assert.IsNotNull (po, "#5");
+ Assert.AreEqual ("C", po.PropertyName, "#5");
+ proj.Build ("Build", null);
+ Assert.AreEqual (string.Empty, foo.Outputs, "#6");
+ Assert.AreEqual ("True", proj.GetPropertyValue ("C"), "#7");
+ }
+#endif
+ }
+}
+
diff --git a/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs b/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
index 9c406a200c..5d798ac5d2 100644
--- a/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
@@ -303,6 +303,10 @@ namespace Mono.Security.Cryptography {
e = new BigInteger (parameters.Exponent);
n = new BigInteger (parameters.Modulus);
+
+ //reset all private key values to null
+ d = dp = dq = qInv = p = q = null;
+
// only if the private key is present
if (parameters.D != null)
d = new BigInteger (parameters.D);
diff --git a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/RSAManagedTest.cs b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/RSAManagedTest.cs
index 10b8a12339..5b30c72f2e 100644
--- a/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/RSAManagedTest.cs
+++ b/mcs/class/Mono.Security/Test/Mono.Security.Cryptography/RSAManagedTest.cs
@@ -545,5 +545,25 @@ namespace MonoTests.Mono.Security.Cryptography {
byte [] bytes = Convert.FromBase64String (b64);
rsa.DecryptValue (bytes);
}
+
+ [Test]
+ public void Bug18482 ()
+ {
+ RSAManaged privateRsa = new RSAManaged ();
+ privateRsa.FromXmlString (MonoXml384);
+
+ var rsaParameters = privateRsa.ExportParameters (false);
+
+ RSAManaged publicRsa = new RSAManaged ();
+
+ //Generates a key pair with private key values
+ publicRsa.ExportParameters (false);
+
+ //Sets public key values and should reset private key values
+ publicRsa.ImportParameters (rsaParameters);
+
+ //Should export valid parameters without throwing an exception.
+ publicRsa.ExportParameters (false);
+ }
}
}
diff --git a/mcs/class/Mono.WebBrowser/Makefile b/mcs/class/Mono.WebBrowser/Makefile
index 98d0800038..af65ef0faa 100644
--- a/mcs/class/Mono.WebBrowser/Makefile
+++ b/mcs/class/Mono.WebBrowser/Makefile
@@ -7,11 +7,7 @@ LIB_MCS_FLAGS = -r:System.dll -warn:1
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-EXTRA_DISTFILES = README build-csproj2k5
-
-Mono.WebBrowser2K5.csproj: Mono.WebBrowser.dll.sources build-csproj2k5
- ./build-csproj2k5
+EXTRA_DISTFILES = README
include ../../build/library.make
-$(the_lib): Mono.WebBrowser2K5.csproj
diff --git a/mcs/class/Mono.WebBrowser/build-csproj2k5 b/mcs/class/Mono.WebBrowser/build-csproj2k5
deleted file mode 100755
index 9e7a613829..0000000000
--- a/mcs/class/Mono.WebBrowser/build-csproj2k5
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/sh
-#
-# This script will generate SWF.cs.target from our System.Windows.Forms.dll.sources
-#
-#
-
-exec > Mono.WebBrowser2K5.csproj
-
-Source=Mono.WebBrowser.dll.sources
-
-dohead()
-{
- cat <
-
- Local
- 8.0.50727
- 2.0
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}
- Debug
- AnyCPU
-
-
-
-
- Mono.WebBrowser
-
-
- JScript
- Grid
- IE50
- false
- Library
- Mono.WebBrowser
- OnBuildSuccess
-
-
-
-
-
-
-
-
- bin\Debug\
- false
- 285212672
- false
-
-
- DEBUG;TRACE
-
-
- true
- 4096
- false
-
-
- false
- false
- false
- false
- 4
- full
- prompt
-
-
- bin\Release\
- false
- 285212672
- false
-
-
- TRACE
-
-
- false
- 4096
- false
-
-
- true
- false
- false
- false
- 4
- none
- prompt
-
-
-
- System
-
-
-EOF
-}
-
-dotail()
-{
- cat <
-
-
-
-
-
-
-
-
-
-
-
-
-EOF
-}
-
-dofilelist()
-{
-echo " "
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" -a "x$SRC" != "x../../build/common/Consts.cs" ] ; then
-SRC=`echo $SRC | sed 's/..\/..\/build\///'`
-SRC=`echo $SRC | tr '/' '\\\\'`
-cat <
-EOF
-fi
-done
-echo " "
-}
-
-dohead
-dofilelist
-dotail
diff --git a/mcs/class/Novell.Directory.Ldap/Makefile b/mcs/class/Novell.Directory.Ldap/Makefile
index 678b605577..7ecbff311e 100644
--- a/mcs/class/Novell.Directory.Ldap/Makefile
+++ b/mcs/class/Novell.Directory.Ldap/Makefile
@@ -4,22 +4,12 @@ include ../../build/rules.make
LIBRARY = Novell.Directory.Ldap.dll
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS = \
- /nowarn:649 /nowarn:169 /nowarn:219 /nowarn:168 \
- -r:$(corlib) \
- -r:System.dll \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- $(RESX_RES:%=/res:%)
-else
LIB_MCS_FLAGS = \
-warn:1 -nowarn:612 \
-r:$(corlib) \
-r:System.dll \
-r:Mono.Security.dll \
$(RESX_RES:%=/res:%)
-endif
include ../../build/library.make
@@ -33,16 +23,7 @@ $(RESULTCODE_MESSAGES): Novell.Directory.Ldap.Utilclass/ResultCodeMessages.txt
$(RESGEN) $< $@
EXTRA_DISTFILES = \
- net_1_1_java_Novell.Directory.Ldap.dll.sources \
Novell.Directory.Ldap.Rfc2251/RfcLdapURL.cs \
- Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs \
- Novell.Directory.Ldap.Security.jvm/ChangeLog \
- Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs \
- Novell.Directory.Ldap.Security.jvm/SecureStream.cs \
- Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs \
Novell.Directory.Ldap.Utilclass/ExceptionMessages.resx \
Novell.Directory.Ldap.Utilclass/ExceptionMessages.txt \
Novell.Directory.Ldap.Utilclass/ResultCodeMessages.resx \
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs
deleted file mode 100644
index 486ab61b5e..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.AuthenticationCallbackHandler.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using javax.security.auth.callback;
-using java.io;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class AuthenticationCallbackHandler : CallbackHandler
- {
-
- #region Fields
-
- private readonly string _username;
- private readonly string _password;
-
- #endregion //Fields
-
- #region Constructors
-
- public AuthenticationCallbackHandler(string username, string password)
- {
- _username = username;
- _password = password;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public void handle(Callback [] callbacks)
- {
- for (int i = 0; i < callbacks.Length; i++) {
- if (callbacks [i] is NameCallback) {
- NameCallback nc = (NameCallback) callbacks [i];
- nc.setName (_username);
- }
- else if (callbacks [i] is PasswordCallback) {
- PasswordCallback pc = (PasswordCallback) callbacks [i];
- pc.setPassword (_password.ToCharArray ());
- }
- else {
- throw new UnsupportedCallbackException (callbacks [i], "Unrecognized Callback");
- }
- }
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ChangeLog b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ChangeLog
deleted file mode 100644
index be95898738..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ChangeLog
+++ /dev/null
@@ -1,27 +0,0 @@
-2005-11-06 Konstantin Triger
-
- * SecureStream.cs, CreateContextPrivilegedAction.cs, Krb5Helper.cs:
- create GSSCredential only once, cleanup
-
-2005-11-03 Konstantin Triger
-
- * CreateContextPrivilegedAction.cs: always require mutual auth;
- require integrity by default.
- * Krb5Helper.cs: for wrap/unwrap: always create MessageProp with
- pribState set.
-
-2005-14-08 Boris Kirzner
- * Krb5Helper.cs: ExchangeTokens does proper final handshaking. Wrap/Unwrap
- perform no action if no integrity and encryption accured.
- * SecureStream.cs: Private convertion methods became internal, used by
- Krb5Helper.
-
-2005-28-07 Boris Kirzner
- * Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/SecureStream.cs,
- Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs,
- Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs: added
- new classes implementing kerberos authntication support.
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs
deleted file mode 100644
index 73b280f558..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.CreateContextPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using java.security;
-using org.ietf.jgss;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class CreateContextPrivilegedAction : PrivilegedAction
- {
- #region Fields
-
- private readonly bool _encryption;
- private readonly bool _signing;
- private readonly bool _delegation;
- private readonly string _name;
- private readonly string _clientName;
- private readonly string _mech;
-
- #endregion //Fields
-
- #region Constructors
-
- public CreateContextPrivilegedAction(string name, string clientName, string mech, bool encryption, bool signing, bool delegation)
- {
- _name = name;
- _clientName = clientName;
- _mech = mech;
- _encryption = encryption;
- _signing = signing;
- _delegation = delegation;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public object run()
- {
- try {
- Oid krb5Oid = new Oid (_mech);
- GSSManager manager = GSSManager.getInstance ();
- GSSName clientName =
- manager.createName(_clientName, GSSName__Finals.NT_USER_NAME);
- GSSCredential clientCreds =
- manager.createCredential(clientName,
- GSSContext__Finals.INDEFINITE_LIFETIME,
- krb5Oid,
- GSSCredential__Finals.INITIATE_ONLY);
-
-// try {
- GSSName serverName = manager.createName (_name, GSSName__Finals.NT_HOSTBASED_SERVICE, krb5Oid);
- GSSContext context = manager.createContext (serverName, krb5Oid, clientCreds, GSSContext__Finals.INDEFINITE_LIFETIME);
-
- context.requestMutualAuth(true);
- context.requestConf (_encryption);
- if (!_encryption || _signing)
- context.requestInteg (!_encryption || _signing);
- context.requestCredDeleg (_delegation);
-
- return context;
-// }
-// finally {
-// // Calling this throws GSSException: Operation unavailable...
-// clientCreds.dispose();
-// }
- }
- catch (GSSException e) {
- throw new PrivilegedActionException (e);
- }
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs
deleted file mode 100644
index 9b58ff50d9..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.Krb5Helper.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using vmw.common;
-
-using java.security;
-using javax.security.auth;
-using org.ietf.jgss;
-
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class Krb5Helper : IDisposable
- {
- enum QOP {
- NO_PROTECTION = 1,
- INTEGRITY_ONLY_PROTECTION = 2,
- PRIVACY_PROTECTION = 4
- }
-
- #region Fields
-
- internal static readonly sbyte [] EmptyToken = new sbyte [0];
-
- private readonly bool _encryption;
- private readonly bool _signing;
- private readonly bool _delegation;
-
- private readonly GSSContext _context;
-
- #endregion // Fields
-
- #region Constructors
-
- public Krb5Helper(string name, string clientName, Subject subject, AuthenticationTypes authenticationTypes, string mech)
- {
- _encryption = (authenticationTypes & AuthenticationTypes.Sealing) != 0;
- _signing = (authenticationTypes & AuthenticationTypes.Signing) != 0;
- _delegation = (authenticationTypes & AuthenticationTypes.Delegation) != 0;
-
- CreateContextPrivilegedAction action = new CreateContextPrivilegedAction (name, clientName, mech,_encryption,_signing,_delegation);
- try {
- _context = (GSSContext) Subject.doAs (subject,action);
- }
- catch (PrivilegedActionException e) {
- throw new LdapException ("Problem performing token exchange with the server",LdapException.OTHER,"",e.getCause());
- }
- }
-
- #endregion // Constructors
-
- #region Properties
-
- internal GSSContext Context
- {
- get { return _context; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public sbyte [] ExchangeTokens(sbyte [] clientToken)
- {
- if (Context.isEstablished ()) {
- if (clientToken == null || clientToken.Length == 0)
- return Krb5Helper.EmptyToken;
-
- //final handshake
- byte [] challengeData = (byte []) TypeUtils.ToByteArray (clientToken);
- byte [] gssOutToken = Unwrap (challengeData, 0, challengeData.Length, new MessageProp (false));
-
- QOP myCop = QOP.NO_PROTECTION;
-
- if (_encryption)
- myCop = QOP.PRIVACY_PROTECTION;
- else if (_signing || (((QOP)gssOutToken [0] & QOP.INTEGRITY_ONLY_PROTECTION) != 0))
- myCop = QOP.INTEGRITY_ONLY_PROTECTION;
-
- if ((myCop & (QOP)gssOutToken [0]) == 0)
- throw new LdapException ("Server does not support the requested security level", 80, "");
-
- int srvMaxBufSize = SecureStream.NetworkByteOrderToInt (gssOutToken, 1, 3);
-
- //int rawSendSize = Context.getWrapSizeLimit(0, _encryption, srvMaxBufSize);
-
- byte [] gssInToken = new byte [4];
- gssInToken [0] = (byte) myCop;
-
- SecureStream.IntToNetworkByteOrder (srvMaxBufSize, gssInToken, 1, 3);
-
- gssOutToken = Wrap (gssInToken, 0, gssInToken.Length, new MessageProp (true));
-
- return TypeUtils.ToSByteArray (gssOutToken);
- }
-
- sbyte [] token = Context.initSecContext (clientToken, 0, clientToken.Length);
-
- if (Context.isEstablished ()) {
-
- if (Context.getConfState () != _encryption)
- throw new LdapException ("Encryption protocol was not established layer between client and server", 80, "");
-
- if (Context.getCredDelegState () != _delegation)
- throw new LdapException ("Credential delegation was not established layer between client and server", 80, "");
-
- if (_signing && (Context.getIntegState () != _signing))
- throw new LdapException ("Signing protocol was not established layer between client and server", 80, "");
-
- if (token == null)
- return EmptyToken;
- }
- return token;
- }
-
- public byte [] Wrap(byte [] outgoing, int start, int len)
- {
- return Wrap (outgoing, start, len, new MessageProp(true));
- }
-
- public byte [] Wrap(byte [] outgoing, int start, int len, MessageProp messageProp)
- {
- if (!Context.isEstablished ())
- throw new LdapException ("GSSAPI authentication not completed",LdapException.OTHER,"");
-
- if (!(Context.getConfState () || Context.getIntegState ())) {
- // in the case no encryption and no integrity required - return the original data
- byte [] buff = new byte [len];
- Array.Copy (outgoing, start, buff, 0, len);
- return buff;
- }
-
- sbyte [] result = Context.wrap (TypeUtils.ToSByteArray (outgoing), start, len, messageProp);
- return (byte []) TypeUtils.ToByteArray (result);
- }
-
- public byte [] Unwrap(byte [] incoming, int start, int len)
- {
- return Unwrap (incoming, start, len, new MessageProp(true));
- }
-
- public byte [] Unwrap(byte [] incoming, int start, int len, MessageProp messageProp)
- {
- if (!Context.isEstablished ())
- throw new LdapException ("GSSAPI authentication not completed",LdapException.OTHER,"");
-
- if (!(Context.getConfState () || Context.getIntegState ())) {
- // in the case no encryption and no integrity required - return the original data
- byte [] buff = new byte [len];
- Array.Copy (incoming, start, buff, 0, len);
- return buff;
- }
-
- sbyte [] result = Context.unwrap (TypeUtils.ToSByteArray (incoming), start, len, messageProp);
- return (byte []) TypeUtils.ToByteArray (result);
- }
-
- #endregion // Methods
-
- #region IDisposable Members
-
- public void Dispose() {
- Context.dispose();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/SecureStream.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/SecureStream.cs
deleted file mode 100644
index 08a37e6718..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/SecureStream.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.SecureStream.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class SecureStream : Stream
- {
- #region Fields
-
- private readonly Stream _stream;
- private readonly Krb5Helper _helper;
-
- private readonly byte [] _lenBuf = new byte [4];
- private byte [] _buffer;
- private int _bufferPosition;
-
- #endregion // Fields
-
- #region Constructors
-
- public SecureStream(Stream stream, Krb5Helper helper): base ()
- {
- _stream = stream;
- _helper = helper;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override bool CanRead
- {
- get { return _stream.CanRead; }
- }
-
- public override bool CanSeek
- {
- get { return _stream.CanSeek; }
- }
-
- public override bool CanWrite
- {
- get { return _stream.CanWrite; }
- }
-
- public override long Length
- {
- get { throw new NotSupportedException (); }
- }
-
- public override long Position
- {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public override void Flush()
- {
- _stream.Flush ();
- }
-
- public override int Read( byte [] buffer, int offset, int count)
- {
- if (_buffer == null || _bufferPosition >= _buffer.Length) {
- int actual = Fill ();
- while (actual == 0)
- actual = Fill ();
-
- if (actual == -1)
- return -1;
- }
-
- int available = _buffer.Length - _bufferPosition;
- if (count > available) {
- Array.Copy (_buffer, _bufferPosition, buffer, offset, available);
- _bufferPosition = _buffer.Length;
- return available;
- }
- else {
- Array.Copy (_buffer, _bufferPosition, buffer, offset, count);
- _bufferPosition += count;
- return count;
- }
- }
-
- public override void Close() {
- _stream.Close();
- _helper.Dispose();
- }
-
- private int Fill()
- {
- int actual = ReadAll (_lenBuf, 4);
-
- if (actual != 4)
- return -1;
-
- int length = NetworkByteOrderToInt (_lenBuf, 0, 4);
-
-// if (length > _recvMaxBufSize)
-// throw new LdapException(length + " exceeds the negotiated receive buffer size limit: " + _recvMaxBufSize, 80, "");
-
- byte [] rawBuffer = new byte [length];
- actual = ReadAll (rawBuffer, length);
-
- if (actual != length)
- throw new LdapException("Expected to read " + length + " bytes, but get " + actual, 80, "");
-
- _buffer = _helper.Unwrap (rawBuffer, 0, length);
- _bufferPosition = 0;
- return _buffer.Length;
- }
-
- private int ReadAll(byte [] buffer, int total)
- {
- int count = 0;
- int pos = 0;
- while (total > 0) {
- count = _stream.Read (buffer, pos, total);
-
- if (count == -1)
- break;
- //return ((pos == 0) ? -1 : pos);
-
- pos += count;
- total -= count;
- }
- return pos;
- }
-
- public override long Seek(long offset, SeekOrigin loc)
- {
- return _stream.Seek (offset, loc);
- }
-
- public override void SetLength(long value)
- {
- _stream.SetLength (value);
- }
-
- public override void Write(byte [] buffer, int offset, int count)
- {
- // FIXME: use GSSCOntext.getWrapSizeLimit to divide the buffer
- // Generate wrapped token
- byte [] wrappedToken = _helper.Wrap (buffer, offset, count);
- // Write out length
- IntToNetworkByteOrder (wrappedToken.Length, _lenBuf, 0, 4);
- _stream.Write (_lenBuf, 0, 4);
- // Write out wrapped token
- _stream.Write (wrappedToken, 0, wrappedToken.Length);
- }
-
- internal static int NetworkByteOrderToInt(byte [] buf, int start, int count)
- {
- int answer = 0;
- for (int i = 0; i < count; i++) {
- answer <<= 8;
- answer |= ((int)buf [start + i] & 0xff);
- }
- return answer;
- }
-
- internal static void IntToNetworkByteOrder(int num, byte [] buf, int start, int count)
- {
- for (int i = count-1; i >= 0; i--) {
- buf [start + i] = (byte)(num & 0xff);
- num >>= 8;
- }
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs
deleted file mode 100644
index 7320678c9b..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.UnwrapPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using vmw.common;
-
-using java.security;
-using org.ietf.jgss;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class UnwrapPrivilegedAction : PrivilegedAction
- {
- #region Fields
-
- private readonly byte [] _buffer;
- private readonly int _start;
- private readonly int _len;
- private readonly GSSContext _context;
- private readonly MessageProp _messageProperties;
-
- #endregion // Fields
-
- #region Constructors
-
- public UnwrapPrivilegedAction(GSSContext context, byte [] buffer, int start, int len, MessageProp messageProperties)
- {
- _buffer = buffer;
- _start = start;
- _len = len;
- _context = context;
- _messageProperties = messageProperties;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public object run()
- {
- try {
- sbyte [] result = _context.unwrap (TypeUtils.ToSByteArray (_buffer), _start, _len, _messageProperties);
- return (byte []) TypeUtils.ToByteArray (result);
- }
- catch (GSSException e) {
- throw new PrivilegedActionException (e);
- }
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs
deleted file mode 100644
index 8ec5a61676..0000000000
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Novell.Directory.Ldap.Security.WrapPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using vmw.common;
-
-using java.security;
-using org.ietf.jgss;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class WrapPrivilegedAction : PrivilegedAction
- {
- #region Fields
-
- private readonly byte [] _buffer;
- private readonly int _start;
- private readonly int _len;
- private readonly GSSContext _context;
- private readonly MessageProp _messageProperties;
-
- #endregion // Fields
-
- #region Constructors
-
- public WrapPrivilegedAction(GSSContext context, byte [] buffer, int start, int len, MessageProp messageProperties)
- {
- _buffer = buffer;
- _start = start;
- _len = len;
- _context = context;
- _messageProperties = messageProperties;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public object run()
- {
- try {
- sbyte [] result = _context.wrap (TypeUtils.ToSByteArray (_buffer), _start, _len, _messageProperties);
- return (byte []) TypeUtils.ToByteArray (result);
- }
- catch (GSSException e) {
- throw new PrivilegedActionException (e);
- }
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
index 701ce4b9a7..87a5a89b00 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
@@ -33,11 +33,6 @@ using System;
namespace Novell.Directory.Ldap.Utilclass
{
-#if TARGET_JVM
- // This dummy class workarounds a MS CSC bug by using SupportClass before
- // using its inner class (SupportClass.AbstractSetSupport)
- class RespExtensionSetDummy : SupportClass {}
-#endif
/// This class extends the AbstractSet and Implements the Set
/// so that it can be used to maintain a list of currently
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
index b5563d56cd..cba8084028 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
@@ -48,9 +48,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright(" (C) 2003 Novell, Inc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-#if !TARGET_JVM
[assembly: CLSCompliant(true)]
-#endif
//
// Version information for an assembly consists of the following four values:
@@ -65,8 +63,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyVersion (Consts.FxVersion)]
-#if (!TARGET_JVM)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
-#endif
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
index 1dc6815123..f2ef8e9959 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
@@ -34,10 +34,8 @@ using System.Threading;
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
using Mono.Security.X509.Extensions;
-#endif
using Syscert = System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Net;
@@ -45,9 +43,7 @@ using System.Net.Sockets;
using System.Collections;
using System.IO;
using System.Text;
-#if !TARGET_JVM
using Mono.Security.X509;
-#endif
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
@@ -735,7 +731,6 @@ namespace Novell.Directory.Ldap
{
if ((in_Renamed == null) || (out_Renamed == null))
{
-#if !TARGET_JVM
if(Ssl)
{
this.host = host;
@@ -796,13 +791,10 @@ namespace Novell.Directory.Ldap
out_Renamed = (System.IO.Stream) sslstream;*/
}
else{
-#endif
socket = new System.Net.Sockets.TcpClient(host, port);
in_Renamed = (System.IO.Stream) socket.GetStream();
out_Renamed = (System.IO.Stream) socket.GetStream();
-#if !TARGET_JVM
}
-#endif
}
else
{
@@ -1140,11 +1132,9 @@ namespace Novell.Directory.Ldap
if (socket != null || sock != null)
{
-#if !TARGET_JVM
// Just before closing the sockets, abort the reader thread
if ((reader != null) && (reason != "reader: thread stopping"))
reader.Abort();
-#endif
// Close the socket
try
{
@@ -1264,7 +1254,6 @@ namespace Novell.Directory.Ldap
/* package */
internal void startTLS()
{
-#if !TARGET_JVM
try
{
waitForReader(null);
@@ -1333,7 +1322,6 @@ namespace Novell.Directory.Ldap
throw new LdapException("The host is unknown", LdapException.CONNECT_ERROR, null, uhe);
}
return ;
-#endif
}
/*
@@ -1544,15 +1532,6 @@ namespace Novell.Directory.Ldap
// before closing sockets, from shutdown
return;
}
-#if TARGET_JVM
- catch (ObjectDisposedException)
- {
- // we do not support Thread.Abort under java
- // so we close the stream and the working thread
- // catches ObjectDisposedException exception
- return;
- }
-#endif
catch (System.IO.IOException ioe)
{
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs.REMOVED.git-id b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs.REMOVED.git-id
index 74eefb9d97..42dec22c0d 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs.REMOVED.git-id
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs.REMOVED.git-id
@@ -1 +1 @@
-f6c72497f9ebb2e89ab4dfc6ca0449f273721981
\ No newline at end of file
+35ee09ca1511efe2fa2328e3243d485753151325
\ No newline at end of file
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
index 0f9033a3db..450ad08164 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
@@ -87,14 +87,10 @@ using System;
[CLSCompliantAttribute(false)]
public static sbyte[] ToSByteArray(byte[] byteArray)
{
-#if TARGET_JVM
- return vmw.common.TypeUtils.ToSByteArray(byteArray);
-#else
sbyte[] sbyteArray = new sbyte[byteArray.Length];
for(int index=0; index < byteArray.Length; index++)
sbyteArray[index] = (sbyte) byteArray[index];
return sbyteArray;
-#endif
}
/*******************************/
///
@@ -105,14 +101,10 @@ using System;
[CLSCompliantAttribute(false)]
public static byte[] ToByteArray(sbyte[] sbyteArray)
{
-#if TARGET_JVM
- return (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);;
-#else
byte[] byteArray = new byte[sbyteArray.Length];
for(int index=0; index < sbyteArray.Length; index++)
byteArray[index] = (byte) sbyteArray[index];
return byteArray;
-#endif
}
///
diff --git a/mcs/class/Novell.Directory.Ldap/net_1_1_java_Novell.Directory.Ldap.dll.sources b/mcs/class/Novell.Directory.Ldap/net_1_1_java_Novell.Directory.Ldap.dll.sources
deleted file mode 100644
index 0e14b627b3..0000000000
--- a/mcs/class/Novell.Directory.Ldap/net_1_1_java_Novell.Directory.Ldap.dll.sources
+++ /dev/null
@@ -1,3 +0,0 @@
-#include Novell.Directory.Ldap.dll.sources
-Novell.Directory.Ldap.Rfc2251/RfcLdapURL.cs
-Novell.Directory.Ldap.Security.jvm/*.cs
diff --git a/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs b/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
index c1ac154b05..49025b78c0 100644
--- a/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
@@ -56,10 +56,8 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM //TARGET_JVM does not support signing
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
index a49a9679f7..1123e9ad15 100644
--- a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
@@ -769,28 +769,7 @@ namespace System.Configuration
internal class ElementMap
{
-#if TARGET_JVM
- const string elementMapsKey = "ElementMap_elementMaps";
- static Hashtable elementMaps
- {
- get
- {
- Hashtable tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- lock (typeof (ElementMap)) {
- tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- tbl = Hashtable.Synchronized (new Hashtable ());
- AppDomain.CurrentDomain.SetData (elementMapsKey, tbl);
- }
- }
- }
- return tbl;
- }
- }
-#else
static readonly Hashtable elementMaps = Hashtable.Synchronized (new Hashtable ());
-#endif
readonly ConfigurationPropertyCollection properties;
readonly ConfigurationCollectionAttribute collectionAttribute;
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs
index 28b1d6bf3d..28d4fa428d 100644
--- a/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationManager.cs
@@ -119,9 +119,6 @@ namespace System.Configuration {
return ConfigurationFactory.Create (typeof(ExeConfigurationHost), map, userLevel);
}
-#if TARGET_JVM
- [MonoLimitation ("Supported only when the userLevel parameter is set to ConfigurationUserLevel.None. Other values are not supported because Environment.GetFolderPath method is not implemented.")]
-#endif
public static Configuration OpenExeConfiguration (ConfigurationUserLevel userLevel)
{
return OpenExeConfigurationInternal (userLevel, Assembly.GetEntryAssembly () ?? Assembly.GetCallingAssembly (), null);
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs
index 8a76dd6fff..56462d91d5 100644
--- a/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs
@@ -32,9 +32,7 @@
using System.Collections;
using System.Xml;
using System.IO;
-#if !TARGET_JVM
using System.Security.Cryptography.Xml;
-#endif
using System.Configuration.Internal;
namespace System.Configuration
diff --git a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
index 80f410891d..e4d59f1466 100644
--- a/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
+++ b/mcs/class/System.Configuration/System.Configuration/InternalConfigurationHost.cs
@@ -161,34 +161,24 @@ namespace System.Configuration
{
throw new NotImplementedException ();
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_app_config ();
-#endif
public virtual Stream OpenStreamForRead (string streamName)
{
if (String.CompareOrdinal (streamName, System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile) == 0) {
-#if TARGET_JVM
- return (Stream) vmw.common.IOUtils.getStreamForGHConfigs (streamName);
-#else
string bundle = get_bundled_machine_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (String.CompareOrdinal (streamName, AppDomain.CurrentDomain.SetupInformation.ConfigurationFile) == 0) {
-#if TARGET_JVM
- throw new NotImplementedException();
-#else
string bundle = get_bundled_app_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (!File.Exists (streamName))
diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs
index 1efa2b99eb..d2e1a240f6 100644
--- a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs
+++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationManagerTest.cs
@@ -429,11 +429,9 @@ namespace MonoTests.System.Configuration {
{
SysConfig cfg = ConfigurationManager.OpenMachineConfiguration ();
Assert.IsTrue (cfg.Sections.Count > 0, "#1");
-#if !TARGET_JVM
ConfigurationSection s = cfg.SectionGroups ["system.net"].Sections ["connectionManagement"];
Assert.IsNotNull (s, "#2");
Assert.IsTrue (s is ConnectionManagementSection, "#3");
-#endif
}
[Test]
diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationPermissionTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationPermissionTest.cs
index 3ba5d99887..35af604b15 100644
--- a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationPermissionTest.cs
+++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationPermissionTest.cs
@@ -71,7 +71,6 @@ namespace MonoTests.System.Configuration {
Assert.IsNull (p3, "A1");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Intersect_wrongtype ()
@@ -80,7 +79,6 @@ namespace MonoTests.System.Configuration {
IPermission p3 = p1.Intersect (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Union ()
@@ -107,7 +105,6 @@ namespace MonoTests.System.Configuration {
Assert.IsTrue (((ConfigurationPermission)p3).IsUnrestricted(), "A2");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Union_wrongtypee ()
@@ -116,7 +113,6 @@ namespace MonoTests.System.Configuration {
IPermission p3 = p1.Union (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Subset ()
@@ -133,7 +129,6 @@ namespace MonoTests.System.Configuration {
Assert.IsTrue (p2.IsSubsetOf (null), "A6");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Subset_wrongtype ()
@@ -142,12 +137,8 @@ namespace MonoTests.System.Configuration {
Assert.IsFalse (p1.IsSubsetOf (new StrongNameIdentityPermission (PermissionState.Unrestricted)));
}
-#endif
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void ToXml ()
{
ConfigurationPermission p = new ConfigurationPermission (PermissionState.Unrestricted);
diff --git a/mcs/class/System.Configuration/Test/Util/TestUtil.cs b/mcs/class/System.Configuration/Test/Util/TestUtil.cs
index cdaddedbba..585271a2fe 100644
--- a/mcs/class/System.Configuration/Test/Util/TestUtil.cs
+++ b/mcs/class/System.Configuration/Test/Util/TestUtil.cs
@@ -85,13 +85,9 @@ namespace MonoTests.System.Configuration.Util {
public static string ThisConfigFileName {
get {
-#if TARGET_JVM
- return "System.Configuration.Test20.jar.config";
-#else
var asm = Assembly.GetCallingAssembly ();
var exe = Path.GetFileName (asm.Location);
return exe + ".config";
-#endif
}
}
}
diff --git a/mcs/class/System.Core/System.Core.dll.sources b/mcs/class/System.Core/System.Core.dll.sources
index 8f7b67fec8..1c47601634 100644
--- a/mcs/class/System.Core/System.Core.dll.sources
+++ b/mcs/class/System.Core/System.Core.dll.sources
@@ -5,6 +5,7 @@ System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
diff --git a/mcs/class/System.Core/System.Core_test.dll.sources b/mcs/class/System.Core/System.Core_test.dll.sources
index a306dad0d5..f1df65f6d2 100644
--- a/mcs/class/System.Core/System.Core_test.dll.sources
+++ b/mcs/class/System.Core/System.Core_test.dll.sources
@@ -1,5 +1,6 @@
System/TimeZoneInfoTest.cs
System/TimeZoneInfo.AdjustmentRuleTest.cs
+System/TimeZoneInfo.SerializationTest.cs
System/TimeZoneInfo.TransitionTimeTest.cs
System.Collections.Generic/HashSetTest.cs
System.IO.MemoryMappedFiles/MemoryMappedFileTest.cs
diff --git a/mcs/class/System.Core/System.Linq.Expressions/Expression.cs b/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
index 9685771de9..b575b38690 100644
--- a/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
+++ b/mcs/class/System.Core/System.Linq.Expressions/Expression.cs
@@ -2265,11 +2265,9 @@ namespace System.Linq.Expressions {
internal static bool IsUnsigned (Type t)
{
-#if !TARGET_JVM
if (t.IsPointer)
return IsUnsigned (t.GetElementType ());
-#endif
return t == typeof (ushort) ||
t == typeof (uint) ||
t == typeof (ulong) ||
diff --git a/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs b/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs
index 96a5fe1f8e..d1d639b9a1 100644
--- a/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs
+++ b/mcs/class/System.Core/System.Linq.Parallel/ParallelExecuter.cs
@@ -230,18 +230,23 @@ namespace System.Linq.Parallel
var implementerToken = options.ImplementerToken;
try {
+ // Avoid cache thrashing of locals array
+ var local = locals [index];
+
if (seedFunc == null) {
if (!enumerator.MoveNext ())
return;
- locals[index] = (U)(object)enumerator.Current;
+ local = (U)(object)enumerator.Current;
}
while (enumerator.MoveNext ()) {
if (implementerToken.IsCancellationRequested)
break;
token.ThrowIfCancellationRequested ();
- locals[index] = localCall (locals[index], enumerator.Current);
+ local = localCall (local, enumerator.Current);
}
+
+ locals [index] = local;
} finally {
enumerator.Dispose ();
}
diff --git a/mcs/class/System.Core/System/TimeZoneInfo.MonoTouch.cs b/mcs/class/System.Core/System/TimeZoneInfo.MonoTouch.cs
index b0b5faa8af..70b077de98 100644
--- a/mcs/class/System.Core/System/TimeZoneInfo.MonoTouch.cs
+++ b/mcs/class/System.Core/System/TimeZoneInfo.MonoTouch.cs
@@ -64,12 +64,15 @@ namespace System {
[DllImport ("__Internal")]
extern static IntPtr monotouch_timezone_get_data (string name, ref int size);
- static Stream GetMonoTouchData (string name)
+ static Stream GetMonoTouchData (string name, bool throw_on_error = true)
{
int size = 0;
IntPtr data = monotouch_timezone_get_data (name, ref size);
- if (size <= 0)
- throw new TimeZoneNotFoundException ();
+ if (size <= 0) {
+ if (throw_on_error)
+ throw new TimeZoneNotFoundException ();
+ return null;
+ }
unsafe {
var s = new UnmanagedMemoryStream ((byte*) data, size);
diff --git a/mcs/class/System.Core/System/TimeZoneInfo.Serialization.cs b/mcs/class/System.Core/System/TimeZoneInfo.Serialization.cs
new file mode 100644
index 0000000000..22aa38c5fa
--- /dev/null
+++ b/mcs/class/System.Core/System/TimeZoneInfo.Serialization.cs
@@ -0,0 +1,213 @@
+/*
+ * System.TimeZoneInfo.Serialization
+ *
+ * Author(s)
+ * Sasha Kotlyar
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#if (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
+
+using System.Collections.Generic;
+using System.Globalization;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace System
+{
+ public partial class TimeZoneInfo
+ {
+ public static TimeZoneInfo FromSerializedString (string source)
+ {
+ var input = new StringBuilder (source);
+ var tzId = DeserializeString (ref input);
+ var offset = DeserializeInt (ref input);
+ var displayName = DeserializeString (ref input);
+ var standardName = DeserializeString (ref input);
+ var daylightName = DeserializeString (ref input);
+ var rules = new List ();
+ while (input [0] != ';') {
+ rules.Add (DeserializeAdjustmentRule (ref input));
+ }
+ var offsetSpan = TimeSpan.FromMinutes (offset);
+ return TimeZoneInfo.CreateCustomTimeZone (tzId, offsetSpan, displayName, standardName, daylightName, rules.ToArray ());
+ }
+
+ public string ToSerializedString ()
+ {
+ var stb = new StringBuilder ();
+ var daylightName = (string.IsNullOrEmpty(this.DaylightName) ? this.StandardName : this.DaylightName);
+ stb.AppendFormat ("{0};{1};{2};{3};{4};", EscapeForSerialization (this.Id), (int)this.BaseUtcOffset.TotalMinutes,
+ EscapeForSerialization (this.DisplayName), EscapeForSerialization (this.StandardName), EscapeForSerialization (daylightName));
+
+ if (this.SupportsDaylightSavingTime) {
+ foreach (var rule in this.GetAdjustmentRules()) {
+ var start = rule.DateStart.ToString ("MM:dd:yyyy", CultureInfo.InvariantCulture);
+ var end = rule.DateEnd.ToString ("MM:dd:yyyy", CultureInfo.InvariantCulture);
+ var delta = (int)rule.DaylightDelta.TotalMinutes;
+ var transitionStart = SerializeTransitionTime (rule.DaylightTransitionStart);
+ var transitionEnd = SerializeTransitionTime (rule.DaylightTransitionEnd);
+ stb.AppendFormat ("[{0};{1};{2};{3};{4};]", start, end, delta,
+ transitionStart, transitionEnd);
+ }
+ }
+
+ stb.Append (";");
+ return stb.ToString ();
+ }
+
+ private static TimeZoneInfo.AdjustmentRule DeserializeAdjustmentRule (ref StringBuilder input)
+ {
+ // Similar to: [01:01:0001;12:31:9999;60;[0;01:00:00;3;5;0;];[0;02:00:00;10;5;0;];]
+ if (input [0] != '[')
+ throw new SerializationException ();
+ input.Remove (0, 1); // [
+ var dateStart = DeserializeDate (ref input);
+ var dateEnd = DeserializeDate (ref input);
+ var delta = DeserializeInt (ref input);
+ var transitionStart = DeserializeTransitionTime (ref input);
+ var transitionEnd = DeserializeTransitionTime (ref input);
+ input.Remove (0, 1); // ]
+ var deltaSpan = TimeSpan.FromMinutes (delta);
+ return TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, deltaSpan,
+ transitionStart, transitionEnd);
+ }
+
+ private static TimeZoneInfo.TransitionTime DeserializeTransitionTime (ref StringBuilder input)
+ {
+ if (input [0] != '[' || (input [1] != '0' && input [1] != '1') || input [2] != ';')
+ throw new SerializationException ();
+ var rule = input [1];
+ input.Remove (0, 3); // [#;
+ var timeOfDay = DeserializeTime (ref input);
+ var month = DeserializeInt (ref input);
+ if (rule == '0') {
+ // Floating rule such as: [0;01:00:00;3;5;0;];
+ var week = DeserializeInt (ref input);
+ var dayOfWeek = DeserializeInt (ref input);
+ input.Remove (0, 2); // ];
+ return TimeZoneInfo.TransitionTime.CreateFloatingDateRule (timeOfDay, month, week, (DayOfWeek)dayOfWeek);
+ }
+
+ // Fixed rule such as: [1;02:15:59.999;6;2;];
+ var day = DeserializeInt (ref input);
+ input.Remove (0, 2); // ];
+ return TimeZoneInfo.TransitionTime.CreateFixedDateRule (timeOfDay, month, day);
+ }
+
+ private static string DeserializeString (ref StringBuilder input)
+ {
+ var stb = new StringBuilder ();
+ var isEscaped = false;
+ int charCount;
+ for (charCount = 0; charCount < input.Length; charCount++) {
+ var inChar = input [charCount];
+ if (isEscaped) {
+ isEscaped = false;
+ stb.Append (inChar);
+ } else if (inChar == '\\') {
+ isEscaped = true;
+ continue;
+ } else if (inChar == ';') {
+ break;
+ } else {
+ stb.Append (inChar);
+ }
+ }
+ input.Remove (0, charCount + 1);
+ return stb.ToString ();
+ }
+
+ private static int DeserializeInt(ref StringBuilder input)
+ {
+ int charCount = 0;
+ while(charCount++ < input.Length)
+ {
+ if (input[charCount] == ';')
+ break;
+ }
+ int result;
+ if(!int.TryParse(input.ToString(0, charCount), NumberStyles.Integer, CultureInfo.InvariantCulture, out result))
+ throw new SerializationException();
+ input.Remove(0, charCount + 1);
+ return result;
+ }
+
+ private static DateTime DeserializeDate (ref StringBuilder input)
+ {
+ var inChars = new char[11];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ DateTime result;
+ if (!DateTime.TryParseExact (new string (inChars), "MM:dd:yyyy;", CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ }
+
+ private static DateTime DeserializeTime (ref StringBuilder input)
+ {
+ if (input [8] == ';') {
+ // Without milliseconds
+ var inChars = new char[9];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ DateTime result;
+ if (!DateTime.TryParseExact (new string (inChars), "HH:mm:ss;", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ } else if (input [12] == ';') {
+ // With milliseconds
+ char[] inChars = new char[13];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ var inString = new string (inChars);
+ DateTime result;
+ if (!DateTime.TryParseExact (inString, "HH:mm:ss.fff;", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ }
+ throw new SerializationException ();
+ }
+
+ private static string EscapeForSerialization (string unescaped)
+ {
+ return unescaped.Replace (@"\", @"\\").Replace (";", "\\;");
+ }
+
+ private static string SerializeTransitionTime (TimeZoneInfo.TransitionTime transition)
+ {
+ string timeOfDay;
+ if (transition.TimeOfDay.Millisecond > 0)
+ timeOfDay = transition.TimeOfDay.ToString ("HH:mm:ss.fff");
+ else
+ timeOfDay = transition.TimeOfDay.ToString ("HH:mm:ss");
+
+ if (transition.IsFixedDateRule) {
+ return string.Format ("[1;{0};{1};{2};]", timeOfDay, transition.Month, transition.Day);
+ }
+
+ return string.Format ("[0;{0};{1};{2};{3};]", timeOfDay, transition.Month,
+ transition.Week, (int)transition.DayOfWeek);
+ }
+ }
+}
+
+#endif
diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs
index bdcda56546..aead18c764 100644
--- a/mcs/class/System.Core/System/TimeZoneInfo.cs
+++ b/mcs/class/System.Core/System/TimeZoneInfo.cs
@@ -572,11 +572,6 @@ namespace System
}
#endif
- public static TimeZoneInfo FromSerializedString (string source)
- {
- throw new NotImplementedException ();
- }
-
public AdjustmentRule [] GetAdjustmentRules ()
{
if (!supportsDaylightSavingTime)
@@ -656,7 +651,9 @@ namespace System
#elif MONOTOUCH
if (systemTimeZones.Count == 0) {
foreach (string name in GetMonoTouchNames ()) {
- using (Stream stream = GetMonoTouchData (name)) {
+ using (Stream stream = GetMonoTouchData (name, false)) {
+ if (stream == null)
+ continue;
systemTimeZones.Add (BuildFromStream (name, stream));
}
}
@@ -876,11 +873,6 @@ namespace System
}
}
- public string ToSerializedString ()
- {
- throw new NotImplementedException ();
- }
-
public override string ToString ()
{
return DisplayName;
@@ -986,6 +978,8 @@ namespace System
int day = 1 + (transition.Week - 1) * 7 + (transition.DayOfWeek - first) % 7;
if (day > DateTime.DaysInMonth (year, transition.Month))
day -= 7;
+ if (day < 1)
+ day += 7;
return new DateTime (year, transition.Month, day) + transition.TimeOfDay.TimeOfDay;
}
diff --git a/mcs/class/System.Core/Test/System.Collections.Generic/HashSetTest.cs b/mcs/class/System.Core/Test/System.Collections.Generic/HashSetTest.cs
index 24d9c429e7..ebb23a691f 100644
--- a/mcs/class/System.Core/Test/System.Collections.Generic/HashSetTest.cs
+++ b/mcs/class/System.Core/Test/System.Collections.Generic/HashSetTest.cs
@@ -96,7 +96,6 @@ namespace MonoTests.System.Collections.Generic {
}
[Test]
- [Category("TargetJvmNotWorking")]
public void TestCopyTo ()
{
var data = new [] {1, 2, 3, 4, 5};
diff --git a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs
index d524e80f5c..37d7a00082 100644
--- a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs
+++ b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest.cs
@@ -192,7 +192,6 @@ namespace MonoTests.System.Linq.Expressions {
}
[Test]
- [Category("TargetJvmNotSupported")]
public void ExpressionDelegateTarget ()
{
var p = Expression.Parameter (typeof (string), "str");
@@ -220,7 +219,6 @@ namespace MonoTests.System.Linq.Expressions {
#if !NET_4_0
[Test]
- [Category ("TargetJvmNotSupported")]
public void GlobalsInScope ()
{
var foo = new Foo { gazonk = "gazonk" };
diff --git a/mcs/class/System.Core/Test/System/TimeZoneInfo.SerializationTest.cs b/mcs/class/System.Core/Test/System/TimeZoneInfo.SerializationTest.cs
new file mode 100644
index 0000000000..f4d0cfa1e8
--- /dev/null
+++ b/mcs/class/System.Core/Test/System/TimeZoneInfo.SerializationTest.cs
@@ -0,0 +1,97 @@
+using System;
+using System.IO;
+using NUnit.Framework;
+
+namespace MonoTests.System
+{
+ [TestFixture]
+ public class SerializedStringTests
+ {
+ [Test]
+ public void SerializeUtc ()
+ {
+ Assert.AreEqual ("UTC;0;UTC;UTC;UTC;;", TimeZoneInfo.Utc.ToSerializedString ());
+ }
+
+ [Test]
+ public void DeserializeUtc ()
+ {
+ var utc = TimeZoneInfo.FromSerializedString ("UTC;0;UTC;UTC;UTC;;");
+ Assert.AreEqual ("UTC", utc.Id);
+ Assert.AreEqual ("UTC", utc.DisplayName);
+ Assert.AreEqual ("UTC", utc.StandardName);
+ Assert.IsFalse (utc.SupportsDaylightSavingTime);
+ Assert.AreEqual (0, utc.GetAdjustmentRules ().Length);
+ }
+
+ [Test]
+ public void SerializeCustomUtcZoneWithOddNaming ()
+ {
+ var tz1 = TimeZoneInfo.CreateCustomTimeZone (@"My\; Zone, @1!.", TimeSpan.FromMinutes (0), @"My\\; Zone 1 Name", "My; Zone 1 Standard Time");
+ Assert.AreEqual (@"My\\\; Zone, @1!.;0;My\\\\\; Zone 1 Name;My\; Zone 1 Standard Time;My\; Zone 1 Standard Time;;", tz1.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithOddOffset ()
+ {
+ var tz2 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 2", TimeSpan.FromHours (1.25), "My Zone 2 Name", "My Zone 2 Standard Time");
+ Assert.AreEqual ("My Zone 2;75;My Zone 2 Name;My Zone 2 Standard Time;My Zone 2 Standard Time;;", tz2.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithFloatingDaylightTransitions ()
+ {
+ var tz3rules = new TimeZoneInfo.AdjustmentRule[] { TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 58, 0), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday)) };
+ var tz3 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 3", TimeSpan.FromHours (-4), "My Zone 3 Name", "My Zone 3 Standard Time", "My Zone 3 Daylight Time", tz3rules);
+ Assert.AreEqual ("My Zone 3;-240;My Zone 3 Name;My Zone 3 Standard Time;My Zone 3 Daylight Time;[01:01:0001;12:31:9999;23;[0;02:15:58;3;2;2;];[0;02:15:59.999;6;2;2;];];", tz3.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithFixedDaylightTransitions ()
+ {
+ var tz4rules = new TimeZoneInfo.AdjustmentRule[] { TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1, 1, 1, 2, 15, 59, 48), 3, 2), TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2)) };
+ var tz4 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 4", TimeSpan.FromHours (-4), "My Zone 4 Name", "My Zone 4 Standard Time", "My Zone 4 Daylight Time", tz4rules);
+ Assert.AreEqual ("My Zone 4;-240;My Zone 4 Name;My Zone 4 Standard Time;My Zone 4 Daylight Time;[01:01:0001;12:31:9999;23;[1;02:15:59.048;3;2;];[1;02:15:59.999;6;2;];];", tz4.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithMultipleDaylightRules ()
+ {
+ var tz5rules = new TimeZoneInfo.AdjustmentRule[] {
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (2012, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday)),
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (2013, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (48), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday))
+ };
+ var tz5 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 5", TimeSpan.FromHours (-6.75), "My Zone 5 Name", "My Zone 5 Standard Time", "My Zone 5 Daylight Time", tz5rules);
+ Assert.AreEqual ("My Zone 5;-405;My Zone 5 Name;My Zone 5 Standard Time;My Zone 5 Daylight Time;[01:01:0001;12:31:2012;23;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];][01:01:2013;12:31:9999;48;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];];", tz5.ToSerializedString ());
+ }
+
+ [Test]
+ public void DeserializeCustomZoneWithOddNamingAndMultipleDaylightRules ()
+ {
+ var rule1 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (2012, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday));
+ var rule2 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (2013, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (48), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday));
+
+ var tz1 = TimeZoneInfo.FromSerializedString ("My\\; Zone 5;-405;My Zone\\; 5 Name;My Zone 5\\; Standard Time;My Zone 5 Daylight\\; Time;[01:01:0001;12:31:2012;23;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];][01:01:2013;12:31:9999;48;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];];");
+ Assert.AreEqual ("My; Zone 5", tz1.Id);
+ Assert.AreEqual ("My Zone; 5 Name", tz1.DisplayName);
+ Assert.AreEqual ("My Zone 5; Standard Time", tz1.StandardName);
+ Assert.AreEqual ("My Zone 5 Daylight; Time", tz1.DaylightName);
+ Assert.AreEqual (TimeSpan.FromMinutes (-405), tz1.BaseUtcOffset);
+ Assert.IsTrue (tz1.SupportsDaylightSavingTime);
+
+ var deserializedRules = tz1.GetAdjustmentRules ();
+ Assert.AreEqual (2, deserializedRules.Length);
+ Assert.IsFalse (deserializedRules [0].Equals (deserializedRules [1]));
+ Assert.IsTrue (rule1.Equals (deserializedRules [0]));
+ Assert.IsTrue (rule2.Equals (deserializedRules [1]));
+ }
+
+ [Test]
+ public void DeserializeAndUseEasternTimeZone ()
+ {
+ var et = TimeZoneInfo.FromSerializedString (@"Eastern Standard Time;-300;(UTC-05:00) Eastern Time (US & Canada);Eastern Standard Time;Eastern Daylight Time;[01:01:0001;12:31:2006;60;[0;02:00:00;4;1;0;];[0;02:00:00;10;5;0;];][01:01:2007;12:31:9999;60;[0;02:00:00;3;2;0;];[0;02:00:00;11;1;0;];];");
+ var testDate = new DateTime (2014, 8, 1, 6, 0, 0, DateTimeKind.Unspecified);
+ Assert.AreEqual (TimeSpan.FromHours (-4), et.GetUtcOffset (testDate));
+ }
+ }
+}
diff --git a/mcs/class/System.Core/mobile_System.Core.dll.sources b/mcs/class/System.Core/mobile_System.Core.dll.sources
index a63481f69d..dee2534a29 100644
--- a/mcs/class/System.Core/mobile_System.Core.dll.sources
+++ b/mcs/class/System.Core/mobile_System.Core.dll.sources
@@ -4,6 +4,7 @@ System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
diff --git a/mcs/class/System.Core/net_4_0_System.Core.dll.sources b/mcs/class/System.Core/net_4_0_System.Core.dll.sources
index 65bcfd8801..ee0a10c7b1 100644
--- a/mcs/class/System.Core/net_4_0_System.Core.dll.sources
+++ b/mcs/class/System.Core/net_4_0_System.Core.dll.sources
@@ -5,6 +5,7 @@ System/Funcs.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
diff --git a/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs b/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs
index 0f367dd986..2d977b1dce 100644
--- a/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Data.DataSetExtensions/Assembly/AssemblyInfo.cs
@@ -54,12 +54,8 @@ using System.Runtime.InteropServices;
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
-#if TARGET_JVM
-[assembly: AssemblyDelaySign (false)]
-#else
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
index 073eef9f15..d6723da821 100644
--- a/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
+++ b/mcs/class/System.Data.Linq/src/DbLinq/Schema/Dbml/DatabaseSerializer.cs
@@ -2144,7 +2144,6 @@ namespace DbLinq.Schema.Dbml
}
}
- #if !TARGET_JVM
#if !MONO_STRICT
public
#endif
@@ -2218,6 +2217,5 @@ namespace DbLinq.Schema.Dbml
}
}
- #endif
}
diff --git a/mcs/class/System.Data.OracleClient/Assembly/AssemblyInfo.cs b/mcs/class/System.Data.OracleClient/Assembly/AssemblyInfo.cs
index a99d8338b1..ae6d540857 100644
--- a/mcs/class/System.Data.OracleClient/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Data.OracleClient/Assembly/AssemblyInfo.cs
@@ -32,11 +32,9 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
diff --git a/mcs/class/System.Data.OracleClient/Mainsoft.Data.Jdbc.Providers.jvm/OracleProvider.cs b/mcs/class/System.Data.OracleClient/Mainsoft.Data.Jdbc.Providers.jvm/OracleProvider.cs
deleted file mode 100644
index e72ebb7807..0000000000
--- a/mcs/class/System.Data.OracleClient/Mainsoft.Data.Jdbc.Providers.jvm/OracleProvider.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-//
-// Mainsoft.Data.Jdbc.Providers.OracleProvider
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using Mainsoft.Data.Configuration;
-using System.Reflection;
-
-namespace Mainsoft.Data.Jdbc.Providers
-{
- public class OracleProvider : GenericProvider
- {
- #region Consts
-
- private const string Port = "Port";
-
- #endregion //Consts
-
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- public OracleProvider (IDictionary providerInfo) : base (providerInfo)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- public override IConnectionStringDictionary GetConnectionStringBuilder (string connectionString)
- {
- IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder (connectionString);
-
- string port = (string) conectionStringBuilder [Port];
- if (port == null || port.Length == 0) {
- port = (string) ProviderInfo [Port];
- conectionStringBuilder.Add (Port, port);
- }
-
- return conectionStringBuilder;
- }
-
- public override java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder) {
- return new OracleConnection(base.GetConnection (conectionStringBuilder));
- }
-
-
- #endregion //Methods
-
- #region OracleConnection
-
- sealed class OracleConnection : Connection {
-
- public OracleConnection(java.sql.Connection connection)
- : base(connection) {}
-
- public override java.sql.CallableStatement prepareCall(string arg_0) {
- return base.prepareCall (arg_0);
- }
-
- public override java.sql.CallableStatement prepareCall(string arg_0, int arg_1, int arg_2) {
- return new OracleCallableStatement(base.prepareCall (arg_0, arg_1, arg_2));
- }
-
- public override java.sql.CallableStatement prepareCall(string arg_0, int arg_1, int arg_2, int arg_3) {
- return new OracleCallableStatement(base.prepareCall (arg_0, arg_1, arg_2, arg_3));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0, int arg_1) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0, arg_1));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0, int arg_1, int arg_2) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0, arg_1, arg_2));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0, int arg_1, int arg_2, int arg_3) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0, arg_1, arg_2, arg_3));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0, int[] arg_1) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0, arg_1));
- }
-
- public override java.sql.PreparedStatement prepareStatement(string arg_0, string[] arg_1) {
- return new OraclePreparedStatement(base.prepareStatement (arg_0, arg_1));
- }
- }
-
- #endregion
-
- sealed class OraclePreparedStatement : PreparedStatement, IPreparedStatement {
- readonly MethodInfo _info;
-
- public OraclePreparedStatement(java.sql.PreparedStatement statement)
- : base(statement) {
- _info = Wrapped.GetType().GetMethod("setFixedCHAR");
- }
-
- #region IPreparedStatement Members
-
- public void setBit(int parameterIndex, int value) {
- base.setInt(parameterIndex, value);
- }
-
- public void setChar(int parameterIndex, string value) {
- if (_info == null) {
- base.setString(parameterIndex, value);
- return;
- }
-
- _info.Invoke(Wrapped, new object[] {
- new java.lang.Integer(parameterIndex),
- value});
- }
-
- public void setNumeric(int parameterIndex, java.math.BigDecimal value) {
- base.setBigDecimal(parameterIndex, value);
- }
-
- public void setReal(int parameterIndex, double value) {
- base.setDouble(parameterIndex, value);
- }
-
- #endregion
- }
-
- sealed class OracleCallableStatement : CallableStatement, IPreparedStatement {
- readonly MethodInfo _info;
-
- public OracleCallableStatement(java.sql.CallableStatement statement)
- : base(statement) {
- _info = Wrapped.GetType().GetMethod("setFixedCHAR");
- }
-
- #region IPreparedStatement Members
-
- public void setBit(int parameterIndex, int value) {
- base.setInt(parameterIndex, value);
- }
-
- public void setChar(int parameterIndex, string value) {
- if (_info == null) {
- base.setString(parameterIndex, value);
- return;
- }
-
- _info.Invoke(Wrapped, new object[] {
- new java.lang.Integer(parameterIndex),
- value});
- }
-
- public void setNumeric(int parameterIndex, java.math.BigDecimal value) {
- base.setBigDecimal(parameterIndex, value);
- }
-
- public void setReal(int parameterIndex, double value) {
- base.setDouble(parameterIndex, value);
- }
-
- #endregion
-
- }
-
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/Makefile b/mcs/class/System.Data.OracleClient/Makefile
index 14ff32d89e..f2c31271bb 100644
--- a/mcs/class/System.Data.OracleClient/Makefile
+++ b/mcs/class/System.Data.OracleClient/Makefile
@@ -3,23 +3,10 @@ SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Data.OracleClient.dll
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS = \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- /r:System.dll \
- /r:System.Xml.dll /r:../../class/lib/net_1_1_java/System.Data.dll \
- -nowarn:649 -nowarn:169 -nowarn:219 -nowarn:168 -nowarn:1595 \
- -r:$(corlib) \
- -r:System.Xml.dll \
- /r:System.Drawing.dll
-
-else
LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll \
/r:System.Xml.dll /r:System.Data.dll \
/r:System.EnterpriseServices.dll \
/r:System.Drawing.dll
-endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ChangeLog b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ChangeLog
deleted file mode 100644
index f1816c0246..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ChangeLog
+++ /dev/null
@@ -1,20 +0,0 @@
-2006-04-26 Konstantin Triger
-
- * OracleParameter.cs: map NCHAR to VARCHAR type.
-
-2006-03-05 Konstantin Triger
-
- * OracleDataReader.cs, OracleConvert.cs: correct handling of Oracle specific types.
-
-2006-02-26 Konstantin Triger
-
- * OracleDataReader.cs: Added GetOracleXXX stubs.
- * OracleCommand.cs: Added ExecuteOracleXXX stubs.
-
-2006-02-26 Konstantin Triger
-
- * Regex.cs: Added.
-
-2006-02-19 Konstantin Triger
-
- * OracleConnection.cs: follow JDBC provider generic adapter mechanism.
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ExceptionHelper.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ExceptionHelper.cs
deleted file mode 100644
index 42f7586828..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/ExceptionHelper.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// System.Data.Common.ExceptionHelper
-//
-// Author:
-// Boris Kirzner (borisk@mainsoft.com)
-//
-
-using System;
-
-namespace System.Data.OracleClient
-{
- sealed class ExceptionHelper
- {
- internal static ArgumentException InvalidSizeValue (int value)
- {
- string [] args = new string [] {value.ToString ()};
- return new ArgumentException (GetExceptionMessage ("Invalid parameter Size value '{0}'. The value must be greater than or equal to 0.",args));
- }
-
- internal static ArgumentOutOfRangeException InvalidDataRowVersion (DataRowVersion value)
- {
- object [] args = new object [] { "DataRowVersion", value.ToString () } ;
- return new ArgumentOutOfRangeException (GetExceptionMessage ("{0}: Invalid DataRow Version enumeration value: {1}",args));
- }
-
- internal static ArgumentOutOfRangeException InvalidParameterDirection (ParameterDirection value)
- {
- object [] args = new object [] { "ParameterDirection", value.ToString () } ;
- return new ArgumentOutOfRangeException (GetExceptionMessage ("Invalid direction '{0}' for '{1}' parameter.",args));
- }
-
- internal static InvalidOperationException NoStoredProcedureExists (string procedureName) {
- object [] args = new object [1] { procedureName } ;
- return new InvalidOperationException (GetExceptionMessage ("The stored procedure '{0}' doesn't exist.", args));
- }
-
- internal static ArgumentNullException ArgumentNull (string parameter)
- {
- return new ArgumentNullException (parameter);
- }
-
- internal static InvalidOperationException TransactionRequired ()
- {
- return new InvalidOperationException (GetExceptionMessage ("Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized."));
- }
-
- internal static ArgumentOutOfRangeException InvalidOleDbType (int value)
- {
- string [] args = new string [] { value.ToString() };
- return new ArgumentOutOfRangeException (GetExceptionMessage ("Invalid OleDbType enumeration value: {0}",args));
- }
-
- internal static ArgumentException InvalidDbType(int value)
- {
- string [] args = new string [] { value.ToString () };
- return new ArgumentException (GetExceptionMessage ("No mapping exists from DbType {0} to a known {1}.",args));
- }
-
- internal static InvalidOperationException DeriveParametersNotSupported(Type type,CommandType commandType)
- {
- string [] args = new string [] { type.ToString(),commandType.ToString() };
- return new InvalidOperationException (GetExceptionMessage ("{0} DeriveParameters only supports CommandType.StoredProcedure, not CommandType.{1}.",args));
- }
-
- internal static InvalidOperationException ReaderClosed (string mehodName)
- {
- string [] args = new string [] { mehodName };
- return new InvalidOperationException (GetExceptionMessage ("Invalid attempt to {0} when reader is closed.",args));
- }
-
- internal static ArgumentOutOfRangeException InvalidSqlDbType (int value)
- {
- string [] args = new string [] { value.ToString () };
- return new ArgumentOutOfRangeException (GetExceptionMessage ("{0}: Invalid SqlDbType enumeration value: {1}.",args));
- }
-
- internal static ArgumentException UnknownDataType (string type1, string type2)
- {
- string [] args = new string [] { type1, type2 };
- return new ArgumentException (GetExceptionMessage ("No mapping exists from DbType {0} to a known {1}.",args));
- }
-
- internal static InvalidOperationException TransactionNotInitialized ()
- {
- return new InvalidOperationException (GetExceptionMessage ("Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized."));
- }
-
- internal static InvalidOperationException ParametersNotInitialized (int parameterPosition,string parameterName,string parameterType)
- {
- object [] args = new object [] { parameterPosition, parameterName, parameterType };
- return new InvalidOperationException (GetExceptionMessage ("Parameter {0}: '{1}', the property DbType is uninitialized: OleDbType.{2}.",args));
- }
-
- internal static InvalidOperationException WrongParameterSize(string provider)
- {
- string [] args = new string [] { provider };
- return new InvalidOperationException (GetExceptionMessage ("{0}.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.",args));
- }
-
- internal static InvalidOperationException ConnectionNotOpened (string operationName, string connectionState)
- {
- object [] args = new object [] { operationName, connectionState };
- return new InvalidOperationException (GetExceptionMessage ("{0} requires an open and available Connection. The connection's current state is {1}.",args));
- }
-
- internal static InvalidOperationException ConnectionNotInitialized (string methodName)
- {
- object [] args = new object [] { methodName };
- return new InvalidOperationException (GetExceptionMessage ("{0}: Connection property has not been initialized.",args));
- }
-
- internal static InvalidOperationException OpenConnectionRequired (string methodName, object connectionState)
- {
- object [] args = new object [] { methodName, connectionState };
- return new InvalidOperationException (GetExceptionMessage ("{0} requires an open and available Connection. The connection's current state is {1}.",args));
- }
-
- internal static InvalidOperationException OpenedReaderExists ()
- {
- return new InvalidOperationException (GetExceptionMessage ("There is already an open DataReader associated with this Connection which must be closed first."));
- }
-
- internal static InvalidOperationException ConnectionAlreadyOpen (object connectionState)
- {
- object [] args = new object [] { connectionState };
- return new InvalidOperationException (GetExceptionMessage ("The connection is already Open (state={0}).",args));
- }
-
- internal static InvalidOperationException ConnectionStringNotInitialized ()
- {
- return new InvalidOperationException (GetExceptionMessage ("The ConnectionString property has not been initialized."));
- }
-
- internal static InvalidOperationException ConnectionIsBusy (object commandType,object connectionState)
- {
- object [] args = new object [] { commandType.ToString (), connectionState.ToString () };
- return new InvalidOperationException (GetExceptionMessage ("The {0} is currently busy {1}.",args));
- }
-
- internal static InvalidOperationException NotAllowedWhileConnectionOpen (string propertyName, object connectionState)
- {
- object [] args = new object [] { propertyName, connectionState };
- return new InvalidOperationException (GetExceptionMessage ("Not allowed to change the '{0}' property while the connection (state={1}).",args));
- }
-
- internal static ArgumentException OleDbNoProviderSpecified ()
- {
- return new ArgumentException (GetExceptionMessage ("An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'."));
- }
-
- internal static ArgumentException InvalidValueForKey (string key)
- {
- string [] args = new string [] { key };
- return new ArgumentException (String.Format ("Invalid value for key {0}",args));
- }
-
- internal static InvalidOperationException ParameterSizeNotInitialized( int parameterIndex, string parameterName,string parameterType,int parameterSize)
- {
- object [] args = new object [] { parameterIndex.ToString (), parameterName, parameterType, parameterSize.ToString () };
- return new InvalidOperationException (GetExceptionMessage ("Parameter {0}: '{1}' of type: {2}, the property Size has an invalid size: {3}",args));
- }
-
- internal static ArgumentException InvalidUpdateStatus (UpdateStatus status)
- {
- object [] args = new object [] { status };
- return new ArgumentException (GetExceptionMessage ("Invalid UpdateStatus: {0}",args));
- }
-
- internal static InvalidOperationException UpdateRequiresCommand (string command)
- {
- object [] args = new object [] { command };
- return new InvalidOperationException (GetExceptionMessage ("Auto SQL generation during {0} requires a valid SelectCommand.",args));
- }
-
- internal static DataException RowUpdatedError ()
- {
- return new DataException (GetExceptionMessage ("RowUpdatedEvent: Errors occurred; no additional is information available."));
- }
-
- internal static ArgumentNullException CollectionNoNullsAllowed (object collection, object objectsType)
- {
- object [] args = new object [] {collection.GetType ().ToString (), objectsType.ToString ()};
- return new ArgumentNullException (GetExceptionMessage ("The {0} only accepts non-null {1} type objects."));
- }
-
- internal static ArgumentException CollectionAlreadyContains(object objectType,string propertyName, object propertyValue, object collection)
- {
- object [] args = new object [] {objectType.ToString (), propertyName, propertyValue, collection.GetType ().ToString ()};
- return new ArgumentException (GetExceptionMessage ("The {0} with {1} '{2}' is already contained by this {3}.",args));
- }
-
- internal static string GetExceptionMessage (string exceptionMessage,object [] args)
- {
- if ((args == null) || (args.Length == 0)) {
- return exceptionMessage;
- }
- else {
- return String.Format (exceptionMessage,args);
- }
- }
-
- internal static string GetExceptionMessage (string exceptionMessage)
- {
- return GetExceptionMessage (exceptionMessage,null);
- }
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBFile.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBFile.cs
deleted file mode 100644
index 3c0cbcf51a..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBFile.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// OracleBFile.cs
-//
-// Part of the Mono class libraries at
-// mcs/class/System.Data.OracleClient/System.Data.OracleClient
-//
-// Assembly: System.Data.OracleClient.dll
-// Namespace: System.Data.OracleClient
-//
-// Author: Tim Coleman
-//
-// Copyright (C) Tim Coleman, 2003
-//
-// Licensed under the MIT/X11 License.
-//
-
-using System;
-using System.IO;
-using System.Data.SqlTypes;
-
-namespace System.Data.OracleClient {
- public sealed class OracleBFile : Stream, ICloneable, INullable {
- #region Fields
-
- public static readonly new OracleBFile Null = new OracleBFile ();
-
- OracleConnection connection;
- bool isOpen = true;
- bool notNull = false;
-
- #endregion // Fields
-
- #region Constructors
-
- internal OracleBFile () {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override bool CanRead {
- get { return (IsNull || isOpen); }
- }
-
- public override bool CanSeek {
- get { return (IsNull || isOpen); }
- }
-
- public override bool CanWrite {
- get { return false; }
- }
-
- public OracleConnection Connection {
- get { return connection; }
- }
-
- public string DirectoryName {
- [MonoTODO]
- get {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- throw new NotImplementedException ();
- }
- }
-
- public bool FileExists {
- [MonoTODO]
- get {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- if (Connection.State == ConnectionState.Closed)
- throw new InvalidOperationException ();
- throw new NotImplementedException ();
- }
- }
-
- public string FileName {
- [MonoTODO]
- get {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- if (IsNull)
- return String.Empty;
- throw new NotImplementedException ();
- }
- }
-
- public bool IsNull {
- get { return !notNull; }
- }
-
- public override long Length {
- [MonoTODO]
- get {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- throw new NotImplementedException ();
- }
- }
-
- public override long Position {
- [MonoTODO]
- get {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleBFile");
- if (value > Length)
- throw new ArgumentOutOfRangeException ();
- throw new NotImplementedException ();
- }
- }
-
- public object Value {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public object Clone () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long CopyTo (OracleLob destination) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long CopyTo (OracleLob destination, long destinationOffset) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long CopyTo (long sourceOffset, OracleLob destination, long destinationOffset, long amount) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Dispose () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void Flush () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int Read (byte[] buffer, int offset, int count) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override long Seek (long offset, SeekOrigin origin) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetFileName (string directory, string file) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void SetLength (long value) {
- throw new InvalidOperationException ();
- }
-
- [MonoTODO]
- public override void Write (byte[] buffer, int offset, int count) {
- throw new NotSupportedException ();
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBinary.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBinary.cs
deleted file mode 100644
index 21b34d4239..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleBinary.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// OracleBinary.cs
-//
-// Part of the Mono class libraries at
-// mcs/class/System.Data.OracleClient/System.Data.OracleClient
-//
-// Assembly: System.Data.OracleClient.dll
-// Namespace: System.Data.OracleClient
-//
-// Author: Tim Coleman
-//
-// Copyright (C) Tim Coleman, 2003
-//
-// Licensed under the MIT/X11 License.
-//
-
-using System;
-using System.IO;
-using System.Data.SqlTypes;
-
-namespace System.Data.OracleClient {
- public struct OracleBinary : IComparable, INullable {
- #region Fields
-
- public static readonly OracleBinary Null = new OracleBinary ();
-
- bool notNull;
- byte[] value;
-
- #endregion // Fields
-
- #region Constructors
-
- public OracleBinary (byte[] b) {
- value = b;
- notNull = true;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public bool IsNull {
- get { return !notNull; }
- }
-
- public byte this [int index] {
- get {
- if (IsNull)
- throw new Exception ("Data is null.");
- return value [index];
- }
- }
-
- public int Length {
- get {
- if (IsNull)
- throw new Exception ("Data is null.");
- return value.Length;
- }
- }
-
- public byte[] Value {
- get {
- if (IsNull)
- throw new Exception ("Data is null.");
- return value;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public int CompareTo (object obj) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBinary Concat (OracleBinary x, OracleBinary y) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool Equals (object value) {
- throw new NotImplementedException ();
- }
-
- public static OracleBoolean Equals (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- return new OracleBoolean (x.Value == y.Value);
- }
-
- [MonoTODO]
- public override int GetHashCode () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBoolean GreaterThan (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- //return (x.Value > y.Value);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBoolean GreaterThanOrEqual (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- //return (x.Value >= y.Value);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBoolean LessThan (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- //return (x.Value < y.Value);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBoolean LessThanOrEqual (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- //return (x.Value <= y.Value);
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static OracleBoolean NotEquals (OracleBinary x, OracleBinary y) {
- if (x.IsNull || y.IsNull)
- return OracleBoolean.Null;
- //return (x.Value != y.Value);
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Operators and Type Conversions
-
- public static OracleBinary operator + (OracleBinary x, OracleBinary y) {
- return Concat (x, y);
- }
-
- public static OracleBoolean operator == (OracleBinary x, OracleBinary y) {
- return Equals (x, y);
- }
-
- public static OracleBoolean operator > (OracleBinary x, OracleBinary y) {
- return GreaterThan (x, y);
- }
-
- public static OracleBoolean operator >= (OracleBinary x, OracleBinary y) {
- return GreaterThanOrEqual (x, y);
- }
-
- public static OracleBoolean operator != (OracleBinary x, OracleBinary y) {
- return NotEquals (x, y);
- }
-
- public static OracleBoolean operator < (OracleBinary x, OracleBinary y) {
- return LessThan (x, y);
- }
-
- public static OracleBoolean operator <= (OracleBinary x, OracleBinary y) {
- return LessThan (x, y);
- }
-
- public static explicit operator byte[] (OracleBinary x) {
- return x.Value;
- }
-
- public static implicit operator OracleBinary (byte[] b) {
- return new OracleBinary (b);
- }
-
- #endregion // Operators and Type Conversions
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs
deleted file mode 100644
index 1e59ffcf3a..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommand.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// System.Data.OracleClient.OracleCommand
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Globalization;
-
-using java.sql;
-// Cannot use this because it makes ArrayList ambiguous reference
-//using java.util;
-#if !USE_DOTNET_REGEXP
-using java.util.regex;
-#endif
-
-namespace System.Data.OracleClient {
- public sealed class OracleCommand : AbstractDbCommand {
-
- #region Fields
-#if USE_DOTNET_REGEXP
- internal static readonly Regex NamedParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?\:\w+)\s*=\s*)?call\s+(?(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
-#else
- internal static readonly Pattern NamedParameterStoredProcedureRegExp = Pattern.compile(@"^\s*\{?\s*(?:(\:\w+)\s*=\s*)?call\s+((?:(?:(?:\[[^\]]*\])|(?:[^\.\(\)\{\}\[\]])*)\s*\.\s*){0,2}(?:\[[^\]]*\]|(?:(?:\s*[^\.\(\)\{\}\[\]])+)))\s*(?:\((.*)\))?\s*\}?\s*$", Pattern.CASE_INSENSITIVE);
-#endif
- internal static readonly SimpleRegex NamedParameterRegExp = new OracleParamsRegex();
-
-// internal static readonly int oracleTypeRefCursor = java.sql.Types.OTHER;
-
- private int _currentParameterIndex = 0;
- private ResultSet _currentRefCursor;
-
- #endregion // Fields
-
- #region Constructors
-
- /**
- * Initializes a new instance of the OracleCommand class.
- * The base constructor initializes all fields to their default values.
- * The following table shows initial property values for an instance of SqlCommand.
- */
- public OracleCommand() : this(null, null, null) {
- }
-
- public OracleCommand(OracleConnection connection) : this(null, connection, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query.
- * @param cmdText The text of the query.
- */
- public OracleCommand(String cmdText) : this(cmdText, null, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query and a SqlConnection.
- * @param cmdText The text of the query.
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.
- */
- public OracleCommand(String cmdText, OracleConnection connection) : this(cmdText, connection, null) {
- }
-
- /**
- * Initializes a new instance of the OracleCommand class with the text of the query, a SqlConnection, and the Transaction.
- * @param cmdText The text of the query.
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.
- * @param transaction The SqlTransaction in which the OracleCommand executes.
- */
- public OracleCommand(
- String cmdText,
- OracleConnection connection,
- OracleTransaction transaction)
- : base(cmdText, connection, transaction) {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public new OracleConnection Connection {
- get { return (OracleConnection)base.Connection; }
- set { base.Connection = (AbstractDBConnection)value; }
- }
-
- public new OracleParameterCollection Parameters {
- get {
- return (OracleParameterCollection)base.Parameters;
- }
- }
-
- public new OracleTransaction Transaction {
- get { return (OracleTransaction)base.Transaction; }
- set { base.Transaction = (DbTransaction)value; }
- }
-
- protected override bool SkipParameter(DbParameter parameter) {
- return ((OracleParameter)parameter).OracleType == OracleType.Cursor;
- }
-
- protected sealed override ResultSet CurrentResultSet {
- get {
- try {
- ResultSet resultSet = base.CurrentResultSet;
-
- if (resultSet != null) {
- return resultSet;
- }
- return CurrentRefCursor;
- }
- catch(SQLException e) {
- throw CreateException(e);
- }
- }
- }
-
- private ResultSet CurrentRefCursor {
- get {
- if (_currentParameterIndex < 0) {
- NextRefCursor();
- }
- if (_currentRefCursor == null && _currentParameterIndex < InternalParameters.Count) {
- _currentRefCursor = (ResultSet)((CallableStatement)Statement).getObject(_currentParameterIndex + 1);
- }
- return _currentRefCursor;
- }
- }
-
-#if USE_DOTNET_REGEX
- protected override Regex StoredProcedureRegExp
-#else
- protected override java.util.regex.Pattern StoredProcedureRegExp {
-#endif
- get { return NamedParameterStoredProcedureRegExp; }
- }
-
- protected override SimpleRegex ParameterRegExp {
- get { return NamedParameterRegExp; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override bool NextResultSet() {
- try {
- bool hasMoreResults = base.NextResultSet();
-
- if (hasMoreResults) {
- return true;
- }
- else {
- return NextRefCursor();
- }
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- private bool NextRefCursor() {
- _currentRefCursor = null;
- for (_currentParameterIndex++;InternalParameters.Count > _currentParameterIndex;_currentParameterIndex++) {
- OracleParameter param = (OracleParameter)InternalParameters[_currentParameterIndex];
- if (param.OracleType == OracleType.Cursor && ((param.Direction & ParameterDirection.Output) == ParameterDirection.Output))
- return true;
- }
- return false;
- }
-
- public new OracleDataReader ExecuteReader() {
- return (OracleDataReader)ExecuteReader(CommandBehavior.Default);
- }
-
- public new OracleDataReader ExecuteReader(CommandBehavior behavior) {
- return (OracleDataReader)base.ExecuteReader(behavior);
- }
-
- public new OracleParameter CreateParameter() {
- return (OracleParameter)CreateParameterInternal();
- }
-
- protected sealed override void CheckParameters() {
- //TBD
- }
-
- protected override AbstractDbParameter GetUserParameter(string parameterName, IList userParametersList, int userParametersListPosition) {
- for(int i=0; i < userParametersList.Count; i++) {
- OracleParameter userParameter = (OracleParameter)userParametersList[i];
- if (String.Compare(parameterName, userParameter.InternalPlaceholder.Trim(), true, CultureInfo.InvariantCulture) == 0) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected override AbstractDbParameter GetReturnParameter (IList userParametersList) {
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter = (AbstractDbParameter)userParametersList[i];
- if (userParameter.Direction == ParameterDirection.ReturnValue) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected sealed override DbParameter CreateParameterInternal() {
- return new OracleParameter();
- }
-
- protected sealed override DbParameterCollection CreateParameterCollection(AbstractDbCommand parent) {
- return new OracleParameterCollection((OracleCommand)parent);
- }
-
- public override object Clone() {
- OracleCommand clone = (OracleCommand)base.Clone();
- clone._currentParameterIndex = 0;
- clone._currentRefCursor = null;
- return clone;
- }
-
- protected override void PrepareInternalParameters() {
- InternalParameters.Clear();
- _currentParameterIndex = -1;
- }
-
-
- protected sealed override DbDataReader CreateReader() {
- return new OracleDataReader(this);
- }
-
- protected sealed override SystemException CreateException(SQLException e) {
- return new OracleException(e,Connection);
- }
-
- public object ExecuteOracleScalar() {
- throw new NotImplementedException();
- }
-
-#if SUPPORT_ORACLE_TYPES
- public int ExecuteOracleNonQuery(
- out OracleString rowid
- ) {
- throw new NotImplementedException();
- }
-#endif
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommandBuilder.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommandBuilder.cs
deleted file mode 100644
index 31e75fc399..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleCommandBuilder.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// System.Data.OracleClient.OracleCommandBuilder
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Tim Coleman (tim@timcoleman.com)
-// Konstantin Triger
-// Boris Kirzner
-//
-// Copyright (C) Rodrigo Moya, 2002
-// Copyright (C) Tim Coleman, 2002
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-namespace System.Data.OracleClient {
- ///
- /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
- ///
- public sealed class OracleCommandBuilder : AbstractDbCommandBuilder {
- #region Fields
-
- OracleDataAdapter adapter;
- string quotePrefix;
- string quoteSuffix;
-
- #endregion // Fields
-
- #region Constructors
-
- public OracleCommandBuilder () {
- adapter = null;
- quotePrefix = String.Empty;
- quoteSuffix = String.Empty;
- }
-
- public OracleCommandBuilder (OracleDataAdapter adapter)
- : this () {
- this.adapter = adapter;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public new OracleDataAdapter DataAdapter {
- get {
- return adapter;
- }
- set {
- adapter = value;
- }
- }
-
- public override string QuotePrefix {
- get {
- return quotePrefix;
- }
- set {
- quotePrefix = value;
- }
- }
-
- public override string QuoteSuffix {
- get {
- return quoteSuffix;
- }
- set {
- quoteSuffix = value;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public static void DeriveParameters (OracleCommand command) {
- DeriveParameters((AbstractDbCommand)command);
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new OracleCommand GetDeleteCommand () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new OracleCommand GetInsertCommand () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public OracleCommand GetUpdateCommand () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs
deleted file mode 100644
index 6268f7e757..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConnection.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// System.Data.OracleClient.OracleConnection
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Collections;
-
-using java.sql;
-
-using System.Configuration;
-using Mainsoft.Data.Configuration;
-using Mainsoft.Data.Jdbc.Providers;
-
-namespace System.Data.OracleClient {
- public sealed class OracleConnection : AbstractDBConnection, System.ICloneable {
- #region Events
-
- public event OracleInfoMessageEventHandler InfoMessage;
-
- #endregion // Events
-
- #region Constructors
-
- public OracleConnection() : this(null) {
- }
-
- public OracleConnection(String connectionString) : base(connectionString) {
- }
-
- #endregion // Constructors
-
- #region Methods
-
- protected override IConnectionProvider GetConnectionProvider() {
- IDictionary conProviderDict = ConnectionStringDictionary.Parse(ConnectionString);
- string provider = (string)conProviderDict["Provider"];
- if (provider == null)
- provider = "ORACLECLIENT";
-
- return GetConnectionProvider("Mainsoft.Data.Configuration/OracleClientProviders", provider);
- }
-
- public new OracleTransaction BeginTransaction(IsolationLevel level) {
- return new OracleTransaction(level, this);
- }
-
- public new OracleTransaction BeginTransaction() {
- return BeginTransaction(IsolationLevel.ReadCommitted);
- }
-
- public new OracleCommand CreateCommand() {
- return new OracleCommand(this);
- }
-
- protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) {
- return BeginTransaction();
- }
-
- protected override DbCommand CreateDbCommand() {
- return CreateCommand();
- }
-
- protected sealed override SystemException CreateException(SQLException e) {
- return new OracleException(e,this);
- }
-
- protected sealed override SystemException CreateException(string message) {
- return new OracleException(message, null, this);
- }
-
- protected sealed override void OnSqlWarning(SQLWarning warning) {
- OracleErrorCollection col = new OracleErrorCollection(warning, this);
- OnOracleInfoMessage(new OracleInfoMessageEventArgs(col));
- }
-
- private void OnOracleInfoMessage (OracleInfoMessageEventArgs value) {
- if (InfoMessage != null) {
- InfoMessage (this, value);
- }
- }
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs
deleted file mode 100644
index e21da07a0f..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleConvert.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-//
-// System.Data.Oracle.OracleConvert
-//
-// Authors:
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.OracleClient {
- #region oracle.sql.Types constants
-
- internal enum JavaSqlTypes {
- ARRAY = 2003 ,
- BIGINT = -5,
- BINARY = -2 ,
- BIT = -7 ,
- BLOB = 2004,
- BOOLEAN = 16,
- CHAR = 1,
- CLOB = 2005,
- DATALINK = 70,
- DATE = 91,
- DECIMAL = 3,
- DISTINCT = 2001,
- DOUBLE = 8,
- FLOAT = 6,
- INTEGER = 4,
- JAVA_OBJECT = 2000,
- LONGVARBINARY = -4,
- LONGVARCHAR = -1,
- NULL = 0,
- NUMERIC = 2 ,
- OTHER = 1111 ,
- REAL = 7 ,
- REF = 2006 ,
- SMALLINT = 5,
- STRUCT = 2002,
- TIME = 92,
- TIMESTAMP = 93,
- TINYINT = -6,
- VARBINARY = -3,
- VARCHAR = 12,
-
- //ORACLE types, see oracle.jdbc.OracleTypes
- BINARY_FLOAT = 100,
- BINARY_DOUBLE = 101,
- ROWID = -8,
- CURSOR = -10,
- TIMESTAMPNS = -100,
- TIMESTAMPTZ = -101,
- TIMESTAMPLTZ = -102,
- INTERVALYM = -103,
- INTERVALDS = -104,
- }
-
- #endregion
- sealed class OracleConvert : DbConvert {
-
- #region .Net types constants
-
- internal static readonly Type TypeOfBoolean = typeof(Boolean);
- internal static readonly Type TypeOfSByte = typeof(SByte);
- internal static readonly Type TypeOfChar = typeof(Char);
- internal static readonly Type TypeOfInt16 = typeof(Int16);
- internal static readonly Type TypeOfInt32 = typeof(Int32);
- internal static readonly Type TypeOfInt64 = typeof(Int64);
- internal static readonly Type TypeOfByte = typeof(Byte);
- internal static readonly Type TypeOfUInt16 = typeof(UInt16);
- internal static readonly Type TypeOfUInt32 = typeof(UInt32);
- internal static readonly Type TypeOfUInt64 = typeof(UInt64);
- internal static readonly Type TypeOfDouble = typeof(Double);
- internal static readonly Type TypeOfSingle = typeof(Single);
- internal static readonly Type TypeOfDecimal = typeof(Decimal);
- internal static readonly Type TypeOfString = typeof(String);
- internal static readonly Type TypeOfDateTime = typeof(DateTime);
- internal static readonly Type TypeOfObject = typeof(object);
- internal static readonly Type TypeOfGuid = typeof(Guid);
- internal static readonly Type TypeOfType = typeof(Type);
-
- // additional types
- internal static readonly Type TypeOfByteArray = typeof(Byte[]);
- internal static readonly Type TypeOfCharArray = typeof(Char[]);
- internal static readonly Type TypeOfFloat = typeof (float);
- internal static readonly Type TypeOfTimespan = typeof (TimeSpan);
- static readonly Type TypeOfIDataReader = typeof(IDataReader);
-
- #endregion
-
- #region Methods
-
- internal static String JdbcTypeNameToDbTypeName(string jdbcTypeName) {
- return jdbcTypeName.Trim();;
- }
-
- internal static OracleType JdbcTypeToOracleType(int jdbcType) {
- switch ((JavaSqlTypes)jdbcType) {
- case JavaSqlTypes.ARRAY: return OracleType.Blob;
- case JavaSqlTypes.BIGINT: return OracleType.Number;
- case JavaSqlTypes.BINARY: return OracleType.Blob;
- case JavaSqlTypes.BIT: return OracleType.Byte;
- case JavaSqlTypes.BLOB: return OracleType.Blob;
- case JavaSqlTypes.BOOLEAN: return OracleType.Byte;
- case JavaSqlTypes.CHAR: return OracleType.Char;
- case JavaSqlTypes.CLOB: return OracleType.Clob;
-// case JavaSqlTypes.DATALINK: return OracleType.IUnknown;
- case JavaSqlTypes.DATE: return OracleType.DateTime;
- case JavaSqlTypes.DECIMAL: return OracleType.Number;
-// case JavaSqlTypes.DISTINCT: return OracleType.IUnknown;
- case JavaSqlTypes.DOUBLE: return OracleType.Double;
- case JavaSqlTypes.FLOAT: return OracleType.Float;
- case JavaSqlTypes.INTEGER: return OracleType.Int32;
-// case JavaSqlTypes.JAVA_OBJECT: return OracleType.IUnknown;
- case JavaSqlTypes.LONGVARBINARY: return OracleType.LongRaw;
- case JavaSqlTypes.LONGVARCHAR: return OracleType.LongVarChar;
-// case JavaSqlTypes.NULL: return OracleType.Empty;
- case JavaSqlTypes.NUMERIC: return OracleType.Number;
-// case JavaSqlTypes.OTHER: return OracleType.IUnknown;
-// case JavaSqlTypes.REAL: return OracleType.Single;
-// case JavaSqlTypes.REF: return OracleType.IUnknown;
- case JavaSqlTypes.SMALLINT: return OracleType.Int16;
-// case JavaSqlTypes.STRUCT: return OracleType.IUnknown;
- case JavaSqlTypes.TIME: return OracleType.TimestampLocal;
- case JavaSqlTypes.TIMESTAMP: return OracleType.Timestamp;
- case JavaSqlTypes.TINYINT: return OracleType.Byte;
- case JavaSqlTypes.VARBINARY: return OracleType.LongVarChar;
- default:
- case JavaSqlTypes.VARCHAR: return OracleType.VarChar;
-
- case JavaSqlTypes.BINARY_FLOAT: return OracleType.Float;
- case JavaSqlTypes.BINARY_DOUBLE: return OracleType.Double;
- case JavaSqlTypes.ROWID: return OracleType.RowId;
- case JavaSqlTypes.CURSOR: return OracleType.Cursor;
- case JavaSqlTypes.TIMESTAMPNS: return OracleType.Timestamp;
- case JavaSqlTypes.TIMESTAMPTZ: return OracleType.TimestampWithTZ;
- case JavaSqlTypes.TIMESTAMPLTZ: return OracleType.TimestampLocal;
- case JavaSqlTypes.INTERVALYM: return OracleType.IntervalYearToMonth;
- case JavaSqlTypes.INTERVALDS: return OracleType.IntervalDayToSecond;
- }
- }
-
- internal static OracleType ValueTypeToOracleType(Type type) {
- switch (Type.GetTypeCode(type)) {
- case TypeCode.Boolean: return OracleType.Byte;
- case TypeCode.Byte: return OracleType.Byte;
- case TypeCode.Char: return OracleType.Char;
- case TypeCode.DateTime: return OracleType.DateTime;
-// case TypeCode.DBNull: return OracleType.Empty;
- case TypeCode.Decimal: return OracleType.Number;
- case TypeCode.Double: return OracleType.Double;
-// case TypeCode.Empty: return OracleType.Empty;
- case TypeCode.Int16: return OracleType.Int16;
- case TypeCode.Int32: return OracleType.Int32;
- case TypeCode.Int64: return OracleType.Number;
- default:
- case TypeCode.Object: {
- if (type.Equals(TypeOfByteArray)) return OracleType.Blob;
- if (type.Equals(TypeOfTimespan)) return OracleType.Timestamp;
- if (type.IsSubclassOf(TypeOfIDataReader)) return OracleType.Cursor;
-// if (type.Equals(DbTypes.TypeOfGuid)) return OracleType.Guid;
-//
- if (type.IsEnum)
- return ValueTypeToOracleType (Enum.GetUnderlyingType (type));
-//
- return OracleType.VarChar;
- }
- case TypeCode.SByte: return OracleType.SByte;
- case TypeCode.Single: return OracleType.Float;
- case TypeCode.String: return OracleType.VarChar;
- case TypeCode.UInt16: return OracleType.UInt16;
- case TypeCode.UInt32: return OracleType.UInt32;
- case TypeCode.UInt64: return OracleType.Number;
- }
- }
-
- internal static Type OracleTypeToValueType(OracleType oleDbType) {
- switch (oleDbType) {
-// case OracleType.BigInt : return DbTypes.TypeOfInt64;// typeof(long);
-// case OracleType.Binary : return DbTypes.TypeOfByteArray;
-// case OracleType.Boolean : return DbTypes.TypeOfBoolean;
-// case OracleType.BSTR : return DbTypes.TypeOfString;
- case OracleType.BFile : return TypeOfByteArray;
- case OracleType.Blob : return TypeOfByteArray;
- case OracleType.Byte : return TypeOfByte;
- case OracleType.Char : return TypeOfString;
- case OracleType.Clob : return TypeOfCharArray;
- case OracleType.Cursor : return TypeOfIDataReader;
- case OracleType.DateTime : return TypeOfDateTime;
-// case OracleType.Currency : return TypeOfDecimal;
-// case OracleType.Date : return TypeOfDateTime;
-// case OracleType.DBDate : return TypeOfDateTime;
-// case OracleType.DBTime : return TypeOfTimespan;
-// case OracleType.DBTimeStamp : return TypeOfDateTime;
-// case OracleType.Decimal : return TypeOfDecimal;
- case OracleType.Double : return TypeOfDouble;
- case OracleType.Float : return TypeOfFloat;
- case OracleType.Int16 : return TypeOfInt16;
- case OracleType.Int32 : return TypeOfInt32;
- case OracleType.IntervalDayToSecond : return TypeOfTimespan;
- case OracleType.IntervalYearToMonth : return TypeOfInt32;
- case OracleType.LongRaw : return TypeOfByteArray;
-// case OracleType.Empty : return null; //typeof(DBNull);
-// case OracleType.Error : return typeof(Exception);
-// case OracleType.Filetime : return TypeOfDateTime;
-// case OracleType.Guid : return TypeOfGuid;
-// case OracleType.IDispatch : return TypeOfObject;
-// case OracleType.Integer : return TypeOfInt32;
-// case OracleType.IUnknown : return TypeOfObject;
-// case OracleType.LongVarBinary : return TypeOfByteArray;
- case OracleType.LongVarChar : return TypeOfString;
- case OracleType.NChar : return TypeOfString;
- case OracleType.NClob : return TypeOfString;
- case OracleType.Number : return TypeOfDecimal;
- case OracleType.NVarChar : return TypeOfString;
- case OracleType.Raw : return TypeOfByteArray;
-
- case OracleType.RowId : return TypeOfString;
- case OracleType.SByte : return TypeOfSByte;
- case OracleType.Timestamp : return TypeOfTimespan;
- case OracleType.TimestampLocal : return TypeOfTimespan;
- case OracleType.TimestampWithTZ : return TypeOfTimespan;
- case OracleType.UInt16 : return TypeOfUInt16;
-
- case OracleType.UInt32 : return TypeOfUInt32;
- case OracleType.VarChar : return TypeOfString;
-// case OracleType.LongVarWChar : return TypeOfString;
-// case OracleType.Numeric : return TypeOfDecimal;
-// case OracleType.PropVariant : return TypeOfObject;
-// case OracleType.Single : return TypeOfFloat;
-// case OracleType.SmallInt : return TypeOfInt16;
-// case OracleType.TinyInt : return TypeOfSByte;
-// case OracleType.UnsignedBigInt : return TypeOfUInt64;
-// case OracleType.UnsignedInt : return TypeOfUInt32;
-// case OracleType.UnsignedSmallInt : return TypeOfUInt16;
-// case OracleType.UnsignedTinyInt : return TypeOfByte;
-// case OracleType.VarBinary : return TypeOfByteArray;
-// case OracleType.VarChar : return TypeOfString;
-// case OracleType.Variant : return TypeOfObject;
-// case OracleType.VarNumeric : return TypeOfDecimal;
-// case OracleType.VarWChar : return TypeOfString;
-// case OracleType.WChar : return TypeOfString;
- default : return TypeOfObject;
- }
- }
-
- internal static OracleType DbTypeToOracleType(DbType dbType) {
- switch (dbType) {
- case DbType.AnsiString : return OracleType.VarChar;
- case DbType.Binary : return OracleType.Blob;
- case DbType.Byte : return OracleType.Byte;
- case DbType.Boolean : return OracleType.Byte;
- case DbType.Currency : return OracleType.Number;
- case DbType.Date : return OracleType.DateTime;
- case DbType.DateTime : return OracleType.DateTime;
- case DbType.Decimal : return OracleType.Number;
- case DbType.Double : return OracleType.Double;
- case DbType.Guid : return OracleType.Char;
- case DbType.Int16 : return OracleType.Int16;
- case DbType.Int32 : return OracleType.Int32;
- case DbType.Int64 : return OracleType.Number;
- case DbType.Object : return OracleType.Cursor;
- case DbType.SByte : return OracleType.SByte;
- case DbType.Single : return OracleType.Float;
- case DbType.String : return OracleType.VarChar;
- case DbType.Time : return OracleType.Timestamp;
- case DbType.UInt16 : return OracleType.UInt16;
- case DbType.UInt32 : return OracleType.UInt32;
- case DbType.UInt64 : return OracleType.Number;
- case DbType.VarNumeric : return OracleType.Number;
- case DbType.AnsiStringFixedLength : return OracleType.NChar;
- case DbType.StringFixedLength : return OracleType.Char;
- default : throw ExceptionHelper.InvalidDbType((int)dbType);
- }
- }
-
- internal static DbType OracleTypeToDbType(OracleType oleDbType) {
- switch (oleDbType) {
- case OracleType.BFile : return DbType.Binary;
- case OracleType.Blob : return DbType.Binary;
- case OracleType.Byte : return DbType.Byte;
- case OracleType.Char : return DbType.StringFixedLength;
- case OracleType.Clob : return DbType.String;
- case OracleType.Cursor : return DbType.Object;
- case OracleType.DateTime : return DbType.DateTime;
- case OracleType.Double : return DbType.Double;
- case OracleType.Float : return DbType.Single;
- case OracleType.Int16 : return DbType.Int16;
- case OracleType.Int32 : return DbType.Int32;
- case OracleType.IntervalDayToSecond : return DbType.Time;
- case OracleType.IntervalYearToMonth : return DbType.Int32;
- case OracleType.LongRaw : return DbType.Binary;
- case OracleType.LongVarChar : return DbType.String;
- case OracleType.NChar : return DbType.AnsiStringFixedLength;
- case OracleType.NClob : return DbType.AnsiString;
- case OracleType.Number : return DbType.VarNumeric;
- case OracleType.NVarChar : return DbType.AnsiString;
- case OracleType.Raw : return DbType.Binary;
-
- case OracleType.RowId : return DbType.AnsiStringFixedLength;
- case OracleType.SByte : return DbType.SByte;
- case OracleType.Timestamp : return DbType.Time;
- case OracleType.TimestampLocal : return DbType.Time;
- case OracleType.TimestampWithTZ : return DbType.Time;
- case OracleType.UInt16 : return DbType.UInt16;
-
- case OracleType.UInt32 : return DbType.UInt32;
- case OracleType.VarChar : return DbType.String;
-// case OracleType.Empty : return DbType.Object;
-// case OracleType.SmallInt : return DbType.Int16;
-// case OracleType.Integer : return DbType.Int32;
-// case OracleType.Single : return DbType.Single;
-// case OracleType.Double : return DbType.Double;
-// case OracleType.Currency : return DbType.Currency;
-// case OracleType.Date : return DbType.DateTime;
-// case OracleType.BSTR : return DbType.String;
-// case OracleType.IDispatch : return DbType.Object;
-// case OracleType.Error : return DbType.Object;
-// case OracleType.Boolean : return DbType.Boolean;
-// case OracleType.Variant : return DbType.Object;
-// case OracleType.IUnknown : return DbType.Object;
-// case OracleType.Decimal : return DbType.Decimal;
-// case OracleType.TinyInt : return DbType.SByte;
-// case OracleType.UnsignedTinyInt : return DbType.Byte;
-// case OracleType.UnsignedSmallInt : return DbType.UInt16;
-// case OracleType.UnsignedInt : return DbType.UInt32;
-// case OracleType.BigInt : return DbType.Int64;
-// case OracleType.UnsignedBigInt : return DbType.UInt64;
-// case OracleType.Filetime : return DbType.DateTime;
-// case OracleType.Guid : return DbType.Guid;
-// case OracleType.Binary : return DbType.Binary;
-// case OracleType.Char : return DbType.AnsiStringFixedLength;
-// case OracleType.WChar : return DbType.StringFixedLength;
-// case OracleType.Numeric : return DbType.Decimal;
-// case OracleType.DBDate : return DbType.Date;
-// case OracleType.DBTime : return DbType.Time;
-// case OracleType.DBTimeStamp : return DbType.DateTime;
-// case OracleType.PropVariant : return DbType.Object;
-// case OracleType.VarNumeric : return DbType.VarNumeric;
-// case OracleType.VarChar : return DbType.AnsiString;
-// case OracleType.LongVarChar : return DbType.AnsiString;
-// case OracleType.VarWChar : return DbType.String;
-// case OracleType.LongVarWChar : return DbType.String;
-// case OracleType.VarBinary : return DbType.Binary;
-// case OracleType.LongVarBinary : return DbType.Binary;
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);
- }
- }
-
- internal static int OracleTypeToJdbcType(OracleType oleDbType) {
- switch(oleDbType) {
- case OracleType.BFile : return (int)JavaSqlTypes.BINARY;
- case OracleType.Blob : return (int)JavaSqlTypes.BINARY;
- case OracleType.Byte : return (int)JavaSqlTypes.TINYINT;
- case OracleType.Char : return (int)JavaSqlTypes.CHAR;
- case OracleType.Clob : return (int)JavaSqlTypes.CLOB;
- case OracleType.Cursor : return (int)JavaSqlTypes.CURSOR;
- case OracleType.DateTime : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.Double : return (int)JavaSqlTypes.DOUBLE;
- case OracleType.Float : return (int)JavaSqlTypes.FLOAT;
- case OracleType.Int16 : return (int)JavaSqlTypes.SMALLINT;
- case OracleType.Int32 : return (int)JavaSqlTypes.INTEGER;
- case OracleType.IntervalDayToSecond : return (int)JavaSqlTypes.INTERVALDS;
- case OracleType.IntervalYearToMonth : return (int)JavaSqlTypes.INTERVALYM;
- case OracleType.LongRaw : return (int)JavaSqlTypes.LONGVARBINARY;
- case OracleType.LongVarChar : return (int)JavaSqlTypes.LONGVARCHAR;
- case OracleType.NChar : return (int)JavaSqlTypes.CHAR;
- case OracleType.NClob : return (int)JavaSqlTypes.CLOB;
- case OracleType.Number : return (int)JavaSqlTypes.NUMERIC;
- case OracleType.NVarChar : return (int)JavaSqlTypes.VARCHAR;
- case OracleType.Raw : return (int)JavaSqlTypes.BINARY;
-
- case OracleType.RowId : return (int)JavaSqlTypes.VARCHAR;
- case OracleType.SByte : return (int)JavaSqlTypes.TINYINT;
- case OracleType.Timestamp : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.TimestampLocal : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.TimestampWithTZ : return (int)JavaSqlTypes.TIMESTAMP;
- case OracleType.UInt16 : return (int)JavaSqlTypes.SMALLINT;
-
- case OracleType.UInt32 : return (int)JavaSqlTypes.INTEGER;
- case OracleType.VarChar : return (int)JavaSqlTypes.VARCHAR;
-// case OracleType.BigInt : return Types.BIGINT;
-// case OracleType.Binary : return Types.BINARY;
-// case OracleType.Boolean : return Types.BIT;
-// case OracleType.BSTR : return Types.VARCHAR;
-// case OracleType.Char : return Types.CHAR;
-// case OracleType.Currency : return Types.DECIMAL;
-// case OracleType.Date : return Types.TIMESTAMP;
-// case OracleType.DBDate : return Types.DATE;
-// case OracleType.DBTime : return Types.TIME;
-// case OracleType.DBTimeStamp : return Types.TIMESTAMP;
-// case OracleType.Decimal : return Types.DECIMAL;
-// case OracleType.Double : return Types.DOUBLE;
-// case OracleType.Empty : return Types.NULL;
-// case OracleType.Error : return Types.OTHER;
-// case OracleType.Filetime : return Types.TIMESTAMP;
-// case OracleType.Guid : return Types.CHAR;
-// case OracleType.IDispatch : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");
-// case OracleType.Integer : return Types.INTEGER;
-// case OracleType.IUnknown : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");
-// case OracleType.LongVarBinary : return Types.LONGVARBINARY;
-// case OracleType.LongVarChar : return Types.LONGVARCHAR;
-// case OracleType.LongVarWChar : return Types.LONGVARCHAR;
-// case OracleType.Numeric : return Types.NUMERIC;
-// case OracleType.PropVariant : return Types.OTHER;
-// case OracleType.Single : return Types.FLOAT;
-// case OracleType.SmallInt : return Types.SMALLINT;
-// case OracleType.TinyInt : return Types.TINYINT;
-// case OracleType.UnsignedBigInt : return Types.BIGINT;
-// case OracleType.UnsignedInt : return Types.INTEGER;
-// case OracleType.UnsignedSmallInt : return Types.SMALLINT;
-// case OracleType.UnsignedTinyInt : return Types.TINYINT;
-// case OracleType.VarBinary : return Types.VARBINARY;
-// case OracleType.VarChar : return Types.VARCHAR;
-// case OracleType.Variant : return Types.VARCHAR;
-// case OracleType.VarNumeric : return Types.DECIMAL;
-// case OracleType.VarWChar : return Types.VARCHAR;
-// case OracleType.WChar : return Types.VARCHAR;
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);
- }
-
- #endregion // Methods
- }
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs
deleted file mode 100644
index 5c1fa39b70..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleDataReader.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// System.Data.OracleClient.OracleDataReader
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.OracleClient {
- public sealed class OracleDataReader : AbstractDataReader {
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- internal OracleDataReader(OracleCommand command) : base(command) {
- }
-
- #endregion // Constructors
-
- #region Methods
-
- protected sealed override SystemException CreateException(string message, SQLException e) {
- return new OracleException(message,e, (OracleConnection)_command.Connection);
- }
-
- protected sealed override SystemException CreateException(java.io.IOException e) {
- return new OracleException(e, (OracleConnection)_command.Connection);
- }
-
- public override String GetDataTypeName(int columnIndex) {
- try {
- string jdbcTypeName = Results.getMetaData().getColumnTypeName(columnIndex + 1);
-
- return OracleConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- protected override int GetProviderType(int jdbcType) {
- return (int)OracleConvert.JdbcTypeToOracleType(jdbcType);
- }
-
- protected override IReaderCacheContainer CreateReaderCacheContainer(int jdbcType, int columnIndex) {
- switch ((JavaSqlTypes)jdbcType) {
- case JavaSqlTypes.BINARY_FLOAT:
- jdbcType = (int)JavaSqlTypes.REAL;
- break;
- case JavaSqlTypes.BINARY_DOUBLE:
- jdbcType = (int)JavaSqlTypes.DOUBLE;
- break;
- case JavaSqlTypes.ROWID:
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- break;
-// case JavaSqlTypes.CURSOR:
-// jdbcType = JavaSqlTypes.OTHER;
-// break;
- case JavaSqlTypes.TIMESTAMPNS:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.TIMESTAMPTZ:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.TIMESTAMPLTZ:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- case JavaSqlTypes.INTERVALYM:
- jdbcType = (int)JavaSqlTypes.INTEGER;
- break;
- case JavaSqlTypes.INTERVALDS:
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;
- break;
- }
- return base.CreateReaderCacheContainer (jdbcType, columnIndex);
- }
-
-
- protected override void SetSchemaType(DataRow schemaRow, ResultSetMetaData metaData, int columnIndex) {
- JavaSqlTypes columnType = (JavaSqlTypes)metaData.getColumnType(columnIndex);
- switch (columnType) {
- case JavaSqlTypes.BINARY_FLOAT:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfFloat;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.BINARY_DOUBLE:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.ROWID:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfString;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.CURSOR:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPNS:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPTZ:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.TIMESTAMPLTZ:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.INTERVALYM:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfUInt32;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- case JavaSqlTypes.INTERVALDS:
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;
- break;
- default:
- base.SetSchemaType(schemaRow, metaData, columnIndex);
- break;
- }
- }
-
- public override decimal GetDecimal(int i) {
- if (IsNumeric(i))
- return GetDecimalSafe(i);
-
- return base.GetDecimal(i);
- }
-
- public override double GetDouble(int i) {
- if (IsNumeric(i))
- return GetDoubleSafe(i);
-
- return base.GetDouble(i);
- }
-
- public override float GetFloat(int i) {
- if (IsNumeric(i))
- return GetFloatSafe(i);
-
- return base.GetFloat(i);
- }
-//
-// OracleClient does not "excuse" for Int16
-//
-// public override short GetInt16(int i) {
-// if (IsNumeric(i))
-// return GetInt16Safe(i);
-//
-// return base.GetInt16(i);
-// }
-
-
- public override int GetInt32(int i) {
- if (IsNumeric(i))
- return GetInt32Safe(i);
-
- return base.GetInt32(i);
- }
-
- public override long GetInt64(int i) {
- if (IsNumeric(i))
- return GetInt64Safe(i);
-
- return base.GetInt64(i);
- }
-
-#if SUPPORT_ORACLE_TYPES
- #region GetOracleXXX
-
- public OracleBFile GetOracleBFile(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleBinary GetOracleBinary(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleDateTime GetOracleDateTime(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleLob GetOracleLob(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleMonthSpan GetOracleMonthSpan(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleNumber GetOracleNumber(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleString GetOracleString(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public OracleTimeSpan GetOracleTimeSpan(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public object GetOracleValue(
- int i
- ) {
- throw new NotImplementedException();
- }
-
- public int GetOracleValues(
- object[] values
- ) {
- throw new NotImplementedException();
- }
-
- #endregion
-#endif
-
- #endregion // Methods
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs
deleted file mode 100644
index 155f986d2b..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleException.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// System.Data.SqlClient.SqlException
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Data.OracleClient {
-
- using java.sql;
-
- using System;
- using System.Data.ProviderBase;
-
- /**
- * The exception that is thrown when SQL Server returns a warning or error.
- * This class cannot be inherited.
- */
-
- /*
- * CURRENT LIMITATIONS
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc)
- * is not supported.
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)
- */
-
- public sealed class OracleException : AbstractDbException {
- internal OracleException(Exception cause, OracleConnection connection) : base(cause, connection) {}
-
- internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}
-
- internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}
-
- protected override AbstractDbErrorCollection DbErrors {
- get {
- return Errors;
- }
- }
-
-
-
- /**
- * Gets the severity level of the error returned from the SQL Server .NET
- * Data Provider.
- * @return severity level of the first error in the collection.
- */
-// public byte Class {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Class : (byte)0;
-// }
-// }
-
- /**
- * Gets a collection of one or more SqlError objects that give detailed
- * information about exceptions generated by the SQL Server .NET Data Provider.
- * @return collection of SqlError objects
- */
- internal OracleErrorCollection Errors {
- get {
- return new OracleErrorCollection(_cause, _connection);
- }
- }
-
- public int Code {
- get { return DbErrorCode; }
- }
-
- /**
- * Gets the line number within the Transact-SQL command batch or stored
- * procedure that generated the error.
- * @return line number of the first error in the collection.
- */
-// public int LineNumber {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].LineNumber : 0;
-// }
-// }
-
- /**
- * Gets a number that identifies the type of error.
- * @return number that identifies the type of first error in the collection
- */
-// public int Number {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Number : 0;
-// }
-// }
-
- /**
- * Gets the name of the stored procedure or remote procedure call (RPC)
- * that generated the error.
- * @return name of the stored procedure
- */
-// public String Procedure {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Procedure : null;
-// }
-// }
-
- /**
- * Gets the name of the computer running an instance of SQL Server
- * that generated the error.
- * @return name of the computer where error generated
- */
-// public String Server {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].Server : null;
-// }
-// }
-
-
- /**
- * Gets a numeric error code from SQL Server that represents an error,
- * warning or "no data found" message.
- * @return numeric error code from SQL Server
- */
-// public byte State {
-// get {
-// SqlErrorCollection errors = Errors;
-// return errors.Count > 0 ? errors[0].State : (byte)0;
-// }
-// }
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleLob.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleLob.cs
deleted file mode 100644
index e8762de450..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleLob.cs
+++ /dev/null
@@ -1,329 +0,0 @@
-
-using System;
-using System.Data.SqlTypes;
-using System.IO;
-using System.Text;
-
-namespace System.Data.OracleClient {
- public sealed class OracleLob : Stream, ICloneable, INullable {
- #region Fields
-
- public static readonly new OracleLob Null = new OracleLob ();
-
- internal OracleConnection connection;
- bool isBatched = false;
- bool isOpen = true;
- bool notNull = false;
- OracleType type;
-
- long length = -1;
- long position = 0;
-
- #endregion // Fields
-
- #region Constructors
-
- internal OracleLob () {
- }
-
-
- #endregion // Constructors
-
- #region Properties
-
- public override bool CanRead {
- get { return (IsNull || isOpen); }
- }
-
- public override bool CanSeek {
- get { return (IsNull || isOpen); }
- }
-
- public override bool CanWrite {
- get { return isOpen; }
- }
-
- public int ChunkSize {
- [MonoTODO]
- get {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
- throw new NotImplementedException ();
- }
- }
-
- public OracleConnection Connection {
- get { return connection; }
- }
-
- public bool IsBatched {
- get { return isBatched; }
- }
-
- public bool IsNull {
- get { return !notNull; }
- }
-
- public bool IsTemporary {
- get {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
- throw new NotImplementedException ();
- }
- }
-
- public override long Length {
- get {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
- throw new NotImplementedException ();
- }
- }
-
- public OracleType LobType {
- get { return type; }
- }
-
- public override long Position {
- get {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
- return position;
- }
- set {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
- position = value;
- }
- }
-
- public object Value {
- get {
- AssertObjectNotDisposed ();
- if (IsNull)
- return DBNull.Value;
-
- byte[] buffer = null;
-
- int len = (int) Length;
- if (len == 0) {
- // LOB is not Null, but it is Empty
- if (LobType == OracleType.Clob)
- return "";
- else // OracleType.Blob
- return new byte[0];
- }
-
- if (LobType == OracleType.Clob) {
- buffer = new byte [len];
- Read (buffer, 0, len);
- UnicodeEncoding encoding = new UnicodeEncoding ();
- return encoding.GetString (buffer);
- }
- else {
- // OracleType.Blob
- buffer = new byte [len];
- Read (buffer, 0, len);
- return buffer;
- }
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public void Append (OracleLob source) {
- if (source.IsNull)
- throw new ArgumentNullException ();
- if (Connection.State == ConnectionState.Closed)
- throw new InvalidOperationException ();
- throw new NotImplementedException ();
- }
-
- void AssertAmountIsEven (long amount, string argName) {
- if (amount % 2 == 1)
- throw new ArgumentOutOfRangeException ("CLOB and NCLOB parameters require even number of bytes for this argument.");
- }
-
- void AssertAmountIsValid (long amount, string argName) {
- if (amount > UInt32.MaxValue)
- throw new ArgumentOutOfRangeException ("Argument too big.");
- if (LobType == OracleType.Clob || LobType == OracleType.NClob)
- AssertAmountIsEven (amount, argName);
- }
-
- void AssertConnectionIsOpen () {
- if (connection.State == ConnectionState.Closed)
- throw new InvalidOperationException ("Invalid operation. The connection is closed.");
- }
-
- void AssertObjectNotDisposed () {
- if (!isOpen)
- throw new ObjectDisposedException ("OracleLob");
- }
-
- void AssertTransactionExists () {
-// if (connection.Transaction == null)
-// throw new InvalidOperationException ("Modifying a LOB requires that the connection be transacted.");
- throw new NotImplementedException ();
- }
-
- public void BeginBatch () {
- BeginBatch (OracleLobOpenMode.ReadOnly);
- }
-
- public void BeginBatch (OracleLobOpenMode mode) {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
-
- isBatched = true;
- }
-
- [MonoTODO]
- public object Clone () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void Close () {
- isOpen = false;
- }
-
- public long CopyTo (OracleLob destination) {
- return CopyTo (0, destination, 0, Length);
- }
-
- public long CopyTo (OracleLob destination, long destinationOffset) {
- return CopyTo (0, destination, destinationOffset, Length);
- }
-
- public long CopyTo (long sourceOffset, OracleLob destination, long destinationOffset, long amount) {
- if (destination.IsNull)
- throw new ArgumentNullException ();
-
- AssertAmountIsValid (sourceOffset, "sourceOffset");
- AssertAmountIsValid (destinationOffset, "destinationOffset");
- AssertAmountIsValid (amount, "amount");
- AssertTransactionExists ();
- AssertConnectionIsOpen ();
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Dispose () {
- throw new NotImplementedException ();
- }
-
- public void EndBatch () {
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
-
- isBatched = false;
- }
-
- public long Erase () {
- return Erase (0, Length);
- }
-
- public long Erase (long offset, long amount) {
- if (offset < 0 || amount < 0)
- throw new ArgumentOutOfRangeException ("Must be a positive value.");
- if (offset + amount > Length)
- throw new ArgumentOutOfRangeException ();
-
- AssertAmountIsValid (offset, "offset");
- AssertAmountIsValid (amount, "amount");
-
- throw new NotImplementedException ();
- }
-
- public override void Flush () {
- // No-op
- }
-
- public override int Read (byte[] buffer, int offset, int count) {
- if (buffer == null)
- throw new ArgumentNullException ();
-
- AssertAmountIsValid (offset, "offset");
- AssertAmountIsValid (count, "count");
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
-
- throw new NotImplementedException ();
-
- int bytesRead;
- byte[] output = new byte[count];
-
- output.CopyTo (buffer, offset);
- position += bytesRead;
- return bytesRead;
- }
-
- [MonoTODO]
- public override long Seek (long offset, SeekOrigin origin) {
- long newPosition = position;
-
- switch (origin) {
- case SeekOrigin.Begin:
- newPosition = offset;
- break;
- case SeekOrigin.Current:
- newPosition += offset;
- break;
- case SeekOrigin.End:
- newPosition = Length + offset;
- break;
- }
-
- if (newPosition > Length)
- throw new ArgumentOutOfRangeException ();
-
- position = newPosition;
- return position;
- }
-
- [MonoTODO]
- public override void SetLength (long value) {
- AssertAmountIsValid (value, "value");
- AssertTransactionExists ();
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
-
- throw new NotImplementedException ();
-
- length = value;
- }
-
- public override void Write (byte[] buffer, int offset, int count) {
- if (buffer == null)
- throw new ArgumentNullException ("Buffer is null.");
- if (offset < 0 || count < 0)
- throw new ArgumentOutOfRangeException ("Must be a positive value.");
- if (offset + count > buffer.Length)
- throw new ArgumentOutOfRangeException ("The offset and count values specified exceed the buffer provided.");
- AssertAmountIsValid (offset, "offset");
- AssertAmountIsValid (count, "count");
- AssertTransactionExists ();
- AssertConnectionIsOpen ();
- AssertObjectNotDisposed ();
-
- byte[] value = null;
- if (offset + count == buffer.Length && offset == 0)
- value = buffer;
- else {
- value = new byte[count];
- Array.Copy (buffer, offset, value, 0, count);
- }
-
- throw new NotImplementedException ();
-
-// position += locator.Write (value, (uint) Position, (uint) value.Length, LobType);
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs
deleted file mode 100644
index d6b4e11e7e..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameter.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// System.Data.OracleClient.OracleParameter
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Text;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Globalization;
-
-using java.sql;
-using java.lang;
-
-namespace System.Data.OracleClient {
- public sealed class OracleParameter : AbstractDbParameter, ICloneable {
-
- #region Fields
-
- OracleType _oleDbType = OracleType.VarChar;
-
- #endregion // Fields
-
- #region Constructors
-
- public OracleParameter() {
- }
-
- public OracleParameter(String parameterName, Object value)
- : this (parameterName, OracleType.VarChar, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, value) {
- IsDbTypeSet = false;
- }
-
- public OracleParameter(String parameterName, OracleType dbType)
- : this (parameterName, dbType, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {
- }
-
- public OracleParameter(String parameterName, OracleType dbType, int size)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {
- }
-
- public OracleParameter(String parameterName, OracleType dbType, int size,
- String sourceColumn)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, sourceColumn, DataRowVersion.Current, null) {
- }
-
-
- public OracleParameter(String parameterName,
- OracleType dbType,
- int size,
- ParameterDirection direction,
- bool isNullable,
- byte precision,
- byte scale,
- String sourceColumn,
- DataRowVersion sourceVersion,
- Object value) {
- ParameterName = parameterName;
- OracleType = dbType;
- Size = size;
- Direction = direction;
- IsNullable = isNullable;
- Precision = precision;
- Scale = scale;
- SourceColumn = sourceColumn;
- SourceVersion = sourceVersion;
- Value = value;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override DbType DbType {
- get { return OracleConvert.OracleTypeToDbType(_oleDbType); }
- set { OracleType = OracleConvert.DbTypeToOracleType(value); }
- }
-
- public OracleType OracleType {
- get { return _oleDbType; }
- set {
- _oleDbType = value;
- IsDbTypeSet = true;
- }
- }
-
- public new Object Value {
- get { return base.Value; }
- set {
- if (!IsDbTypeSet && (value != null) && (value != DBNull.Value)) {
- _oleDbType = OracleConvert.ValueTypeToOracleType(value.GetType());
- }
- base.Value = value;
- }
- }
-
-#if NET_2_0
- public new byte Precision {
- get { return base.Precision; }
- set { base.Precision = value; }
- }
-
- public new byte Scale {
- get { return base.Scale; }
- set { base.Scale = value; }
- }
-#endif
-
- #endregion // Properties
-
- #region Methods
-
- public override String ToString() {
- return ParameterName;
- }
-
- protected override string Placeholder {
- get {
- if (ParameterName.Length == 0 || ParameterName[0] == ':')
- return ParameterName;
-
- return String.Concat(":", ParameterName);
- }
- }
-
- internal string InternalPlaceholder {
- get {
- return Placeholder;
- }
- }
-
- protected sealed override object ConvertValue(object value) {
- // can not convert null or DbNull to other types
- if (value == null || value == DBNull.Value) {
- return value;
- }
-
- // TBD : some other way to do this?
-// if (OracleType == OracleType.Binary) {
-// return value;
-// }
- // .NET throws an exception to the user.
- object convertedValue = value;
-
- // note : if we set user parameter jdbc type inside prepare interbal, the db type is not set
- if (value is IConvertible && (IsDbTypeSet || IsJdbcTypeSet)) {
- OracleType oleDbType = (IsDbTypeSet) ? OracleType : OracleConvert.JdbcTypeToOracleType((int)JdbcType);
- Type to = OracleConvert.OracleTypeToValueType(oleDbType);
- if (!(value is DateTime && to == OracleConvert.TypeOfTimespan)) //anyway will go by jdbc type
- convertedValue = Convert.ChangeType(value,to);
- }
- return convertedValue;
- }
-
- protected sealed override void SetParameterName(ResultSet res) {
- ParameterName = res.getString("COLUMN_NAME");
- }
-
- protected sealed override void SetParameterDbType(ResultSet res) {
- int jdbcType = res.getInt("DATA_TYPE");
- // FIXME : is that correct?
- if (jdbcType == Types.OTHER) {
- string typeName = res.getString("TYPE_NAME");
- if (String.Compare("REF CURSOR", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.CURSOR;
- }
- else if (String.Compare("BLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.BLOB;
- }
- else if (String.Compare("CLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.CLOB;
- }
- else if(String.Compare("FLOAT",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.FLOAT;
- }
- else if(String.Compare("NVARCHAR2",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- }
- else if(String.Compare("NCHAR",typeName,true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = (int)JavaSqlTypes.VARCHAR;
- }
- }
- OracleType = OracleConvert.JdbcTypeToOracleType(jdbcType);
- JdbcType = jdbcType;
- }
-
- protected sealed override void SetSpecialFeatures(ResultSet res) {
- // do nothing
- }
-
- protected sealed override int JdbcTypeFromProviderType() {
- return OracleConvert.OracleTypeToJdbcType(OracleType);
- }
-
- #endregion // Methods
-
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameterCollection.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameterCollection.cs
deleted file mode 100644
index 3cbb6685b8..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleParameterCollection.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.Data.Common.OracleParameterCollection
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.Data.ProviderBase;
-
-namespace System.Data.OracleClient {
- public sealed class OracleParameterCollection : AbstractDbParameterCollection {
- #region Constructors
-
- public OracleParameterCollection(OracleCommand parent): base(parent) {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public new OracleParameter this[int index] {
- get { return (OracleParameter)base[index]; }
- set {
- OnSchemaChanging();
- base[index] = value;
- }
- }
-
- public new OracleParameter this[string parameterName] {
- get { return (OracleParameter)base[parameterName]; }
- set {
- OnSchemaChanging();
- base[parameterName] = value;
- }
- }
-
- protected override Type ItemType {
- get { return typeof(OracleParameter); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public OracleParameter Add(OracleParameter value) {
- base.Add(value);
- return value;
- }
-
- public OracleParameter Add(string parameterName, object value) {
- OracleParameter param = new OracleParameter(parameterName, value);
- return Add(param);
- }
-
- public OracleParameter Add(string parameterName, OracleType sqlDbType) {
- OracleParameter param = new OracleParameter(parameterName, sqlDbType);
- return Add(param);
- }
-
- public OracleParameter Add(string parameterName, OracleType sqlDbType, int size) {
- OracleParameter param = new OracleParameter(parameterName, sqlDbType, size);
- return Add(param);
- }
-
- public OracleParameter Add(string parameterName, OracleType sqlDbType, int size, string sourceColumn) {
- OracleParameter param = new OracleParameter(parameterName, sqlDbType, size, sourceColumn);
- return Add(param);
- }
-
-#if NET_2_0
- public OracleParameter AddWithValue (string parameterName, object value) {
- return Add (parameterName, value);
- }
-
- public bool Contains (OracleParameter value) {
- return base.Contains (value);
- }
-
- public void CopyTo (OracleParameter [] array, int index) {
- base.CopyTo (array, index);
- }
-
- public void Insert (int index, OracleParameter value) {
- base.Insert (index, value);
- }
-
- public void Remove (OracleParameter value) {
- base.Remove (value);
- }
-#endif
-
- #endregion // Methods
-
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleTransaction.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleTransaction.cs
deleted file mode 100644
index 4ab3cded74..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleTransaction.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Data.OracleClient.OracleTransaction.cs
-//
-// Authors:
-// Konstantin Triger
-// Boris Kirzner
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.OracleClient {
-
- using System.Data.Common;
- using System.Data.ProviderBase;
- using System.Data;
-
- public sealed class OracleTransaction : AbstractTransaction {
-
- internal OracleTransaction(OracleConnection connection) : base(IsolationLevel.ReadCommitted, connection, null) {
- }
-
- internal OracleTransaction(OracleConnection connection, String transactionName) : base(IsolationLevel.ReadCommitted, connection, transactionName) {
- }
-
- internal OracleTransaction(IsolationLevel isolationLevel, OracleConnection connection) : base(isolationLevel, connection, null) {
- }
-
- public new OracleConnection Connection {
- get {
- return (OracleConnection)base.Connection;
- }
- }
-
- public OracleTransaction Begin() {
- return Begin(IsolationLevel.ReadCommitted);
- }
-
- public OracleTransaction Begin(IsolationLevel isolationLevetl) {
- throw new InvalidOperationException("Only one transaction can be active on this session.");
- }
-
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/Regex.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/Regex.cs
deleted file mode 100644
index 947d810b41..0000000000
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/Regex.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Data.OracleClient.Regex.cs
-//
-// Authors:
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// (c) 2006 Mainsoft corp. (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Data.ProviderBase;
-
-namespace System.Data.OracleClient
-{
- ///
- /// Summary description for Regex.
- ///
- internal class OracleParamsRegex : SimpleRegex {
- //static readonly char[] charsEnd = new char[] {' ', '\f', '\t', '\v', '\r', '\n', ',', ';', '(', ')', '[', ']','='};
- protected override SimpleMatch Match(string input, int beginning, int length) {
-
- int actualLen = length-1; //there must be something after @
- for (int i = beginning; i < actualLen; i++) {
- char ch = input[i];
- switch(ch) {
- case '\'': {
- int end = input.IndexOf('\'', i+1);
- if (end < 0)
- break;
-
- i = end;
- break;
- }
- case '"': {
- int end = input.IndexOf('"', i+1);
- if (end < 0)
- break;
-
- i = end;
- break;
- }
- case '[': {
- int end = input.IndexOf(']', i+1);
- if (end < 0)
- break;
-
- i = end;
- break;
- }
- case ':': {
- int start = i;
-
- do {
- i++;
- }while (i < length && input[i] == ':');
-
- if (i - start > 1)
- break;
-
- while (i < length && IsWordChar(input[i]))
- i++;
-
- return new SimpleMatch(this, length, true, start, i-start, input);
- }
- }
- }
-
- return new SimpleMatch(this, length, false, length, 0, input);
- }
- }
-}
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleClientFactory.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleClientFactory.cs
index 3bbda5263b..8d0aa1cd4c 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleClientFactory.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleClientFactory.cs
@@ -71,11 +71,9 @@ namespace System.Data.OracleClient
return new OracleConnectionStringBuilder ();
}
-#if !TARGET_JVM
public override CodeAccessPermission CreatePermission (PermissionState state) {
return new OraclePermission (state);
}
-#endif
public override DbDataAdapter CreateDataAdapter () {
return new OracleDataAdapter ();
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ConnectedDataProvider.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ConnectedDataProvider.cs
index 1a054138f3..3fd8b632a9 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ConnectedDataProvider.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/ConnectedDataProvider.cs
@@ -278,34 +278,6 @@ namespace MonoTests.System.Data.Utils {
// The .NET Framework provides support for Oracle LOBs in the OracleClient namespace, but not in the Oracle namespace.
// Since Visual MainWin does not support the OracleClient namespace, a partial support for this important feature is provided in the Oracle namespace.
// See ms-help://MS.VSCC.2003/VMW.GH.1033/ghdoc/vmwdoc_ADONET_data_access_limitations_51.htm
-#if TARGET_JVM
-
- row.Add("BLOB", new byte[] {0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- }, 4000);
- row.Add("CLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
- row.Add("NCLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
-#endif
break;
#endregion
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/DbTypeParametersCollection.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/DbTypeParametersCollection.cs
index 9e0068d21e..0f2d77472a 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/DbTypeParametersCollection.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/MonoTests.System.Data.Utils/DbTypeParametersCollection.cs
@@ -376,9 +376,7 @@ namespace MonoTests.System.Data.Utils.Data
/// The number of deleted rows.
public static int ExecuteDelete(string a_sTableName, string a_sUniqueId)
{
-#if !TARGET_JVM
return 0;
-#endif
int l_iRecordsDeleted;
OracleCommand l_cmdDelete = new OracleCommand();
l_cmdDelete.Connection = new OracleConnection(ConnectedDataProvider.ConnectionString);
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleCommand/OracleCommand_CommandTimeout.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleCommand/OracleCommand_CommandTimeout.cs
index b18ab465f0..e6585b85a7 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleCommand/OracleCommand_CommandTimeout.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleCommand/OracleCommand_CommandTimeout.cs
@@ -50,9 +50,7 @@ public class OracleCommand_CommandTimeout : GHTBase
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
OracleCommand cmd = new OracleCommand();
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_FillSchema_DsSt.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_FillSchema_DsSt.cs
index 4f0fd3c672..78a0c12894 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_FillSchema_DsSt.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_FillSchema_DsSt.cs
@@ -68,9 +68,7 @@ public class OracleDataAdapter_FillSchema_DsSt : ADONetTesterClass
//Test case for bug #4708
[Test(Description="Test case for bug #4708")]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestLongSqlExpression()
{
BeginCase("Long SQL string cause java.lang.StackOverflowError (Test case for bug #4708)");
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Fill_2.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Fill_2.cs
index 658309ae90..388124e864 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Fill_2.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Fill_2.cs
@@ -64,9 +64,6 @@ namespace MonoTests.System.Data.OracleClient
DoTestTypes3(con);
}
-#if TARGET_JVM
- DoTestTypes4(con);
-#endif
// DoTestTypes5(con); //Table direct --> multipe tables
DoTestTypes6(con);
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_GetFillParameters.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_GetFillParameters.cs
index 317faa488a..663d6b77ea 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_GetFillParameters.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_GetFillParameters.cs
@@ -70,9 +70,7 @@ public class OracleDataAdapter_GetFillParameters : GHTBase
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void run()
{
Exception exp = null;
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Ds.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Ds.cs
index 7e94c04c22..95f739ab56 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Ds.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Ds.cs
@@ -36,9 +36,7 @@ using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Ds : ADONetTesterClass
{
public static void Main()
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_DsStr.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_DsStr.cs
index a2c32c7414..aacab9fb3b 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_DsStr.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_DsStr.cs
@@ -35,9 +35,7 @@ using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_DsStr : ADONetTesterClass
{
public static void Main()
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dt.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dt.cs
index 9f99ce9cfc..762716a789 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dt.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataAdapter/OracleDataAdapter_Update_Dt.cs
@@ -33,9 +33,7 @@ using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Dt : ADONetTesterClass
{
public static void Main()
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_GetName_I.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_GetName_I.cs
index d747284760..a574e655b1 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_GetName_I.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_GetName_I.cs
@@ -49,9 +49,7 @@ public class OracleDataReader_GetName_I : GHTBase
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_NextResult.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_NextResult.cs
index 2e237b45ab..b03cc4c51f 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_NextResult.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_NextResult.cs
@@ -79,9 +79,7 @@ namespace MonoTests.System.Data.OracleClient
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSQLText()
{
@@ -351,9 +349,7 @@ namespace MonoTests.System.Data.OracleClient
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSP()
{
#if !JAVA
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_ctor.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_ctor.cs
index e1c09c5f47..957651c579 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_ctor.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleDataReader/OracleDataReader_ctor.cs
@@ -49,9 +49,7 @@ public class OracleDataReader_ctor : GHTBase
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs
index e375cb4512..4b9593536f 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleParameter/OracleParameter_ctor_SOtype.cs
@@ -94,9 +94,6 @@ public class OracleParameter_ctor_SOtype : ADONetTesterClass
}
[Test]
-//#if !TARGET_JVM
-// [Category("NotWorking")]
-//#endif
public void SimpleTypesWithDBNull()
{
OracleConnection con=null;
@@ -187,4 +184,4 @@ public class OracleParameter_ctor_SOtype : ADONetTesterClass
}
}
}
-}
\ No newline at end of file
+}
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleTransaction/OracleTransaction_Rollback.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleTransaction/OracleTransaction_Rollback.cs
index 3179050053..d0d5e93f00 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleTransaction/OracleTransaction_Rollback.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient.jvm/OracleTransaction/OracleTransaction_Rollback.cs
@@ -33,9 +33,7 @@ using NUnit.Framework;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleTransaction_Rollback : ADONetTesterClass
{
public static void Main()
diff --git a/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.exclude.sources b/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.exclude.sources
deleted file mode 100755
index 46691cf43e..0000000000
--- a/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.exclude.sources
+++ /dev/null
@@ -1,47 +0,0 @@
-System.Data.OracleClient.Oci/OciAttributeType.cs
-System.Data.OracleClient.Oci/OciBindHandle.cs
-System.Data.OracleClient.Oci/OciCalls.cs
-System.Data.OracleClient.Oci/OciColumnInfo.cs
-System.Data.OracleClient.Oci/OciCredentialType.cs
-System.Data.OracleClient.Oci/OciDataType.cs
-System.Data.OracleClient.Oci/OciDateTimeDescriptor.cs
-System.Data.OracleClient.Oci/OciDefineHandle.cs
-System.Data.OracleClient.Oci/OciDescriptorHandle.cs
-System.Data.OracleClient.Oci/OciEnvironmentHandle.cs
-System.Data.OracleClient.Oci/OciEnvironmentMode.cs
-System.Data.OracleClient.Oci/OciErrorHandle.cs
-System.Data.OracleClient.Oci/OciErrorInfo.cs
-System.Data.OracleClient.Oci/OciExecuteMode.cs
-System.Data.OracleClient.Oci/OciHandle.cs
-System.Data.OracleClient.Oci/OciHandleType.cs
-System.Data.OracleClient.Oci/OciLobLocator.cs
-System.Data.OracleClient.Oci/OciLobType.cs
-System.Data.OracleClient.Oci/OciNlsServiceType.cs
-System.Data.OracleClient.Oci/OciParameterDescriptor.cs
-System.Data.OracleClient.Oci/OciPointerType.cs
-System.Data.OracleClient.Oci/OciRowIdDescriptor.cs
-System.Data.OracleClient.Oci/OciServerHandle.cs
-System.Data.OracleClient.Oci/OciServiceHandle.cs
-System.Data.OracleClient.Oci/OciSessionHandle.cs
-System.Data.OracleClient.Oci/OciSessionMode.cs
-System.Data.OracleClient.Oci/OciStatementHandle.cs
-System.Data.OracleClient.Oci/OciStatementLanguage.cs
-System.Data.OracleClient.Oci/OciStatementMode.cs
-System.Data.OracleClient.Oci/OciStatementType.cs
-System.Data.OracleClient.Oci/OciTransactionFlags.cs
-System.Data.OracleClient.Oci/OciTransactionHandle.cs
-System.Data.OracleClient/OciGlue.cs
-System.Data.OracleClient/OracleBFile.cs
-System.Data.OracleClient/OracleBinary.cs
-System.Data.OracleClient/OracleCommand.cs
-System.Data.OracleClient/OracleCommandBuilder.cs
-System.Data.OracleClient/OracleConnection.cs
-System.Data.OracleClient/OracleConnectionPool.cs
-System.Data.OracleClient/OracleConnectionPoolManager.cs
-System.Data.OracleClient/OracleDataReader.cs
-System.Data.OracleClient/OracleException.cs
-System.Data.OracleClient/OracleInfoMessageEventArgs.cs
-System.Data.OracleClient/OracleLob.cs
-System.Data.OracleClient/OracleParameterCollection.cs
-System.Data.OracleClient/OracleParameter.cs
-System.Data.OracleClient/OracleTransaction.cs
diff --git a/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.sources b/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.sources
deleted file mode 100755
index 42cde4a561..0000000000
--- a/mcs/class/System.Data.OracleClient/net_1_1_java_System.Data.OracleClient.dll.sources
+++ /dev/null
@@ -1,19 +0,0 @@
-#include System.Data.OracleClient.dll.sources
-Mainsoft.Data.Jdbc.Providers.jvm/OracleProvider.cs
-System.Data.OracleClient.jvm/ExceptionHelper.cs
-System.Data.OracleClient.jvm/OracleBFile.cs
-System.Data.OracleClient.jvm/OracleBinary.cs
-System.Data.OracleClient.jvm/OracleCommand.cs
-System.Data.OracleClient.jvm/OracleCommandBuilder.cs
-System.Data.OracleClient.jvm/OracleConnection.cs
-System.Data.OracleClient.jvm/OracleConvert.cs
-System.Data.OracleClient.jvm/OracleDataReader.cs
-System.Data.OracleClient.jvm/OracleError.cs
-System.Data.OracleClient.jvm/OracleErrorCollection.cs
-System.Data.OracleClient.jvm/OracleException.cs
-System.Data.OracleClient.jvm/OracleInfoMessageEventArgs.cs
-System.Data.OracleClient.jvm/OracleLob.cs
-System.Data.OracleClient.jvm/OracleParameter.cs
-System.Data.OracleClient.jvm/OracleParameterCollection.cs
-System.Data.OracleClient.jvm/OracleTransaction.cs
-System.Data.OracleClient.jvm/Regex.cs
diff --git a/mcs/class/System.Data/Assembly/AssemblyInfo.cs b/mcs/class/System.Data/Assembly/AssemblyInfo.cs
index 9f8a04e98a..a98cee8e72 100644
--- a/mcs/class/System.Data/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Data/Assembly/AssemblyInfo.cs
@@ -51,18 +51,14 @@ using System.Runtime.InteropServices;
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
-#endif
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: AssemblyDelaySign (true)]
-#if !TARGET_JVM
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
diff --git a/mcs/class/System.Data/Makefile b/mcs/class/System.Data/Makefile
index 4a15ce7480..2fb0b08ecd 100644
--- a/mcs/class/System.Data/Makefile
+++ b/mcs/class/System.Data/Makefile
@@ -24,13 +24,6 @@ LIB_MCS_FLAGS = \
-r:System.Xml.dll \
-ifeq (net_1_1_java, $(PROFILE))
-OTHER_RES = $(RESOURCE_FILES)
-LIB_MCS_FLAGS += \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- $(OTHER_LIB_MCS_FLAGS)
-else
MOBILE := $(filter monotouch monodroid xammac mobile mobile_static, $(PROFILE))
ifdef MOBILE
LIB_MCS_FLAGS += \
@@ -42,7 +35,6 @@ LIB_MCS_FLAGS += \
-r:Mono.Data.Tds.dll \
$(OTHER_LIB_MCS_FLAGS)
endif
-endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168
diff --git a/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs b/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs
index c12cb34c49..df795e2bb5 100644
--- a/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs
+++ b/mcs/class/System.Data/System.Data.Common/CatalogLocation.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum CatalogLocation
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
index ae3262f24d..75cfc1fb39 100644
--- a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.ComponentModel;
using System.Data;
diff --git a/mcs/class/System.Data/System.Data.Common/DbConnection.cs b/mcs/class/System.Data/System.Data.Common/DbConnection.cs
index 94355018c4..156497a681 100644
--- a/mcs/class/System.Data/System.Data.Common/DbConnection.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbConnection.cs
@@ -32,7 +32,7 @@
using System.ComponentModel;
using System.Data;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
@@ -97,7 +97,7 @@ namespace System.Data.Common {
protected abstract DbCommand CreateDbCommand ();
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public virtual void EnlistTransaction (Transaction transaction)
{
throw new NotSupportedException ();
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
index f438cb100f..18ac3aab9c 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
@@ -659,7 +659,7 @@ namespace System.Data.Common
}
RowUpdatingEventArgs argsUpdating = CreateRowUpdatingEvent (row, command, statementType, tableMapping);
- row.RowError = null;
+ row.RowError = String.Empty;
OnRowUpdating (argsUpdating);
switch (argsUpdating.Status) {
case UpdateStatus.Continue :
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs b/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs
index 1eca5f966a..5ff28000e3 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataSourceEnumerator.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public abstract class DbDataSourceEnumerator
diff --git a/mcs/class/System.Data/System.Data.Common/DbParameter.cs b/mcs/class/System.Data/System.Data.Common/DbParameter.cs
index f1ecefdde8..d22af6a36f 100644
--- a/mcs/class/System.Data/System.Data.Common/DbParameter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbParameter.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
diff --git a/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs b/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs
index 82d6600f29..fd56302648 100644
--- a/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs
index 63c9a560ce..0ea515a345 100644
--- a/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs
@@ -49,11 +49,7 @@ namespace System.Data.Common {
public static DbProviderFactory GetFactory (DataRow providerRow)
{
string assemblyType = (string) providerRow ["AssemblyQualifiedName"];
-#if TARGET_JVM // case insensitive GetType is not supported
- Type type = Type.GetType (assemblyType, false);
-#else
Type type = Type.GetType (assemblyType, false, true);
-#endif
if (type != null && type.IsSubclassOf (typeof (DbProviderFactory))) {
// Provider factories are singletons with Instance field having
// the sole instance
diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs
index 8ce2a17db1..592fdffa0e 100644
--- a/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs
@@ -30,7 +30,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Security;
diff --git a/mcs/class/System.Data/System.Data.Common/DbTable.cs b/mcs/class/System.Data/System.Data.Common/DbTable.cs
index e07c0bf374..ae4da776ac 100644
--- a/mcs/class/System.Data/System.Data.Common/DbTable.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbTable.cs
@@ -30,215 +30,3 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if TARGET_JVM
-
-using System.ComponentModel;
-
-namespace System.Data.Common {
- public abstract class DbTable : DataTable
- {
- #region Constructors
-
- [MonoTODO]
- protected DbTable (DbProviderFactory providerFactory)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- [MonoTODO]
- public ConflictOption ConflictOption {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbConnection Connection {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand DeleteCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand InsertCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbProviderFactory ProviderFactory {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public bool ReturnProviderSpecificTypes {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand SelectCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override ISite Site {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataTableMapping TableMapping {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public int UpdateBatchSize {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand UpdateCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string parentColumnName, string childColumnName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string[] parentColumnNames, string[] childColumnNames)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void BeginInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual DbCommandBuilder CreateCommandBuilder (DbConnection connection)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void EndInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQuery (DbCommandBuilder cmdBuilder)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQueryForHierarchy (DbCommandBuilder builder, DataTable[] tableList)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
-
- #endregion // Methods
- }
-}
-
-#endif
diff --git a/mcs/class/System.Data/System.Data.Common/DbTransaction.cs b/mcs/class/System.Data/System.Data.Common/DbTransaction.cs
index ecd803de56..319ca96328 100644
--- a/mcs/class/System.Data/System.Data.Common/DbTransaction.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbTransaction.cs
@@ -28,7 +28,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common
{
diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs
index f738a187a8..83d8294334 100644
--- a/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs
+++ b/mcs/class/System.Data/System.Data.Odbc/OdbcConnection.cs
@@ -37,7 +37,7 @@ using System.Data.Common;
using System.EnterpriseServices;
using System.Runtime.InteropServices;
using System.Text;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
index 82669cd5c7..2b70404d4d 100644
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
+++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
@@ -31,9 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !TARGET_JVM
using Mono.Data.Tds.Protocol;
-#endif
using System;
using System.Xml;
using System.Text;
@@ -348,7 +346,6 @@ namespace System.Data.SqlTypes
return AdjustScale (n, -(n.Scale), false);
}
-#if !TARGET_JVM
internal static SqlDecimal FromTdsBigDecimal (TdsBigDecimal x)
{
if (x == null)
@@ -356,7 +353,6 @@ namespace System.Data.SqlTypes
else
return new SqlDecimal (x.Precision, x.Scale, !x.IsNegative, x.Data);
}
-#endif
public override int GetHashCode ()
{
diff --git a/mcs/class/System.Data/System.Data/ConflictOption.cs b/mcs/class/System.Data/System.Data/ConflictOption.cs
index 471fde51e6..749dbbc7b8 100644
--- a/mcs/class/System.Data/System.Data/ConflictOption.cs
+++ b/mcs/class/System.Data/System.Data/ConflictOption.cs
@@ -27,7 +27,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum ConflictOption
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
index f3fa2a8e77..4207d16f87 100644
--- a/mcs/class/System.Data/System.Data/DataRow.cs
+++ b/mcs/class/System.Data/System.Data/DataRow.cs
@@ -96,6 +96,7 @@ namespace System.Data {
{
_table = table;
_rowId = rowId;
+ rowError = String.Empty;
}
#endregion // Constructors
diff --git a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionAttributeTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionAttributeTest.cs
index 2a9f7cdada..a8ff6acfa2 100644
--- a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionAttributeTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionAttributeTest.cs
@@ -60,9 +60,7 @@ namespace MonoTests.System.Data.Common
public void Default ()
{
DBDataPermissionAttribute a = new NonAbstractDBDataPermissionAttribute (SecurityAction.Assert);
-#if !TARGET_JVM
Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");
-#endif
Assert.IsFalse (a.Unrestricted, "Unrestricted");
Assert.IsFalse (a.AllowBlankPassword, "AllowBlankPassword");
Assert.AreEqual (String.Empty, a.ConnectionString, "ConnectionString");
diff --git a/mcs/class/System.Data/Test/System.Data.Common/DataColumnMappingCollectionTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DataColumnMappingCollectionTest.cs
index d34d6d4607..f093bd97e2 100644
--- a/mcs/class/System.Data/Test/System.Data.Common/DataColumnMappingCollectionTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.Common/DataColumnMappingCollectionTest.cs
@@ -376,9 +376,6 @@ namespace MonoTests.System.Data.Common
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual ("System.Data.Common.DataColumnMappingCollection", columnMapCollection.ToString(), "test1");
diff --git a/mcs/class/System.Data/Test/System.Data.Common/DataTableMappingCollectionTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DataTableMappingCollectionTest.cs
index a14c3f85ab..a481c27af3 100644
--- a/mcs/class/System.Data/Test/System.Data.Common/DataTableMappingCollectionTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.Common/DataTableMappingCollectionTest.cs
@@ -360,9 +360,6 @@ namespace MonoTests.System.Data.Common
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual("System.Data.Common.DataTableMappingCollection", tableMapCollection.ToString(), "test1");
diff --git a/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs
index c857af2d64..a3f69974e0 100644
--- a/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.Common/DbDataAdapterTest.cs
@@ -223,6 +223,41 @@ sqliteDataAdapter.Update (dataSet, "Primus");
dbConnection.Close();
dbConnection = null;
}
+
+ [Test]
+ [Category ("NotWorking")] // Requires newer sqlite than is on wrench
+ public void UpdateResetRowErrorCorrectly ()
+ {
+ const string connectionString = "URI = file::memory:; Version = 3";
+ using (var dbConnection = new SqliteConnection (connectionString)) {
+ dbConnection.Open ();
+
+ using (var cmd = dbConnection.CreateCommand ()) {
+ cmd.CommandText = "CREATE TABLE data (id PRIMARY KEY, name TEXT)";
+ cmd.ExecuteNonQuery ();
+ }
+
+
+ var ts = dbConnection.BeginTransaction ();
+ var da = new SqliteDataAdapter ("SELECT * FROM data", dbConnection);
+ var builder = new SqliteCommandBuilder (da);
+ da.UpdateCommand = builder.GetUpdateCommand ();
+ da.UpdateCommand.Transaction = ts;
+
+ var ds1 = new DataSet ();
+ da.Fill (ds1, "data");
+
+ var table = ds1.Tables [0];
+ var row = table.NewRow ();
+ row ["id"] = 10;
+ row ["name"] = "Bart";
+ table.Rows.Add (row);
+
+ var ds2 = ds1.GetChanges ();
+ da.Update (ds2, "data");
+ Assert.IsFalse (ds2.HasErrors);
+ }
+ }
#endif
#endif
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlByteTest.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlByteTest.cs
index 8f94229a47..28a82f1ad1 100644
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlByteTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlByteTest.cs
@@ -38,9 +38,6 @@ using System.Xml;
using System.Data.SqlTypes;
using System.Threading;
using System.Globalization;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
namespace MonoTests.System.Data.SqlTypes
{
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt16Test.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt16Test.cs
index 0df3b9d3aa..ee3817830d 100644
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt16Test.cs
+++ b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt16Test.cs
@@ -35,9 +35,6 @@ using NUnit.Framework;
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
using System.IO;
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt64Test.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt64Test.cs
index 0492fd708c..37b186347a 100644
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt64Test.cs
+++ b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt64Test.cs
@@ -34,9 +34,6 @@
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlStringTest.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlStringTest.cs
index a1bf2f00f7..a8230d0310 100644
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlStringTest.cs
+++ b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlStringTest.cs
@@ -191,9 +191,6 @@ namespace MonoTests.System.Data.SqlTypes
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void CompareTo()
{
SqlByte Test = new SqlByte (1);
@@ -271,9 +268,6 @@ namespace MonoTests.System.Data.SqlTypes
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Greaters()
{
// GreateThan ()
@@ -288,9 +282,6 @@ namespace MonoTests.System.Data.SqlTypes
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Lessers()
{
// LessThan()
@@ -377,11 +368,7 @@ namespace MonoTests.System.Data.SqlTypes
byte test = Test1.GetUnicodeBytes () [105];
Assert.Fail ("#N05");
} catch (Exception e) {
-#if TARGET_JVM
- Assert.IsTrue (typeof (IndexOutOfRangeException).IsAssignableFrom(e.GetType()), "#N06");
-#else
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType(), "#N06");
-#endif
}
}
@@ -545,9 +532,6 @@ namespace MonoTests.System.Data.SqlTypes
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void ThanOrEqualOperators()
{
// == -operator
diff --git a/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs b/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs
index 36d82147cd..5eae92a396 100644
--- a/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs
@@ -132,9 +132,6 @@ public class BinarySerializationTest
dt.Rows[1].RejectChanges();
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataTableSerializationTest2 ()
{
//Serialize Table
@@ -274,9 +271,6 @@ public class BinarySerializationTest
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Test_With_Null_Values2 ()
{
//Serialize Table
@@ -454,9 +448,6 @@ public class BinarySerializationTest
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataSetSerializationTest2 ()
{
DataSet ds = new DataSet ();
@@ -653,9 +644,6 @@ public class BinarySerializationTest
Assert.AreEqual (ds.Relations [i].RelationName, ds.Relations [i].RelationName, "#9 Relation : {0} differs", ds.Relations [i]);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Constraint_Relations_Test2 ()
{
//Serialize DataSet
diff --git a/mcs/class/System.Data/Test/System.Data/DataColumnCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/DataColumnCollectionTest.cs
index 8b0b4a376d..b9eaac5322 100644
--- a/mcs/class/System.Data/Test/System.Data/DataColumnCollectionTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataColumnCollectionTest.cs
@@ -638,9 +638,6 @@ namespace MonoTests.System.Data
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest ()
{
DataTable Table = new DataTable ("test_table");
diff --git a/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest.cs
index f7e298569f..cc42664fca 100644
--- a/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataRowCollectionTest.cs
@@ -112,9 +112,7 @@ namespace MonoTests.System.Data
Assert.AreEqual (1, Rows.Count, "test#01");
Assert.IsFalse (Rows.IsReadOnly, "test#02");
Assert.IsFalse (Rows.IsSynchronized, "test#03");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRowCollection", Rows.ToString (), "test#04");
-#endif
string [] cols = new string [2];
cols [0] = "first";
@@ -126,9 +124,7 @@ namespace MonoTests.System.Data
Rows.Add (cols);
Assert.AreEqual (3, Rows.Count, "test#05");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRow", Rows [0].ToString (), "test#06");
-#endif
Assert.AreEqual (DBNull.Value, Rows [0] [0], "test#07");
Assert.AreEqual (DBNull.Value, Rows [0] [1], "test#08");
Assert.AreEqual ("first", Rows [1] [0], "test#09");
diff --git a/mcs/class/System.Data/Test/System.Data/DataTableCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/DataTableCollectionTest.cs
index e96ca5f7c5..05d0eddc7f 100644
--- a/mcs/class/System.Data/Test/System.Data/DataTableCollectionTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataTableCollectionTest.cs
@@ -348,9 +348,6 @@ namespace MonoTests.System.Data
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
DataTableCollection tbcol = _dataset[0].Tables;
diff --git a/mcs/class/System.Data/Test/System.Data/DataTableReadWriteXmlTest.cs b/mcs/class/System.Data/Test/System.Data/DataTableReadWriteXmlTest.cs
index a98713e2b8..13f46ad985 100644
--- a/mcs/class/System.Data/Test/System.Data/DataTableReadWriteXmlTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataTableReadWriteXmlTest.cs
@@ -295,9 +295,6 @@ namespace MonoTests.System.Data
}
[Test]
-#if TARGET_JVM
- [Ignore ("Should review the test")]
-#endif
public void TestReadXml()
{
// For reading, DataTable.ReadXml only supports reading in xml with
diff --git a/mcs/class/System.Data/Test/System.Data/DataTableTest.cs.REMOVED.git-id b/mcs/class/System.Data/Test/System.Data/DataTableTest.cs.REMOVED.git-id
index 0519ac8652..e67fcfd86f 100644
--- a/mcs/class/System.Data/Test/System.Data/DataTableTest.cs.REMOVED.git-id
+++ b/mcs/class/System.Data/Test/System.Data/DataTableTest.cs.REMOVED.git-id
@@ -1 +1 @@
-d752df4f1ac2c291267ff18e0a7ff3f7c12aaaee
\ No newline at end of file
+86dd5e737e6ed2882418e50afc78df88bf0ae4b9
\ No newline at end of file
diff --git a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
index 045df6951b..ac68e08fbb 100644
--- a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
@@ -511,9 +511,6 @@ namespace MonoTests.System.Data
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")] // defect 5446
-#endif
public void Find_3 ()
{
dataView.Sort = "itemID, itemName";
diff --git a/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs b/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs
index aba9cdd34a..a633fe836e 100644
--- a/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.DirectoryServices.Protocols/Assembly/AssemblyInfo.cs
@@ -31,11 +31,9 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
diff --git a/mcs/class/System.DirectoryServices/Assembly/AssemblyInfo.cs b/mcs/class/System.DirectoryServices/Assembly/AssemblyInfo.cs
index 1c486ea8ab..eda06fb888 100644
--- a/mcs/class/System.DirectoryServices/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.DirectoryServices/Assembly/AssemblyInfo.cs
@@ -31,11 +31,9 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
diff --git a/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.exclude.sources b/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.exclude.sources
deleted file mode 100644
index 9ddbeb157e..0000000000
--- a/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.exclude.sources
+++ /dev/null
@@ -1,5 +0,0 @@
-System.DirectoryServices/DirectoryServicesPermission.cs
-System.DirectoryServices/DirectoryServicesPermissionAccess.cs
-System.DirectoryServices/DirectoryServicesPermissionAttribute.cs
-System.DirectoryServices/DirectoryServicesPermissionEntry.cs
-System.DirectoryServices/DirectoryServicesPermissionEntryCollection.cs
diff --git a/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.sources b/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.sources
deleted file mode 100644
index 9f02d9a674..0000000000
--- a/mcs/class/System.DirectoryServices/net_1_1_java_System.DirectoryServices.dll.sources
+++ /dev/null
@@ -1 +0,0 @@
-#include System.DirectoryServices.dll.sources
diff --git a/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs b/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs
index 8cddd927e9..115adf5d92 100644
--- a/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Drawing/Assembly/AssemblyInfo.cs
@@ -54,11 +54,9 @@ using System.Runtime.InteropServices;
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
diff --git a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfiguration.cs b/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfiguration.cs
deleted file mode 100644
index a62c270e93..0000000000
--- a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfiguration.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-using System.Collections;
-
-namespace Mainsoft.Drawing.Configuration
-{
- ///
- /// Summary description for ResolutionConfiguration.
- ///
- public class ResolutionConfiguration : IComparable
- {
- string _imageFormat = "";
-
- string _xResPath = "";
- string _yResPath = "";
- string _unitsTypePath = "";
-
- string _xResDefault = "";
- string _yResDefault = "";
- string _unitsTypeDefault = "";
-
- Hashtable _unitScale;
-
- public ResolutionConfiguration(
- string imageFormat,
- string xresPath, string yresPath, string unitsTypePath,
- string xresDefault, string yresDefault, string unitsTypeDefault,
- Hashtable unitScale)
- {
- _imageFormat = imageFormat;
-
- _xResPath = xresPath;
- _yResPath = yresPath;
- _unitsTypePath = unitsTypePath;
-
- _xResDefault = xresDefault;
- _yResDefault = yresDefault;
- _unitsTypeDefault = unitsTypeDefault;
-
- _unitScale = unitScale;
- }
-
- public string XResPath {
- get { return _xResPath; }
- }
- public string XResDefault {
- get { return _xResDefault; }
- }
- public string YResPath {
- get { return _yResPath; }
- }
- public string YResDefault {
- get { return _yResDefault; }
- }
- public string UnitsTypePath {
- get { return _unitsTypePath; }
- }
- public string UnitsTypeDefault {
- get { return _unitsTypeDefault; }
- }
- public string ImageFormat {
- get { return _imageFormat; }
- }
- public Hashtable UnitsScale {
- get { return _unitScale; }
- }
-
- #region IComparable Members
-
- public int CompareTo(object obj) {
- return _imageFormat.CompareTo(((ResolutionConfiguration)obj).ImageFormat);
- }
-
- #endregion
-
- }
-}
diff --git a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationCollection.cs b/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationCollection.cs
deleted file mode 100644
index 9dcbe40b8d..0000000000
--- a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationCollection.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.Collections;
-
-namespace Mainsoft.Drawing.Configuration {
- ///
- /// Summary description for MetadataConfigurationCollection.
- ///
- public class ResolutionConfigurationCollection : IEnumerable, ICollection {
-
- ArrayList _resolutionConfigurations;
-
- #region ctors
-
- internal ResolutionConfigurationCollection(ResolutionConfigurationCollection parent) {
- _resolutionConfigurations = new ArrayList();
-
- if (parent != null)
- _resolutionConfigurations.AddRange(parent);
- }
-
- #endregion
-
- #region methods
-
- internal void Add(ResolutionConfiguration value) {
- _resolutionConfigurations.Add(value);
- }
-
- internal void Sort() {
- _resolutionConfigurations.Sort();
- }
-
- #endregion
-
- #region props
-
- public ResolutionConfiguration this[int index] {
- get {
- return (ResolutionConfiguration)_resolutionConfigurations[index];
- }
- }
-
- public ResolutionConfiguration this[string ImageFormat] {
- get {
- for (int i=0; i < _resolutionConfigurations.Count; i++)
- if ( ((ResolutionConfiguration)_resolutionConfigurations[i]).ImageFormat == ImageFormat )
- return (ResolutionConfiguration)_resolutionConfigurations[i];
- return null;
- }
- }
-
- #endregion
-
- #region IEnumerable Members
-
- public IEnumerator GetEnumerator() {
- // TODO: Add ResolutionConfigurationCollection.GetEnumerator implementation
- return _resolutionConfigurations.GetEnumerator();
- }
-
- #endregion
-
- #region ICollection Members
-
- public bool IsSynchronized {
- get {
- // TODO: Add ResolutionConfigurationCollection.IsSynchronized getter implementation
- return _resolutionConfigurations.IsSynchronized;
- }
- }
-
- public int Count {
- get {
- // TODO: Add ResolutionConfigurationCollection.Count getter implementation
- return _resolutionConfigurations.Count;
- }
- }
-
- public void CopyTo(Array array, int index) {
- // TODO: Add ResolutionConfigurationCollection.CopyTo implementation
- _resolutionConfigurations.CopyTo(array, index);
- }
-
- public object SyncRoot {
- get {
- // TODO: Add ResolutionConfigurationCollection.SyncRoot getter implementation
- return _resolutionConfigurations.SyncRoot;
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationHandler.cs b/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationHandler.cs
deleted file mode 100644
index 18698ffcb8..0000000000
--- a/mcs/class/System.Drawing/Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationHandler.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-using System;
-using System.Collections;
-using System.Configuration;
-using System.Xml;
-
-
-namespace Mainsoft.Drawing.Configuration
-{
- ///
- /// Summary description for MetadataConfigurationHandler.
- ///
- public class ResolutionConfigurationHandler : IConfigurationSectionHandler
- {
- public ResolutionConfigurationHandler()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- public virtual object Create (object parent, object configContext, XmlNode section) {
-
- if (section.Attributes != null && section.Attributes.Count != 0)
- HandlersUtil.ThrowException ("Unrecognized attribute", section);
-
- ResolutionConfigurationCollection col =
- new ResolutionConfigurationCollection(parent as ResolutionConfigurationCollection);
-
- XmlNodeList imageFormats = section.ChildNodes;
- foreach (XmlNode child in imageFormats) {
-
- XmlNodeType ntype = child.NodeType;
- if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
- continue;
-
- if (ntype != XmlNodeType.Element)
- HandlersUtil.ThrowException ("Only elements allowed", child);
-
- string imageFormatName = HandlersUtil.ExtractAttributeValue ("name", child, false, false);
-
- string xResPath = HandlersUtil.ExtractNodeValue(child["xresolution"]);
- string yResPath = HandlersUtil.ExtractNodeValue(child["yresolution"]);
- string unitsType = HandlersUtil.ExtractNodeValue(child["unitstype"], false, true);
-
- string xResDefault = HandlersUtil.ExtractAttributeValue ("default", child["xresolution"]);
- string yResDefault = HandlersUtil.ExtractAttributeValue ("default", child["yresolution"]);
- string unitsTypeDefault = HandlersUtil.ExtractAttributeValue ("default", child["unitstype"], true);
-
- Hashtable unitScale = new Hashtable(3);
-
- XmlNodeList unitScaleNodes = child.SelectNodes("unitscale");
- foreach (XmlNode unitScaleNode in unitScaleNodes) {
- unitScale.Add(
- HandlersUtil.ExtractAttributeValue ("value", unitScaleNode),
- HandlersUtil.ExtractNodeValue(unitScaleNode) );
- }
-
- ResolutionConfiguration resConf = new ResolutionConfiguration(
- imageFormatName,
- xResPath, yResPath, unitsType,
- xResDefault, yResDefault, unitsTypeDefault,
- unitScale);
-
- col.Add(resConf);
- }
-
- col.Sort();
- return col;
- }
- }
-
- internal sealed class HandlersUtil {
- private HandlersUtil () {
- }
-
- static internal string ExtractNodeValue(XmlNode node, bool optional, bool allowEmpty) {
- if (node == null) {
- if (optional)
- return null;
- ThrowException ("Required node not found", node);
- }
-
- string nodeValue = node.InnerText;
-
- if (!allowEmpty && nodeValue == String.Empty) {
- string opt = optional ? "Optional" : "Required";
- ThrowException (opt + " node is empty", node);
- }
-
- return nodeValue;
- }
-
- static internal string ExtractNodeValue(XmlNode node, bool optional) {
- return ExtractNodeValue(node, false, false);
- }
-
- static internal string ExtractNodeValue(XmlNode node) {
- return ExtractNodeValue(node, false);
- }
-
- static internal string ExtractAttributeValue (string attKey, XmlNode node) {
- return ExtractAttributeValue (attKey, node, false);
- }
-
- static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional) {
- return ExtractAttributeValue (attKey, node, optional, false);
- }
-
- static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional,
- bool allowEmpty) {
- if (node.Attributes == null) {
- if (optional)
- return null;
-
- ThrowException ("Required attribute not found: " + attKey, node);
- }
-
- XmlNode att = node.Attributes.RemoveNamedItem (attKey);
- if (att == null) {
- if (optional)
- return null;
- ThrowException ("Required attribute not found: " + attKey, node);
- }
-
- string value = att.Value;
- if (!allowEmpty && value == String.Empty) {
- string opt = optional ? "Optional" : "Required";
- ThrowException (opt + " attribute is empty: " + attKey, node);
- }
-
- return value;
- }
-
- static internal void ThrowException (string msg, XmlNode node) {
- if (node != null && node.Name != String.Empty)
- msg = msg + " (node name: " + node.Name + ") ";
- throw new ConfigurationException (msg, node);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/Makefile b/mcs/class/System.Drawing/Makefile
index ceecdb8b16..fb59ad1056 100644
--- a/mcs/class/System.Drawing/Makefile
+++ b/mcs/class/System.Drawing/Makefile
@@ -13,13 +13,6 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.
-r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
-nowarn:0618 -nowarn:219 -nowarn:169 -nowarn:1595
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS += \
- -r:System.Xml.dll \
- -r:rt.dll \
- -r:J2SE.Helpers.dll
-endif
-
include ../../build/library.make
EXTRA_DISTFILES = Test/resources/indexed.png \
diff --git a/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditor.cs b/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditor.cs
index 978b957383..1f53a32fa9 100644
--- a/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditor.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditor.cs
@@ -86,7 +86,6 @@ namespace System.Drawing.Design
{
return false;
}
-#if !TARGET_JVM
public void PaintValue (object value, Graphics canvas, Rectangle rectangle)
{
PaintValue (new PaintValueEventArgs (null, value, canvas, rectangle));
@@ -99,7 +98,6 @@ namespace System.Drawing.Design
// but on the other hand the class is not abstract. Could never observe it did paint anything
return;
}
-#endif
#if NET_2_0
public virtual bool IsDropDownResizable {
get { return false; }
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.jvm.cs
deleted file mode 100644
index 62a59f88e6..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/AdjustableArrowCap.jvm.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Drawing.Drawing2D.AdjustableArrowCap.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Ravindra (rkumar@novell.com)
-//
-// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Drawing.Drawing2D
-{
- ///
- /// Summary description for AdjustableArrowCap.
- ///
- [MonoNotSupported ("")]
- public sealed class AdjustableArrowCap : CustomLineCap
- {
- // Constructors
-
- [MonoNotSupported ("")]
- public AdjustableArrowCap (float width, float height) : this (width, height, true)
- {
- }
-
- [MonoNotSupported ("")]
- public AdjustableArrowCap (float width, float height, bool isFilled)
- {
- throw new NotImplementedException();
- }
-
- // Public Properities
- [MonoTODO]
- public bool Filled {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float Width {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float Height {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float MiddleInset {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Blend.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Blend.cs
index a3cb2e9af5..7629ddc4ee 100644
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Blend.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Blend.cs
@@ -38,9 +38,6 @@ namespace System.Drawing.Drawing2D
///
/// Summary description for Blend.
///
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class Blend
{
private float [] positions;
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.jvm.cs
deleted file mode 100644
index 099fce0ad3..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/CustomLineCap.jvm.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// System.Drawing.Drawing2D.CustomLineCap.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Ravindra (rkumar@novell.com)
-//
-// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Drawing.Drawing2D
-{
- ///
- /// Summary description for CustomLineCap.
- ///
- [MonoNotSupported ("")]
- public class CustomLineCap : MarshalByRefObject, ICloneable
- {
- private bool disposed;
-
- // Constructors
-
- internal CustomLineCap () { }
-
- [MonoNotSupported ("")]
- public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath) : this (fillPath, strokePath, LineCap.Flat, 0)
- {
- }
-
- [MonoNotSupported ("")]
- public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap) : this (fillPath, strokePath, baseCap, 0)
- {
- }
-
- [MonoNotSupported ("")]
- public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public LineCap BaseCap {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public LineJoin StrokeJoin {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float BaseInset {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float WidthScale {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- // Public Methods
- [MonoTODO]
- public virtual object Clone ()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void GetStrokeCaps (out LineCap startCap, out LineCap endCap)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void SetStrokeCaps(LineCap startCap, LineCap endCap)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ExtendedGeneralPath.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ExtendedGeneralPath.jvm.cs
deleted file mode 100644
index 0b777b6f45..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ExtendedGeneralPath.jvm.cs
+++ /dev/null
@@ -1,700 +0,0 @@
-//
-// System.Drawing.Drawing2D.ExtendedGeneralPath.cs
-//
-// Author:
-// Bors Kirzner
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using java.awt;
-using java.awt.geom;
-using java.lang;
-
-namespace System.Drawing.Drawing2D
-{
- internal class ExtendedGeneralPath : Shape, ICloneable
- {
- #region Fields
-
- public const int WIND_EVEN_ODD = 0; //PathIterator__Finals.WIND_EVEN_ODD;
- public const int WIND_NON_ZERO = 1; //PathIterator__Finals.WIND_NON_ZERO;
-
- public const sbyte SEG_MOVETO = 0; //(byte) PathIterator__Finals.SEG_MOVETO;
- public const sbyte SEG_LINETO = 1; //(byte) PathIterator__Finals.SEG_LINETO;
- public const sbyte SEG_QUADTO = 2; //(byte) PathIterator__Finals.SEG_QUADTO;
- public const sbyte SEG_CUBICTO = 3; //(byte) PathIterator__Finals.SEG_CUBICTO;
- public const sbyte SEG_CLOSE = 4; //(byte) PathIterator__Finals.SEG_CLOSE;
-
- public const sbyte SEG_START = 16; // segment start
-
- public const sbyte SEG_MASK = SEG_MOVETO | SEG_LINETO | SEG_QUADTO | SEG_CUBICTO | SEG_CLOSE; // mask to eliminate SEG_CLOSE and SEG_MARKER
-
- private const sbyte SEG_MARKER = 32; // path marker
-
-
- private sbyte [] _types;
- private float [] _coords;
- private int _typesCount;
- private int _coordsCount;
- private int _windingRule;
-
- private PathData _pathData;
- private GeneralPath _generalPath;
-
- const int INIT_SIZE = 20;
- const int EXPAND_MAX = 500;
-
- #endregion // Fileds
-
- #region Constructors
-
- public ExtendedGeneralPath() : this (WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)
- {
- }
-
- public ExtendedGeneralPath(int rule) : this (rule, INIT_SIZE, INIT_SIZE)
- {
- }
-
- public ExtendedGeneralPath(int rule, int initialCapacity) : this (rule, initialCapacity, initialCapacity)
- {
- }
-
- public ExtendedGeneralPath(Shape s) : this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)
- {
- PathIterator pi = s.getPathIterator (null);
- setWindingRule (pi.getWindingRule ());
- append (pi, false);
- }
-
- private ExtendedGeneralPath(int rule, int initialTypes, int initialCoords)
- {
- setWindingRule(rule);
- Reset (initialTypes, initialCoords);
- }
-
- #endregion // Constructors
-
- #region Properties
-
- private GeneralPath GeneralPath
- {
- get {
- if (_generalPath == null) {
- _generalPath = GetGeneralPath ();
- }
- return _generalPath;
- }
- }
-
- public sbyte [] Types
- {
- get { return _types; }
- }
-
- public float [] Coords
- {
- get { return _coords; }
- }
-
- public int TypesCount
- {
- get { return _typesCount; }
- }
-
- public int CoordsCount
- {
- get { return _coordsCount; }
- }
-
- public bool LastFigureClosed
- {
- get {
- return ((TypesCount == 0) ||
- ((Types [TypesCount - 1] & ExtendedGeneralPath.SEG_CLOSE) != 0) ||
- ((Types [TypesCount - 1] & ExtendedGeneralPath.SEG_START) != 0));
- }
- }
-
- public int PointCount
- {
- get {
- return CoordsCount / 2;
- }
- }
-
- public PathData PathData
- {
- get
- {
- if (_pathData == null)
- _pathData = GetPathData ();
-
- return _pathData;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- #region CachedData
-
- private void ClearCache ()
- {
- _pathData = null;
- _generalPath = null;
- }
-
- private GeneralPath GetGeneralPath ()
- {
- PathIterator iter = getPathIterator (null);
- GeneralPath path = new GeneralPath ();
- path.append (iter, false);
- return path;
- }
-
- private PathData GetPathData ()
- {
- PathData pathData = new PathData();
- int nPts = PointCount;
- for (int i = 0; i < TypesCount; i++)
- if ((Types [i] & SEG_MASK) == SEG_QUADTO)
- nPts++;
-
- pathData.Types = new byte [nPts];
- pathData.Points = new PointF [nPts];
- int tpos = 0;
- int ppos = 0;
- int cpos = 0;
- byte marker;
- bool start;
- for (int i = 0; i < TypesCount; i++) {
- sbyte segmentType = (sbyte)(Types [i] & SEG_MASK);
-
- // set the masks and the markers
- marker = ((Types [i] & SEG_MARKER) != 0) ? (byte)PathPointType.PathMarker : (byte)0;
- start = ((Types [i] & SEG_START) != 0);
-
- switch (segmentType) {
- case SEG_CLOSE:
- pathData.Types [tpos - 1] = (byte) (pathData.Types [tpos - 1] | (byte) PathPointType.CloseSubpath | marker);
- break;
- case SEG_MOVETO:
- pathData.Types [tpos++] = (byte)((byte) PathPointType.Start | marker);
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);
- break;
- case SEG_LINETO:
- pathData.Types [tpos++] = (byte) ((byte) PathPointType.Line | marker);
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);
- break;
- case SEG_QUADTO:
- /*
- .net does not support Quadratic curves, so convert to Cubic according to http://pfaedit.sourceforge.net/bezier.html
-
- The end points of the cubic will be the same as the quadratic's.
- CP0 = QP0
- CP3 = QP2
-
- The two control points for the cubic are:
-
- CP1 = QP0 + 2/3 *(QP1-QP0)
- CP2 = CP1 + 1/3 *(QP2-QP0)
- */
-
- float x0 = Coords[cpos-2]; //QP0
- float y0 = Coords[cpos-1]; //QP0
-
- float x1 = x0 + (2/3 * (Coords [cpos++]-x0));
- float y1 = y0 + (2/3 * (Coords [cpos++]-y0));
-
- float x3 = Coords [cpos++]; //QP2
- float y3 = Coords [cpos++]; //QP2
-
- float x2 = x1 + (1/3 * (x3-x0));
- float y2 = y1 + (1/3 * (y3-y0));
-
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier;
- pathData.Points [ppos++] = new PointF (x1, y1);
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier;
- pathData.Points [ppos++] = new PointF (x2, y2);
- pathData.Types [tpos++] = (byte) ((byte)PathPointType.Bezier | marker);
- pathData.Points [ppos++] = new PointF (x3, y3);
- break;
- case SEG_CUBICTO:
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier3;
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);
- pathData.Types [tpos++] = (byte) PathPointType.Bezier3;
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);
- pathData.Types [tpos++] = (byte) ((byte)PathPointType.Bezier3 | marker);
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);
- break;
- }
- }
- return pathData;
- }
-
- #endregion // CachedData
-
- public void append(Shape s)
- {
- append (s, !LastFigureClosed);
- }
-
- #region GeneralPath
-
- public void append(PathIterator pi, bool connect)
- {
- ClearCache ();
- float [] coords = new float [6];
- while (!pi.isDone ()) {
- switch (pi.currentSegment (coords)) {
- case SEG_MOVETO:
- if (!connect || _typesCount < 1 || _coordsCount < 2) {
- moveTo (coords [0], coords [1]);
- break;
- }
- if (_types [_typesCount - 1] != SEG_CLOSE &&
- _coords [_coordsCount - 2] == coords [0] &&
- _coords [_coordsCount - 1] == coords [1])
- break;
- goto case SEG_LINETO;
- case SEG_LINETO:
- lineTo (coords [0], coords [1]);
- break;
- case SEG_QUADTO:
- quadTo (coords [0], coords [1], coords [2], coords [3]);
- break;
- case SEG_CUBICTO:
- curveTo (coords [0], coords [1], coords [2], coords [3], coords [4], coords [5]);
- break;
- case SEG_CLOSE:
- closePath ();
- break;
- }
- pi.next ();
- connect = false;
- }
- }
-
- public void append(Shape s, bool connect)
- {
- PathIterator pi = s.getPathIterator (null);
- append (pi,connect);
- }
-
- public object Clone()
- {
- ExtendedGeneralPath copy = (ExtendedGeneralPath)MemberwiseClone ();
- copy._types = (sbyte []) _types.Clone ();
- copy._coords = (float []) _coords.Clone ();
- return copy;
- }
-
- public void closePath()
- {
- ClearCache ();
- if (_typesCount == 0 || _types[_typesCount - 1] != SEG_CLOSE) {
- needRoom (1, 0, true);
- _types [_typesCount++] = SEG_CLOSE;
- }
- }
-
- public bool contains(double x, double y)
- {
- return GeneralPath.contains (x, y);
- }
-
- public bool contains(double x, double y, double w, double h)
- {
- return GeneralPath.contains (x, y, w, h);
- }
-
- public bool contains(Point2D p)
- {
- return contains (p.getX (), p.getY ());
- }
-
- public bool contains(Rectangle2D r)
- {
- return contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
- }
-
- public Shape createTransformedShape(AffineTransform at)
- {
- ExtendedGeneralPath gp = (ExtendedGeneralPath) Clone ();
- if (at != null) {
- gp.transform (at);
- }
- return gp;
- }
-
- public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
- {
- ClearCache ();
- needRoom (1, 6, true);
- _types [_typesCount++] = SEG_CUBICTO;
- _coords [_coordsCount++] = x1;
- _coords [_coordsCount++] = y1;
- _coords [_coordsCount++] = x2;
- _coords [_coordsCount++] = y2;
- _coords [_coordsCount++] = x3;
- _coords [_coordsCount++] = y3;
- }
-
- public java.awt.Rectangle getBounds()
- {
- return getBounds2D ().getBounds ();
- }
-
- public Rectangle2D getBounds2D()
- {
- float x1, y1, x2, y2;
- int i = _coordsCount;
- if (i > 0) {
- y1 = y2 = _coords [--i];
- x1 = x2 = _coords [--i];
- while (i > 0) {
- float y = _coords [--i];
- float x = _coords [--i];
- if (x < x1) x1 = x;
- if (y < y1) y1 = y;
- if (x > x2) x2 = x;
- if (y > y2) y2 = y;
- }
- }
- else {
- x1 = y1 = x2 = y2 = 0f;
- }
- return new Rectangle2D.Float (x1, y1, x2 - x1, y2 - y1);
- }
-
- public Point2D getCurrentPoint()
- {
- if (_typesCount < 1 || _coordsCount < 2)
- return null;
-
- int index = _coordsCount;
- if (_types [_typesCount - 1] == SEG_CLOSE)
- for (int i = _typesCount - 2; i > 0; i--) {
- switch (_types [i]) {
- case SEG_MOVETO:
- //break loop;
- goto loopend;
- case SEG_LINETO:
- index -= 2;
- break;
- case SEG_QUADTO:
- index -= 4;
- break;
- case SEG_CUBICTO:
- index -= 6;
- break;
- case SEG_CLOSE:
- break;
- }
- }
- loopend:
-
- return new Point2D.Float (_coords [index - 2], _coords [index - 1]);
- }
-
- public PathIterator getPathIterator(AffineTransform at) {
- return new GeneralPathIterator (this, at);
- }
-
- public PathIterator getPathIterator(AffineTransform at, double flatness) {
- return new FlatteningPathIterator (getPathIterator (at), flatness);
- }
-
- public int getWindingRule()
- {
- return _windingRule;
- }
-
- public bool intersects(double x, double y, double w, double h)
- {
- return GeneralPath.intersects (x, y, w, h);
- }
-
- public bool intersects(Rectangle2D r)
- {
- return intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
- }
-
- public void lineTo(float x, float y)
- {
- ClearCache ();
- needRoom (1, 2, true);
- _types [_typesCount++] = SEG_LINETO;
- _coords [_coordsCount++] = x;
- _coords [_coordsCount++] = y;
- }
-
- public void moveTo(float x, float y)
- {
- ClearCache ();
- if (_typesCount > 0 && _types [_typesCount - 1] == SEG_MOVETO) {
- _coords [_coordsCount - 2] = x;
- _coords [_coordsCount - 1] = y;
- }
- else {
- needRoom (1, 2, false);
- _types [_typesCount++] = SEG_MOVETO;
- _coords [_coordsCount++] = x;
- _coords [_coordsCount++] = y;
- }
- }
-
- public void quadTo(float x1, float y1, float x2, float y2)
- {
- // restore quadTo as cubic affects quality
- ClearCache ();
- needRoom (1, 4, true);
- _types [_typesCount++] = SEG_QUADTO;
- _coords [_coordsCount++] = x1;
- _coords [_coordsCount++] = y1;
- _coords [_coordsCount++] = x2;
- _coords [_coordsCount++] = y2;
- }
-
- public void reset()
- {
- ClearCache ();
- _typesCount = 0;
- _coordsCount = 0;
- }
-
- public void setWindingRule(int rule)
- {
- if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {
- throw new IllegalArgumentException ("winding rule must be WIND_EVEN_ODD or WIND_NON_ZERO");
- }
- _windingRule = rule;
- }
-
- public void transform(AffineTransform at)
- {
- transform(at, 0, CoordsCount);
- }
-
- public void transform(AffineTransform at, int startCoord, int numCoords) {
- ClearCache ();
- at.transform (_coords, startCoord, _coords, startCoord, numCoords/2);
- }
-
- private void needRoom(int newTypes, int newCoords, bool needMove)
- {
- if (needMove && _typesCount == 0)
- throw new IllegalPathStateException ("missing initial moveto in path definition");
-
- int size = _coords.Length;
- if (_coordsCount + newCoords > size) {
- int grow = size;
- if (grow > EXPAND_MAX * 2)
- grow = EXPAND_MAX * 2;
-
- if (grow < newCoords)
- grow = newCoords;
-
- float [] arr = new float [size + grow];
- Array.Copy (_coords, 0, arr, 0, _coordsCount);
- _coords = arr;
- }
- size = _types.Length;
- if (_typesCount + newTypes > size) {
- int grow = size;
- if (grow > EXPAND_MAX)
- grow = EXPAND_MAX;
-
- if (grow < newTypes)
- grow = newTypes;
-
- sbyte [] arr = new sbyte [size + grow];
- Array.Copy (_types, 0, arr, 0, _typesCount);
- _types = arr;
- }
- }
-
- #endregion // GeneralPath
-
- public void SetMarkers()
- {
- ClearCache ();
- if (TypesCount > 0)
- Types [ TypesCount - 1] |= SEG_MARKER;
- }
-
- public void ClearMarkers()
- {
- ClearCache ();
- for (int i = 0; i < TypesCount; i++)
- Types [i] &= ~SEG_MARKER;
- }
-
- public void StartFigure ()
- {
- ClearCache ();
- if (TypesCount > 0)
- Types [TypesCount - 1] |= ExtendedGeneralPath.SEG_START;
- }
-
- private void Reset (int initialTypes, int initialCoords)
- {
- ClearCache ();
- _types = new sbyte [initialTypes];
- _coords = new float [initialCoords * 2];
- _typesCount = 0;
- _coordsCount = 0;
- }
-
- internal void Clear ()
- {
- Reset (INIT_SIZE, INIT_SIZE);
- }
-
- internal void Reverse ()
- {
- ClearCache ();
- // revert coordinates
- for (int i=0, max = CoordsCount / 2; i < max;) {
- int ix = i++;
- int iy = i++;
- int rix = CoordsCount - i;
- int riy = rix + 1;
- float tmpx = Coords [ix];
- float tmpy = Coords [iy];
- Coords [ix] = Coords [rix];
- Coords [iy] = Coords [riy];
- Coords [rix] = tmpx;
- Coords [riy] = tmpy;
- }
-
- // revert types
- sbyte [] newTypes = new sbyte [TypesCount];
- int oldIdx = 0;
- int newIdx = TypesCount - 1;
- int copyStart;
- int copyEnd;
- sbyte mask1 = 0;
- sbyte mask2 = 0;
- sbyte closeMask = 0;
- bool closedFigure = false;
-
- while (oldIdx < TypesCount) {
- // start copying after moveto
- copyStart = ++oldIdx;
- // continue to the next figure start
- while ((Types [oldIdx] != SEG_MOVETO) && (oldIdx < TypesCount))
- oldIdx++;
-
- copyEnd = oldIdx - 1;
- // check whenever current figure is closed
- if ((Types [oldIdx - 1] & SEG_CLOSE) != 0) {
- closedFigure = true;
- // close figure
- newTypes [newIdx--] = (sbyte)(SEG_CLOSE | mask1);
- mask1 = 0;
- mask2 = 0;
- // end copy one cell earlier
- copyEnd--;
- closeMask = (sbyte)(Types [oldIdx - 1] & (sbyte)SEG_MARKER);
- }
- else {
- mask2 = mask1;
- mask1 = 0;
- }
-
- // copy reverted "inner" types
- for(int i = copyStart; i <= copyEnd; i++) {
- newTypes [newIdx--] = (sbyte)((Types [i] & SEG_MASK) | mask2);
- mask2 = mask1;
- mask1 = (sbyte)(Types [i] & (sbyte)SEG_MARKER);
- }
-
- // copy moveto
- newTypes [newIdx--] = SEG_MOVETO;
-
- // pass close mask to the nex figure
- if (closedFigure) {
- mask1 = closeMask;
- closedFigure = false;
- }
- }
-
- _types = newTypes;
- }
-
- public PointF GetLastPoint ()
- {
- if (CoordsCount == 0)
- throw new System.ArgumentException ("Invalid parameter used.");
-
- return new PointF (Coords [CoordsCount - 2], Coords [CoordsCount - 1]);
- }
-
- #endregion //Methods
-
- #region Private helpers
-
-#if DEBUG
- private void Print()
- {
- Console.WriteLine ("\n\n");
- float [] fpoints = _coords;
- int cpos = 0;
- for (int i=0; i < _typesCount; i++) {
- sbyte type = _types [i];
- string marker = String.Empty;
- if ((type & SEG_MARKER) != 0)
- marker = " | MARKER";
-
- switch (type & SEG_MASK) {
- case SEG_CLOSE:
- Console.WriteLine ("CLOSE {0}",marker);
- break;
- case SEG_MOVETO:
- Console.WriteLine("{0}{3} ({1},{2})","MOVETO", fpoints[cpos++], fpoints[cpos++], marker);
- break;
- case SEG_LINETO:
- Console.WriteLine("{0}{3} ({1},{2})","LINETO", fpoints[cpos++], fpoints[cpos++], marker);
- break;
- case SEG_QUADTO:
- Console.WriteLine("{0}{3} ({1},{2})","QUADTO", fpoints[cpos++], fpoints[cpos++], marker);
- Console.WriteLine(" ({1},{2})","QUADTO", fpoints[cpos++], fpoints[cpos++]);
- break;
- case SEG_CUBICTO:
- Console.WriteLine("{0}{3} ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++], marker);
- Console.WriteLine(" ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++]);
- Console.WriteLine(" ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++]);
- break;
- }
- }
- }
-#endif
- #endregion // Private helpers
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GeneralPathIterator.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GeneralPathIterator.jvm.cs
deleted file mode 100644
index 1cfa230a4e..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GeneralPathIterator.jvm.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Drawing.Drawing2D.GeneralPathIterator.cs
-//
-// Author:
-// Bors Kirzner
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using java.awt.geom;
-
-namespace System.Drawing.Drawing2D
-{
- internal class GeneralPathIterator : PathIterator
- {
- #region Fields
-
- int typeIdx = 0;
- int pointIdx = 0;
- ExtendedGeneralPath _path;
- AffineTransform _affine;
-
- private static readonly int [] curvesize = {2, 2, 4, 6, 0};
-
- #endregion // Fileds
-
- #region Constructors
-
- public GeneralPathIterator(ExtendedGeneralPath _path) : this (_path, null)
- {
- }
-
- public GeneralPathIterator(ExtendedGeneralPath _path, AffineTransform at)
- {
- this._path = _path;
- this._affine = at;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public int getWindingRule()
- {
- return _path.getWindingRule ();
- }
-
- public bool isDone()
- {
- return (typeIdx >= _path.TypesCount);
- }
-
- public void next()
- {
- int type = _path.Types [typeIdx++] & ExtendedGeneralPath.SEG_MASK;
- pointIdx += curvesize [type];
- }
-
- public int currentSegment(float [] coords) {
- int type = _path.Types [typeIdx] & ExtendedGeneralPath.SEG_MASK;
- int numCoords = curvesize [type];
- if (numCoords > 0 && _affine != null)
- _affine.transform (_path.Coords, pointIdx, coords, 0, numCoords/2);
- else
- Array.Copy (_path.Coords, pointIdx, coords, 0, numCoords);
- return type;
- }
-
- public int currentSegment(double [] coords)
- {
- int type = _path.Types [typeIdx] & ExtendedGeneralPath.SEG_MASK;
- int numCoords = curvesize [type];
- if (numCoords > 0 && _affine != null)
- _affine.transform (_path.Coords, pointIdx, coords, 0, numCoords/2);
- else
- for (int i=0; i < numCoords; i++)
- coords [i] = _path.Coords [pointIdx + i];
-
- return type;
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs
deleted file mode 100644
index e763dcb098..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs
+++ /dev/null
@@ -1,1082 +0,0 @@
-//
-// System.Drawing.Drawing2D.GraphicsPath.cs
-//
-// Author:
-// Konstantin Triger
-// Bors Kirzner
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing;
-using System.Drawing.Text;
-using System.Collections;
-using java.awt.geom;
-using java.awt;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class GraphicsPath : BasicShape, ICloneable
- {
- internal enum JPI {
- SEG_MOVETO = ExtendedGeneralPath.SEG_MOVETO,
- SEG_LINETO = ExtendedGeneralPath.SEG_LINETO,
- SEG_QUADTO = ExtendedGeneralPath.SEG_QUADTO,
- SEG_CUBICTO = ExtendedGeneralPath.SEG_CUBICTO,
- SEG_CLOSE = ExtendedGeneralPath.SEG_CLOSE
- }
-
- #region Internal
-
- internal ExtendedGeneralPath NativeObject
- {
- get
- {
- return (ExtendedGeneralPath)Shape;
- }
- }
-
- GraphicsPath (ExtendedGeneralPath ptr) : base(ptr)
- {
- }
- #endregion
-
- #region C-tors.
- public GraphicsPath ():
- this(FillMode.Alternate)
- {
- }
-
- public GraphicsPath (FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- }
-
- public GraphicsPath (Point[] pts, byte[] types) : this(pts, types, FillMode.Alternate)
- {
- }
-
- public GraphicsPath (PointF [] pts, byte [] types) : this(pts, types, FillMode.Alternate)
- {
- }
-
- public GraphicsPath (Point [] pts, byte [] types, FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- SetPath (pts, types);
- }
-
- public GraphicsPath (PointF [] pts, byte [] types, FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- SetPath (pts, types);
- }
-
- #endregion
-
- #region Clone
- public object Clone ()
- {
- return new GraphicsPath ((ExtendedGeneralPath) NativeObject.Clone ());
- }
- #endregion
-
- #region Properties
- public FillMode FillMode
- {
- get
- { if(NativeObject.getWindingRule() == GeneralPath.WIND_EVEN_ODD)
- return FillMode.Alternate;
- else
- return FillMode.Winding;
- }
-
- set
- {
- if (value == FillMode.Alternate)
- NativeObject.setWindingRule (GeneralPath.WIND_EVEN_ODD);
- else
- NativeObject.setWindingRule (GeneralPath.WIND_NON_ZERO);
- }
- }
-
- public PathData PathData
- {
- get { return NativeObject.PathData; }
- }
-
- public PointF [] PathPoints
- {
- get
- {
- return PathData.Points;
- }
- }
-
- public byte [] PathTypes
- {
- get
- {
- return PathData.Types;
- }
- }
- #endregion
-
- #region PointCount
- public int PointCount
- {
- get
- {
- return NativeObject.PointCount;
- }
- }
- #endregion
-
- #region AddArc
- public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
- {
- AddArc(rect.X,rect.Y,rect.Width,rect.Height,startAngle,sweepAngle);
- }
-
- public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
- {
- AddArc(rect.X,rect.Y,rect.Width,rect.Height,startAngle,sweepAngle);
- }
-
- public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
- {
- AddArc((float)x,(float)y,(float)width,(float)height,startAngle,sweepAngle);
- }
-
- public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- Shape shape = null;
-
- if (sweepAngle >= 360)
- shape = new Ellipse2D.Float(x, y, width, height);
- else {
-
- double d1Tod2 = width/height;
- double sqrd1Tod2 = d1Tod2*d1Tod2;
- double start = ConvertArcAngle(sqrd1Tod2, startAngle);
- double extent = ConvertArcAngle(sqrd1Tod2, startAngle+sweepAngle) - start;
-
- shape = new Arc2D.Double(x,y,width,height,-start,-extent,Arc2D.OPEN);
- }
-
- NativeObject.append(shape);
- }
-
- ///
- /// .Net computes an angle by intersection of ellipse with a ray
- /// java does the following: x1 = d1*cos(a), y1 = d2*sin(a)
- /// where: d1 = width/2, d2 = height/2
- /// we need to find angle x, which satisfies:
- /// x1 = m*cos(a) = d1*cos(x)
- /// y1 = m*sin(a) = d2*sin(x)
- /// (x1*x1)/(d1*d1) + (x2*x2)/(d2*d2) = 1
- ///
- /// (d1/d2)*(d1/d2)
- /// angle in degrees
- /// converted angle in degrees
- static double ConvertArcAngle(double sqrd1Tod2, double angle) {
- double angleRad = java.lang.Math.toRadians(angle);
- double tan = Math.Tan(angleRad);
- double cosx = 1/Math.Sqrt( sqrd1Tod2 * (tan*tan) + 1);
- double xRad = Math.Acos(cosx);
- double x = java.lang.Math.toDegrees(xRad);
- int q = (Math.Abs((int)angle))/90;
-
- switch (q&3) {
- case 1:
- x = 180-x;
- break;
- case 2:
- x = 180+x;
- break;
- case 3:
- x = 360-x;
- break;
- }
-
- if (angle < 0)
- x = -x;
-
- x += (((int)angle)/360)*360;
-
- return x;
- }
-
- #endregion
-
- #region AddBezier(s)
- public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
- {
- AddBezier(pt1.X,pt1.Y,pt2.X,pt2.Y,pt3.X,pt3.Y,pt4.X,pt4.Y);
- }
-
- public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
- {
- AddBezier(pt1.X,pt1.Y,pt2.X,pt2.Y,pt3.X,pt3.Y,pt4.X,pt4.Y);
- }
-
- public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
- {
- AddBezier((float)x1,(float)y1,(float)x2,(float)y2,(float)x3,(float)y3,(float)x4,(float)y4);
- }
-
- public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
- {
- CubicCurve2D cc = new CubicCurve2D.Float(x1,y1,x2,y2,x3,y3,x4,y4);
- NativeObject.append(cc);
- }
-
- public void AddBeziers (Point [] pts)
- {
- if (pts == null)
- throw new ArgumentNullException("points");
-
- AddBezier(pts [0].X,pts [0].Y,
- pts [1].X,pts [1].Y,
- pts [2].X,pts [2].Y,
- pts [3].X,pts [3].Y);
-
- for (int i = 4; i < pts.Length; i += 3) {
- NativeObject.curveTo(
- pts [i].X,pts [i].Y,
- pts [i+1].X,pts [i+1].Y,
- pts [i+2].X,pts [i+2].Y);
- }
- }
-
- public void AddBeziers (PointF [] pts)
- {
- if (pts == null)
- throw new ArgumentNullException("points");
-
- AddBezier(pts [0].X,pts [0].Y,
- pts [1].X,pts [1].Y,
- pts [2].X,pts [2].Y,
- pts [3].X,pts [3].Y);
-
- for (int i = 4; i < pts.Length; i += 3) {
- NativeObject.curveTo(
- pts [i].X,pts [i].Y,
- pts [i+1].X,pts [i+1].Y,
- pts [i+2].X,pts [i+2].Y);
- }
- }
- #endregion
-
- #region AddEllipse
- public void AddEllipse (float x, float y, float width, float height)
- {
- Ellipse2D e = new Ellipse2D.Float(x,y,width,height);
- NativeObject.append(e,false);
- }
-
- public void AddEllipse (RectangleF r)
- {
- AddEllipse(r.X,r.Y,r.Width,r.Height);
- }
-
- public void AddEllipse (Rectangle r)
- {
- AddEllipse(r.X,r.Y,r.Width,r.Height);
- }
-
- public void AddEllipse (int x, int y, int width, int height)
- {
- AddEllipse((float)x, (float)y, (float)width, (float)height);
- }
- #endregion
-
- #region AddLine
- public void AddLine (float x1, float y1, float x2, float y2)
- {
- Line2D l = new Line2D.Float(x1,y1,x2,y2);
- NativeObject.append(l);
- }
-
- public void AddLine (Point a, Point b)
- {
- AddLine(a.X,a.Y,b.X,b.Y);
- }
-
- public void AddLine (PointF a, PointF b)
- {
- AddLine(a.X,a.Y,b.X,b.Y);
- }
-
- public void AddLine (int x1, int y1, int x2, int y2)
- {
- AddLine((float)x1,(float)y1,(float)x2,(float)y2);
- }
-
- public void AddLines (Point [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length == 0)
- return;
-
- if (NativeObject.LastFigureClosed)
- NativeObject.moveTo(points[0].X, points[0].Y);
- else
- NativeObject.lineTo(points[0].X, points[0].Y);
-
- for (int i = 1; i < points.Length; i ++)
- NativeObject.lineTo(points[i].X, points[i].Y);
- }
-
- public void AddLines (PointF [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length == 0)
- return;
-
- if (NativeObject.LastFigureClosed)
- NativeObject.moveTo(points[0].X, points[0].Y);
- else
- NativeObject.lineTo(points[0].X, points[0].Y);
-
- for (int i = 1; i < points.Length; i ++)
- NativeObject.lineTo(points[i].X, points[i].Y);
- }
- #endregion
-
- #region AddPie
- public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- Shape shape = null;
-
- if (sweepAngle >= 360)
- shape = new Ellipse2D.Float(x, y, width, height);
- else {
-
- double d1Tod2 = width/height;
- double sqrd1Tod2 = d1Tod2*d1Tod2;
- double start = ConvertArcAngle(sqrd1Tod2, startAngle);
- double extent = ConvertArcAngle(sqrd1Tod2, startAngle+sweepAngle) - start;
-
- shape = new Arc2D.Double(x,y,width,height,-start,-extent,Arc2D.PIE);
- }
-
- NativeObject.append(shape,false);
- }
-
- public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
- {
- AddPie((float)rect.X, (float)rect.Y,(float)rect.Width,(float)rect.Height,startAngle,sweepAngle);
- }
-
- public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
- {
- AddPie((float)x,(float)y,(float)width,(float)height,startAngle,sweepAngle);
- }
- #endregion
-
- #region AddPolygon
- public void AddPolygon (Point [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- NativeObject.moveTo((float)points[0].X,(float)points[0].Y);
- for (int i = 1; i< points.Length; i++)
- {
- NativeObject.lineTo((float)points[i].X,(float)points[i].Y);
- }
- NativeObject.closePath();
- }
-
- public void AddPolygon (PointF [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- NativeObject.moveTo(points[0].X,points[0].Y);
- for (int i = 1; i < points.Length; i++)
- {
- NativeObject.lineTo(points[i].X,points[i].Y);
- }
- NativeObject.closePath();
- }
- #endregion
-
- #region AddRectangle(s)
- internal void AddRectangle(float x,float y, float w, float h)
- {
- NativeObject.moveTo(x, y);
- NativeObject.lineTo (x + w, y);
- NativeObject.lineTo (x + w, y + h);
- NativeObject.lineTo (x, y + h);
- NativeObject.closePath ();
- }
- public void AddRectangle (RectangleF rect)
- {
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangle (Rectangle rect)
- {
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangles (Rectangle [] rects)
- {
- foreach(Rectangle rect in rects)
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangles (RectangleF [] rects)
- {
- foreach(RectangleF rect in rects)
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
- #endregion
-
- #region AddPath
- public void AddPath (GraphicsPath addingPath, bool connect)
- {
- if (NativeObject.LastFigureClosed || addingPath.NativeObject.LastFigureClosed)
- connect = false;
-
- NativeObject.append(addingPath.NativeObject,connect);
- }
- #endregion
-
- #region GetLastPoint
- public PointF GetLastPoint ()
- {
- return NativeObject.GetLastPoint ();
- }
- #endregion
-
- #region Reset
- public void Reset ()
- {
- NativeObject.reset();
- }
- #endregion
-
- #region GetBounds
- public RectangleF GetBounds ()
- {
- return GetBounds (null, null);
- }
-
- public RectangleF GetBounds (Matrix matrix)
- {
- return GetBounds (matrix, null);
- }
-
- public RectangleF GetBounds (Matrix matrix, Pen pen)
- {
- // FIXME : we do not know exacly how the bounding rectangle
- // is calculated so this implementation obtains different bounds
- // that still contains the path widened by oen and transformed by matrix
- // the order of operations is similar to widening, as .Net does.
-
- // first get original shape bounds
- //Shape shape = NativeObject.getBounds2D();
- Shape shape = NativeObject;
-
- // stroke bounds
- if (pen != null)
- shape = ((Stroke)pen).createStrokedShape (shape);
-
- Rectangle2D rect = shape.getBounds2D ();
-
- // transform bounds
- if (matrix != null)
- rect = matrix.NativeObject.createTransformedShape(rect).getBounds2D();
-
- return new RectangleF (rect);
- }
- #endregion
-
- #region Transform
- public void Transform (Matrix matrix)
- {
- if(matrix == null)
- return;
-
- NativeObject.transform(matrix.NativeObject);
- }
- #endregion
-
- #region IsVisible
- public bool IsVisible (Point point)
- {
- return IsVisible (point.X, point.Y, null);
- }
-
- public bool IsVisible (PointF point)
- {
- return IsVisible (point.X, point.Y, null);
- }
-
- public bool IsVisible (int x, int y)
- {
- return IsVisible (x, y, null);
- }
-
- public bool IsVisible (float x, float y)
- {
- return IsVisible (x, y, null);
- }
-
- public bool IsVisible (Point pt, Graphics graphics)
- {
- return IsVisible (pt.X, pt.Y, graphics);
- }
-
- public bool IsVisible (PointF pt, Graphics graphics)
- {
- return IsVisible (pt.X, pt.Y, graphics);
- }
-
- public bool IsVisible (int x, int y, Graphics graphics)
- {
- return IsVisible((float)x,(float)y,null);
- }
-
- public bool IsVisible (float x, float y, Graphics graphics)
- {
- // LAMESPEC : .Net is currently ignorig Graphics object
- //if (graphics != null && !graphics.IsVisible(x,y))
- // return false;
-
- return NativeObject.contains(x,y);
- }
- #endregion
-
- #region Reverse
- public void Reverse ()
- {
- NativeObject.Reverse ();
- }
- #endregion
-
- #region AddClosedCurve
- public void AddClosedCurve (Point [] points)
- {
- AddClosedCurve(points, 0.5f);
- }
-
- public void AddClosedCurve (PointF [] points)
- {
- AddClosedCurve(points, 0.5f);
- }
-
- public void AddClosedCurve (Point [] points, float tension)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- int length = (points.Length + 3)*2;
-
- float[] pts = new float[length];
- pts[--length] = points[1].Y;
- pts[--length] = points[1].X;
- pts[--length] = points[0].Y;
- pts[--length] = points[0].X;
-
- for (int i = points.Length-1; i >= 0; i--) {
- pts[--length] = points[i].Y;
- pts[--length] = points[i].X;
- }
-
- pts[--length] = points[points.Length-1].Y;
- pts[--length] = points[points.Length-1].X;
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- CloseFigure ();
- }
-
- public void AddClosedCurve (PointF [] points, float tension)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- int length = (points.Length + 3)*2;
-
- float[] pts = new float[length];
- pts[--length] = points[1].Y;
- pts[--length] = points[1].X;
- pts[--length] = points[0].Y;
- pts[--length] = points[0].X;
-
- for (int i = points.Length-1; i >= 0; i--) {
- pts[--length] = points[i].Y;
- pts[--length] = points[i].X;
- }
-
- pts[--length] = points[points.Length-1].Y;
- pts[--length] = points[points.Length-1].X;
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- CloseFigure ();
- }
- #endregion
-
- #region AddCurve
- //we have now two approaches for drawing cardinal curves
- //the first one is to convert cardinals into approximate beziers
- //the second one - to draw curve ourself with all interpolation staff
- //here. I preffer the first one because we could utilize java antialiasing and
- //flattening features, otherwise curves will be more strict but less cool
- public void AddCurve (Point [] points)
- {
- AddCurve(points,0.5F);
- }
-
- public void AddCurve (PointF [] points)
- {
- AddCurve(points,0.5f);
- }
-
- public void AddCurve (Point [] points, float tension)
- {
- AddCurve(points, 0, points.Length-1, tension);
- }
-
- public void AddCurve (PointF [] points, float tension)
- {
- AddCurve(points, 0, points.Length-1, tension);
- }
-
- public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
- {
- int nPoints = numberOfSegments + 1;
- int length = nPoints*2 + 4;
- float[] pts = new float[length];
-
- int lastP = offset + nPoints;
- if (lastP == points.Length) {
- lastP--;
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- for (; length > 0 && lastP >= 0; lastP--) {
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- if (length > 0) {
- pts[1] = points[0].Y;
- pts[0] = points[0].X;
- }
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- }
-
- public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
- {
- int nPoints = numberOfSegments + 1;
- int length = nPoints*2 + 4;
- float[] pts = new float[length];
-
- int lastP = offset + nPoints;
- if (lastP == points.Length) {
- lastP--;
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- for (; length > 0 && lastP >= 0; lastP--) {
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- if (length > 0) {
- pts[1] = points[0].Y;
- pts[0] = points[0].X;
- }
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- }
-
- ///
- /// Based on http://pubpages.unh.edu/~cs770/a5/cardinal.html
- ///
- /// point array (x1,y1,x2,y2 ...).
- /// The first and last points considered only for calculations, but are not added.
- void AddCurve(float[] pts, bool connect, float tension) {
- tension /= 3f; //looks like a good pick
-
- if (connect)
- NativeObject.lineTo(pts[2],pts[3]);
- else
- NativeObject.moveTo(pts[2],pts[3]);
-
- float dx = pts[4] - pts[0];
- float dy = pts[5] - pts[1];
-
- float sx = pts[2] + tension*dx;
- float sy = pts[3] + tension*dy;
-
- for (int offset = 2, total = pts.Length-4; offset < total; offset += 2) {
- int cur_offset = offset;
- int pX = cur_offset++;
- int pY = cur_offset++;
- int X = cur_offset++;
- int Y = cur_offset++;
- int nX = cur_offset++;
- int nY = cur_offset++;
-
- dx = pts[nX] - pts[pX];
- dy = pts[nY] - pts[pY];
-
- float rx = pts[X] - tension*dx;
- float ry = pts[Y] - tension*dy;
-
- NativeObject.curveTo(sx, sy, rx, ry, pts[X], pts[Y]);
-
- sx = pts[X] + tension*dx;
- sy = pts[Y] + tension*dy;
- }
- }
- #endregion
-
- #region AddString
- public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
- layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
- layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
- format);
- }
-
- void AddString (string s, Font font,
- float x, float y, float width, float height,
- StringFormat format) {
-
- TextLineIterator iter = new TextLineIterator(s, font,
- new java.awt.font.FontRenderContext(null, false, false),
- format, width, height);
-
- int coordsCount = NativeObject.CoordsCount;
-
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
- NativeObject.append(layout.GetOutline(x, y), false);
- }
-
- AffineTransform lineAlignT = iter.CalcLineAlignmentTransform();
- if (lineAlignT != null)
- NativeObject.transform(lineAlignT, coordsCount, NativeObject.CoordsCount - coordsCount);
- }
- #endregion
-
- #region ClearMarkers
- public void ClearMarkers()
- {
- NativeObject.ClearMarkers ();
- }
- #endregion
-
- #region Close
- public void CloseAllFigures()
- {
- ExtendedGeneralPath p = new ExtendedGeneralPath();
- PathIterator pi = NativeObject.getPathIterator(null);
- JPI lastSeg = JPI.SEG_CLOSE;
- float [] points = new float[6];
-
- p.setWindingRule(pi.getWindingRule());
- while(!pi.isDone())
- {
- JPI curSeg = (JPI)pi.currentSegment(points);
- switch(curSeg)
- {
- case JPI.SEG_CLOSE:
- p.closePath();
- break;
- case JPI.SEG_MOVETO:
- if(lastSeg != JPI.SEG_CLOSE)
- p.closePath();
- p.moveTo(points[0],points[1]);
- break;
- case JPI.SEG_LINETO:
- p.lineTo(points[0],points[1]);
- break;
- case JPI.SEG_QUADTO:
- p.quadTo(points[0],points[1],points[2],points[3]);
- break;
- case JPI.SEG_CUBICTO:
- p.curveTo(points[0],points[1],points[2],points[3],points[4],points[5]);
- break;
- default:
- break;
- }
- lastSeg = curSeg;
- pi.next();
- }
-
- p.closePath();
- Shape = p;
- }
-
- public void CloseFigure() {
- if (!NativeObject.LastFigureClosed)
- NativeObject.closePath();
- }
- #endregion
-
- #region Flatten
- public void Flatten ()
- {
- // 1/4 is the FlatnessDefault as defined in GdiPlusEnums.h
- Flatten (null, 1.0f / 4.0f);
- }
-
- public void Flatten (Matrix matrix)
- {
- Flatten (matrix, 1.0f / 4.0f);
- }
-
- public void Flatten (Matrix matrix, float flatness)
- {
- AffineTransform tr = null;
- if(matrix != null)
- tr = matrix.NativeObject;
-
- //FIXME : Review (perfomance reasons).
- PathIterator pi = NativeObject.getPathIterator(tr,flatness);
- ExtendedGeneralPath newPath = new ExtendedGeneralPath();
- newPath.append(pi,false);
- Shape = newPath;
- }
- #endregion
-
- #region GetOutlineVisible
- public bool IsOutlineVisible (Point point, Pen pen)
- {
- return IsOutlineVisible (point.X, point.Y, pen, null);
- }
-
- public bool IsOutlineVisible (PointF point, Pen pen)
- {
- return IsOutlineVisible (point.X, point.Y, pen, null);
- }
-
- public bool IsOutlineVisible (int x, int y, Pen pen)
- {
- return IsOutlineVisible (x, y, pen, null);
- }
-
- public bool IsOutlineVisible (float x, float y, Pen pen)
- {
- return IsOutlineVisible (x, y, pen, null);
- }
-
- public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
- {
- return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
- }
-
- public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
- {
- return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
- }
-
- public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
- {
- // LAMESPEC : .Net is currently ignorig Graphics object
- //if (graphics != null) {
- // if (!graphics.IsVisible (x, y))
- // return false;
- //}
-
- return ((Stroke)pen).createStrokedShape (NativeObject).contains (x, y);
- }
-
- public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
- {
- return ((Stroke)pen).createStrokedShape (NativeObject).contains (x, y);
- }
- #endregion
-
- #region SetMarkers
- public void SetMarkers ()
- {
- NativeObject.SetMarkers ();
- }
- #endregion
-
- #region StartFigure
- public void StartFigure()
- {
- NativeObject.StartFigure ();
- }
- #endregion
-
- #region Warp
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect)
- {
- Warp (destPoints, srcRect, null, WarpMode.Perspective, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
- {
- Warp (destPoints, srcRect, matrix, WarpMode.Perspective, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
- {
- Warp (destPoints, srcRect, matrix, warpMode, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
- {
- throw new NotImplementedException();
- }
- #endregion
-
- #region Widen
- public void Widen (Pen pen)
- {
- Widen (pen, null);
- }
-
- public void Widen (Pen pen, Matrix matrix)
- {
- Widen (pen, matrix, 2f/3f);
- }
-
- public void Widen (Pen pen, Matrix matrix, float flatness)
- {
- if (pen == null)
- throw new ArgumentNullException("pen");
-
- Shape = new ExtendedGeneralPath(((Stroke)pen).createStrokedShape(this));
- Flatten(matrix, flatness);
- }
- #endregion
-
- private void SetPath (Point [] pts, byte [] types)
- {
- NativeObject.Clear ();
- if (((PathPointType)types [0] & PathPointType.PathTypeMask) != PathPointType.Start)
- NativeObject.moveTo (pts [0].X, pts [0].Y);
-
- for (int i=0; i < pts.Length; i++) {
- switch (((PathPointType)types [i] & PathPointType.PathTypeMask)) {
- case PathPointType.Start :
- NativeObject.moveTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Line :
- NativeObject.lineTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Bezier3 :
- float x1 = pts [i].X;
- float y1 = pts [i].Y;
- i++;
- float x2 = pts [i].X;
- float y2 = pts [i].Y;
- i++;
- float x3 = pts [i].X;
- float y3 = pts [i].Y;
- NativeObject.curveTo (x1,y1, x2, y2, x3, y3);
- break;
- }
- if (((PathPointType)types [i] & PathPointType.CloseSubpath) != 0)
- NativeObject.closePath();
-
- if (((PathPointType)types [i] & PathPointType.PathMarker) != 0)
- NativeObject.SetMarkers ();
- }
- }
-
- internal void SetPath (PointF [] pts, byte [] types)
- {
- NativeObject.Clear ();
- if (((PathPointType)types [0] & PathPointType.PathTypeMask) != PathPointType.Start)
- NativeObject.moveTo (pts [0].X, pts [0].Y);
- for (int i=0; i < pts.Length; i++) {
- switch (((PathPointType)types [i] & PathPointType.PathTypeMask)) {
- case PathPointType.Start :
- NativeObject.moveTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Line :
- NativeObject.lineTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Bezier3 :
- float x1 = pts [i].X;
- float y1 = pts [i].Y;
- i++;
- float x2 = pts [i].X;
- float y2 = pts [i].Y;
- i++;
- float x3 = pts [i].X;
- float y3 = pts [i].Y;
- NativeObject.curveTo (x1,y1, x2, y2, x3, y3);
- break;
- }
- if (((PathPointType)types [i] & PathPointType.CloseSubpath) != 0)
- NativeObject.closePath();
-
- if (((PathPointType)types [i] & PathPointType.PathMarker) != 0)
- NativeObject.SetMarkers ();
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.jvm.cs
deleted file mode 100644
index 7cdd36c128..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPathIterator.jvm.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-//
-// System.Drawing.Drawing2D.GraphicsPathIterator.cs
-//
-// Author:
-// Bors Kirzner
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class GraphicsPathIterator : MarshalByRefObject, IDisposable
- {
- #region Fields
-
- private readonly GraphicsPath _path;
- private int _marker = -1;
- private int _subpath = -1;
-
- #endregion // Fields
-
- #region Constructors
-
- public GraphicsPathIterator (GraphicsPath path)
- {
- _path = path;
- }
-
- #endregion // Constructors
-
- #region Properites
-
- public int Count
- {
- get { return _path.NativeObject.PointCount; }
- }
-
- public int SubpathCount {
- get {
- int count = 0;
- int start, end;
- bool isClosed;
- while (NextSubpath (out start, out end, out isClosed) != 0)
- count++;
- return count;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public int CopyData (ref PointF [] points, ref byte [] types, int startIndex, int endIndex)
- {
- int j = 0;
- for (int i = startIndex; i <= endIndex && i < _path.PointCount; i++) {
- points [j] = _path.PathPoints [i];
- types [j++] = _path.PathTypes [i];
- }
- return j;
- }
-
- public void Dispose ()
- {
- }
-
- public int Enumerate (ref PointF [] points, ref byte [] types)
- {
- return CopyData (ref points, ref types, 0, _path.PointCount);
- }
-
- public bool HasCurve ()
- {
- byte [] types = _path.PathTypes;
- for (int i=0; i < types.Length; i++)
- if ((types [i] & (byte)PathPointType.PathTypeMask) == (byte)PathPointType.Bezier3)
- return true;
- return false;
- }
-
- public int NextMarker (GraphicsPath path)
- {
- if (path == null)
- return 0;
-
- int startIndex;
- int endIndex;
- int count = NextMarker (out startIndex, out endIndex);
-
- if (count != 0)
- SetPath (_path, startIndex, count, path);
-
- return count;
- }
-
- public int NextMarker (out int startIndex, out int endIndex)
- {
- if (_marker >= _path.PointCount) {
- startIndex = 0;
- endIndex = 0;
- return 0;
- }
-
- startIndex = ++_marker;
- while ((_marker < _path.PointCount) && ((_path.PathTypes [_marker] & (byte)PathPointType.PathMarker) == 0))
- _marker++;
-
- endIndex = (_marker < _path.PointCount) ? _marker : _path.PointCount - 1;
- return endIndex - startIndex + 1;
- }
-
- public int NextPathType (out byte pathType, out int startIndex, out int endIndex)
- {
- if ((_subpath >= _path.PointCount - 1) | (_subpath < 0)) {
- startIndex = 0;
- endIndex = 0;
- pathType = (_subpath < 0) ? (byte)PathPointType.Start : _path.PathTypes [_path.PointCount - 1];
- return 0;
- }
-
- // .net acts different, but it seems to be a bug
- if ((_path.PathTypes [_subpath + 1] & (byte)PathPointType.PathMarker) != 0) {
- startIndex = 0;
- endIndex = 0;
- pathType = _path.PathTypes [_subpath];
- return 0;
- }
-
- startIndex = _subpath++;
- endIndex = startIndex;
- pathType = (byte)(_path.PathTypes [startIndex + 1] & (byte)PathPointType.PathTypeMask);
-
- while (((_subpath) < _path.PointCount) && ((_path.PathTypes [_subpath] & (byte)PathPointType.PathTypeMask) == pathType))
- _subpath++;
-
- endIndex = (_subpath < _path.PointCount) ? --_subpath : _path.PointCount - 1;
- return endIndex - startIndex + 1;
- }
-
- public int NextSubpath (GraphicsPath path, out bool isClosed)
- {
- int startIndex;
- int endIndex;
- int count = NextSubpath (out startIndex, out endIndex, out isClosed);
-
- if ((count != 0) && (path != null))
- SetPath (_path, startIndex, count, path);
-
- return count;
- }
-
- private void SetPath (GraphicsPath source, int start, int count, GraphicsPath target)
- {
- PointF [] points = new PointF [count];
- byte [] types = new byte [count];
- PointF [] pathPoints = _path.PathPoints;
- byte [] pathTypes = _path.PathTypes;
-
- for (int i = 0; i < count; i++) {
- points [i] = pathPoints [start + i];
- types [i] = pathTypes [start + i];
- }
-
- target.SetPath (points, types);
- }
-
- public int NextSubpath (out int startIndex, out int endIndex, out bool isClosed)
- {
- _subpath++;
- while (((_subpath) < _path.PointCount) && (_path.PathTypes [_subpath] != (byte)PathPointType.Start))
- _subpath++;
-
-
- if (_subpath >= _path.PointCount - 1) {
- startIndex = 0;
- endIndex = 0;
- isClosed = true;
- return 0;
- }
-
- startIndex = _subpath;
- int offset = 1;
- while (((_subpath + offset) < _path.PointCount) && (_path.PathTypes [_subpath + offset] != (byte)PathPointType.Start))
- offset++;
-
- endIndex = ((_subpath + offset) < _path.PointCount) ? _subpath + offset - 1 : _path.PointCount - 1;
- isClosed = (_path.PathTypes [endIndex] & (byte)PathPointType.CloseSubpath) != 0;
- return endIndex - startIndex + 1;
- }
-
- public void Rewind ()
- {
- _marker = -1;
- _subpath = -1;
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.jvm.cs
deleted file mode 100644
index 1cfb65ad37..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsState.jvm.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// System.Drawing.Drawing2D.ExtendedGraphicsState.jvm.cs
-//
-// Author:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing.Text;
-using geom = java.awt.geom;
-using awt = java.awt;
-
-namespace System.Drawing.Drawing2D
-{
- ///
- /// Summary description for GraphicsState.
- ///
- public sealed class GraphicsState : MarshalByRefObject
- {
- readonly CompositingMode _compositingMode;
- readonly CompositingQuality _compositingQuality;
- readonly Region _clip;
- readonly awt.Shape _baseClip;
- readonly InterpolationMode _interpolationMode;
- readonly float _pageScale;
- readonly GraphicsUnit _pageUnit;
- readonly PixelOffsetMode _pixelOffsetMode;
- readonly Point _renderingOrigin;
- readonly SmoothingMode _smoothingMode;
- readonly int _textContrast;
- readonly TextRenderingHint _textRenderingHint;
-
- // additional transform in case that new container has one
- readonly Matrix _transform;
- readonly Matrix _baseTransform;
-
- GraphicsState _next = null;
-
- internal GraphicsState(Graphics graphics, bool resetState)
- : this(graphics, Matrix.IdentityTransform, resetState) {}
-
- internal GraphicsState Next {
- get {
- return _next;
- }
- set {
- _next = value;
- }
- }
-
- internal GraphicsState(Graphics graphics, Matrix matrix, bool resetState)
- {
- _compositingMode = graphics.CompositingMode;
- _compositingQuality = graphics.CompositingQuality;
- _clip = graphics.ScaledClip;
- _baseClip = graphics.NativeObject.getClip();
- _interpolationMode = graphics.InterpolationMode;
- _pageScale = graphics.PageScale;
- _pageUnit = graphics.PageUnit;
- _pixelOffsetMode = graphics.PixelOffsetMode;
-
- // FIXME: render orign is not implemented yet
- //_renderingOrigin = new Point( g.RenderingOrigin.X, g.RenderingOrigin.Y );
-
- _smoothingMode = graphics.SmoothingMode;
- _transform = graphics.Transform;
- _baseTransform = graphics.BaseTransform;
-
- _textContrast = graphics.TextContrast;
- _textRenderingHint = graphics.TextRenderingHint;
-
- if (resetState)
- ResetState(graphics, matrix);
- }
-
- internal void RestoreState(Graphics graphics)
- {
- graphics.CompositingMode = _compositingMode;
- graphics.CompositingQuality = _compositingQuality;
- graphics.ScaledClip = _clip;
- graphics.InterpolationMode = _interpolationMode;
- graphics.PageScale = _pageScale;
- graphics.PageUnit = _pageUnit;
- graphics.PixelOffsetMode = _pixelOffsetMode;
-
- // FIXME: render orign is not implemented yet
- //graphics.RenderingOrigin = new Point( _renderingOrigin.X, _renderingOrigin.Y );
-
- graphics.SmoothingMode = _smoothingMode;
- graphics.Transform = _transform;
- graphics.BaseTransform = _baseTransform;
- graphics.TextContrast = _textContrast;
- graphics.TextRenderingHint = _textRenderingHint;
-
- // must be set after the base transform is restored
- graphics.NativeObject.setClip(_baseClip);
- }
-
- void ResetState(Graphics graphics, Matrix matrix)
- {
- //should be set before the base transform is changed
- if (_baseClip == null)
- graphics.IntersectScaledClipWithBase(graphics.VisibleShape);
-
- graphics.CompositingMode = CompositingMode.SourceOver;
- graphics.CompositingQuality = CompositingQuality.Default;
- graphics.ScaledClip = Region.InfiniteRegion;
- graphics.InterpolationMode = InterpolationMode.Bilinear;
- graphics.PageScale = 1.0f;
- graphics.PageUnit = GraphicsUnit.Display;
- graphics.PixelOffsetMode = PixelOffsetMode.Default;
-
- // FIXME: render orign is not implemented yet
- //graphics.RenderingOrigin = new Point(0, 0);
-
- graphics.SmoothingMode = SmoothingMode.None;
- graphics.ResetTransform();
- graphics.PrependBaseTransform(Graphics.GetFinalTransform(_transform.NativeObject, _pageUnit, _pageScale));
- graphics.PrependBaseTransform(matrix.NativeObject);
- graphics.TextContrast = 4;
- graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
- }
-
- internal void RestoreBaseClip(Graphics graphics) {
- graphics.NativeObject.setClip(_baseClip);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/HatchBrush.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/HatchBrush.jvm.cs
deleted file mode 100644
index 7d64fe85af..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/HatchBrush.jvm.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-
-using System;
-using java.awt;
-namespace System.Drawing.Drawing2D
-{
- ///
- /// Summary description for HatchBrush.
- ///
- public sealed class HatchBrush : Brush
- {
- private HatchStyle _style;
- private Color _foreColor;
- private Color _backColor;
-
- [MonoTODO]
- public HatchBrush (HatchStyle hatchStyle, Color foreColor)
- : this (hatchStyle, foreColor, Color.Black)
- {
- }
-
- [MonoTODO]
- public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
- {
- _style = hatchStyle;
- _foreColor = foreColor;
- _backColor = backColor;
- }
-
- public Color BackgroundColor {
- get {
- return _backColor;
- }
- }
-
- public Color ForegroundColor {
- get {
- return _foreColor;
- }
- }
-
- public HatchStyle HatchStyle {
- get {
- return _style;
- }
- }
-
- public override object Clone ()
- {
- return new HatchBrush (_style, _foreColor, _backColor);
- }
-
- protected override Paint NativeObject {
- get {
- // FALLBACK: Solid color brush will be used
- return _foreColor.NativeObject;
- }
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.jvm.cs
deleted file mode 100644
index 7d728a1058..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.jvm.cs
+++ /dev/null
@@ -1,346 +0,0 @@
-using System;
-using java.awt;
-using awt = java.awt;
-using geom = java.awt.geom;
-using image = java.awt.image;
-
-namespace System.Drawing.Drawing2D {
- ///
- /// Summary description for LinearGradientBrush.
- ///
- public sealed class LinearGradientBrush : Brush {
- Blend _blend;
- bool _gammaCorrection;
- ColorBlend _interpolationColors;
- WrapMode _wrapmode;
- RectangleF _gradientRectangle;
-
- // gradient brush data
- float _x1 = 0;
- float _y1 = 0;
-
- float _x2 = 0;
- float _y2 = 0;
-
- Color _color1, _color2;
- bool _cyclic;
-
- #region NativeObject
-
- GradientPaint _nativeObject = null;
- protected override Paint NativeObject {
- get {
- if ( _nativeObject == null )
- _nativeObject = new GradientPaint(
- _x1, _y1,
- new java.awt.Color(_color1.R, _color1.G, _color1.B, _color1.A),
- _x2, _y2,
- new java.awt.Color(_color2.R, _color2.G, _color2.B, _color2.A), _cyclic);
-
- return _nativeObject;
- }
- }
-
- #endregion
-
- #region Initialization
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, bool cyclic) {
- _x1 = x1;
- _y1 = y1;
- _color1 = color1;
-
- _x2 = x2;
- _y2 = y2;
- _color2 = color2;
-
- _cyclic = cyclic;
- _nativeObject = null;
- }
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, float angle) {
- _gradientRectangle = new RectangleF(x1, y1, x2-x1, y2-y1);
- PointF [] points = GetMedianeEnclosingRect(x1, y1, x2, y2, angle);
- Init(points[0].X, points[0].Y, color1, points[1].X, points[1].Y, color2, false);
- }
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, LinearGradientMode linearGradientMode) {
- _gradientRectangle = new RectangleF(x1, y1, x2-x1, y2-y1);
- PointF [] points;
-
- switch (linearGradientMode) {
- case LinearGradientMode.Horizontal :
- Init(x1, y1, color1, x2, y1, color2, false);
- break;
-
- case LinearGradientMode.Vertical :
- Init(x1, y1, color1, x1, y2, color2, false);
- break;
-
- case LinearGradientMode.BackwardDiagonal :
- points = GetMedianeEnclosingRect(x1, y1, x2, y2, false);
- Init(points[0].X, points[0].Y, color2, points[1].X, points[1].Y, color1, false);
- break;
-
- case LinearGradientMode.ForwardDiagonal :
- points = GetMedianeEnclosingRect(x1, y1, x2, y2, true);
- Init(points[0].X, points[0].Y, color1, points[1].X, points[1].Y, color2, false);
- break;
-
- default :
- throw new ArgumentException("LinearGradientMode");
- }
- }
-
- #endregion
-
- #region Constructors
-
- private LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2, bool cyclic) {
- Init(x1, y1, color1, x2, y2, color2, cyclic);
- }
-
- internal LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2, LinearGradientMode mode) {
- Init(x1, y1, color1, x2, y2, color2, mode);
- }
- internal LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2) {
- Init(x1, y2, color1, x1, y2, color2, false);
- }
- public LinearGradientBrush (Point point1, Point point2, Color color1, Color color2) {
- _gradientRectangle = new RectangleF(point1.X, point1.Y, point2.X - point1.X, point2.Y - point2.Y);
- Init(point1.X, point1.Y, color1, point2.X, point2.Y, color2, false);
- }
- public LinearGradientBrush (PointF point1, PointF point2, Color color1, Color color2) {
- _gradientRectangle = new RectangleF(point1.X, point1.Y, point2.X - point1.X, point2.Y - point2.Y);
- Init(point1.X, point1.Y, color1, point2.X, point2.Y, color2, false);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, LinearGradientMode linearGradientMode) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, linearGradientMode);
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, LinearGradientMode linearGradientMode) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, linearGradientMode);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, float angle) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, angle);
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float angle) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, angle);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, float angle, bool isAngleScaleable):
- this(rect, color1, color2, angle) {
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float angle, bool isAngleScaleable):
- this(rect, color1, color2, angle) {
- }
- #endregion
-
- #region GetMedianeEnclosingRect
-
- internal PointF [] GetMedianeEnclosingRect(float x1, float y1, float x2, float y2, float rotateAngle) {
- float width = x2 - x1;
- float height = y2 - y1;
- PointF rectCenter = new PointF(x1 + width/2, y1 + height/2);
- float gradLen = width * Math.Abs((float)Math.Cos(rotateAngle * Math.PI / 180)) +
- height * Math.Abs((float)Math.Sin(rotateAngle * Math.PI / 180));
-
- PointF [] points = new PointF []{ new PointF(rectCenter.X - gradLen/2, rectCenter.Y),
- new PointF(rectCenter.X + gradLen/2, rectCenter.Y) };
-
- Matrix mx = new Matrix();
- mx.RotateAt((float)rotateAngle, rectCenter);
- mx.TransformPoints(points);
- return points;
- }
- internal PointF [] GetMedianeEnclosingRect(float x1, float y1, float x2, float y2, bool forwardDiagonal) {
- float width = x2 - x1;
- float height = y2 - y1;
- PointF rectCenter = new PointF(x1 + width/2, y1 + height/2);
- float rotateAngle = (float)Math.Atan2(width, height);
- float gradLen = width * (float)Math.Cos(rotateAngle);
-
- if (!forwardDiagonal)
- rotateAngle = -rotateAngle;
-
- PointF [] points = new PointF []{ new PointF(rectCenter.X - gradLen, rectCenter.Y),
- new PointF(rectCenter.X + gradLen, rectCenter.Y) };
-
- Matrix mx = new Matrix();
- mx.RotateAt((float)rotateAngle * (float)(180/Math.PI), rectCenter);
- mx.TransformPoints(points);
- return points;
- }
-
- #endregion
-
- #region Public Properties
-
- // FALLBACK: no functionality implemented for this property
- [MonoTODO]
- public Blend Blend {
- get {
- return _blend;
- }
- set {
- _blend = value;
- }
- }
-
- // FALLBACK: no functionality implemented for this property
- [MonoTODO]
- public bool GammaCorrection {
- get {
- return _gammaCorrection;
- }
- set {
- _gammaCorrection = value;
- }
- }
-
- // FALLBACK: functionality of two color gradient is implemented
- [MonoTODO]
- public ColorBlend InterpolationColors {
- get {
- return _interpolationColors;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("ColorBlend");
-
- if ( (value.Colors == null) || (value.Colors.Length == 0) )
- throw new ArgumentException("ColorBlend");
-
- _interpolationColors = value;
-
- _color1 = value.Colors[0];
- _color2 = value.Colors[value.Colors.Length - 1];
- _nativeObject = null;
- }
- }
-
- public Color [] LinearColors {
- get {
- Color [] cl = new Color[2];
- cl[0] = _color1;
- cl[1] = _color2;
- return cl;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("colors");
-
- _color1 = value[0];
- _color2 = value[1];
- _nativeObject = null;
- }
- }
-
- public RectangleF Rectangle {
- get {
- return _gradientRectangle;
- }
- }
-
- public Matrix Transform {
- get { return BrushTransform; }
- set { BrushTransform = value; }
- }
-
- // FALLBACK: not functionality implemented for this property
- [MonoTODO]
- public WrapMode WrapMode {
- get {
- return _wrapmode;
- }
- set {
- _wrapmode = value;
- }
- }
- #endregion
-
- #region Public Methods
-
- public void MultiplyTransform (Matrix matrix) {
- BrushMultiplyTransform(matrix, MatrixOrder.Prepend);
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- BrushMultiplyTransform(matrix, order);
- }
-
- public void ResetTransform () {
- BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- BrushRotateTransform(angle, MatrixOrder.Prepend);
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- BrushRotateTransform(angle, order);
- }
-
- public void ScaleTransform (float sx, float sy) {
- BrushScaleTransform(sx, sy, MatrixOrder.Prepend);
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- BrushScaleTransform(sx, sy, order);
- }
-
- public void SetBlendTriangularShape (float focus) {
- SetBlendTriangularShape (focus, 1.0F);
- }
-
- public void SetBlendTriangularShape (float focus, float scale) {
- _x2 = (_x1 + _x2) / 2;
- _y2 = (_y1 + _y2) / 2;
- _cyclic = true;
- _nativeObject = null;
- }
-
- public void SetSigmaBellShape (float focus) {
- SetSigmaBellShape (focus, 1.0F);
- }
-
- [MonoTODO]
- public void SetSigmaBellShape (float focus, float scale) {
- // FALLBACK: Triangle shape used
- SetBlendTriangularShape (focus, scale);
- }
-
- public void TranslateTransform (float dx, float dy) {
- BrushTranslateTransform (dx, dy);
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- BrushTranslateTransform(dx, dy, order);
- }
-
- public override object Clone () {
- LinearGradientBrush copy = (LinearGradientBrush)InternalClone();
-
- if (copy._nativeObject != null)
- copy._nativeObject = null;
-
- if (_interpolationColors != null) {
- copy._interpolationColors = new ColorBlend();
- if (_interpolationColors.Colors != null)
- copy._interpolationColors.Colors = (Color[])_interpolationColors.Colors.Clone();
- if (_interpolationColors.Positions != null)
- copy._interpolationColors.Positions = (float[])_interpolationColors.Positions.Clone();
- }
-
- if (_blend != null) {
- copy._blend = new Blend();
- if (_blend.Factors != null)
- copy._blend.Factors = (float[])_blend.Factors.Clone();
- if (_blend.Positions != null)
- copy._blend.Positions = (float[])_blend.Positions.Clone();
- }
-
- copy.LinearColors = (Color[])LinearColors.Clone();
- return copy;
- }
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.jvm.cs
deleted file mode 100644
index 7a3dff8b72..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.jvm.cs
+++ /dev/null
@@ -1,295 +0,0 @@
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using geom = java.awt.geom;
-using JMath = java.lang.Math;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class Matrix : MarshalByRefObject, IDisposable
- {
- #region fields
-
- static internal readonly Matrix IdentityTransform = new Matrix();
- readonly geom.AffineTransform _nativeMatrix;
-
- #endregion
-
- #region ctors
-
- internal Matrix (geom.AffineTransform ptr)
- {
- _nativeMatrix = ptr;
- }
-
- public Matrix () : this(new geom.AffineTransform())
- {
- }
-
- public Matrix (Rectangle rect , Point[] plgpts)
- {
- double x1 = plgpts[1].X - plgpts[0].X;
- double y1 = plgpts[1].Y - plgpts[0].Y;
-
- double x2 = plgpts[2].X - plgpts[0].X;
- double y2 = plgpts[2].Y - plgpts[0].Y;
-
- _nativeMatrix = new geom.AffineTransform(x1/rect.Width, y1/rect.Width, x2/rect.Height, y2/rect.Height, plgpts[0].X, plgpts[0].Y);
- _nativeMatrix.translate(-rect.X,-rect.Y);
- }
-
- public Matrix (RectangleF rect , PointF[] plgpts)
- {
- double x1 = plgpts[1].X - plgpts[0].X;
- double y1 = plgpts[1].Y - plgpts[0].Y;
-
- double x2 = plgpts[2].X - plgpts[0].X;
- double y2 = plgpts[2].Y - plgpts[0].Y;
-
- _nativeMatrix = new geom.AffineTransform(x1/rect.Width, y1/rect.Width, x2/rect.Height, y2/rect.Height, plgpts[0].X, plgpts[0].Y);
- _nativeMatrix.translate(-rect.X,-rect.Y);
- }
-
- public Matrix (float m11, float m12, float m21, float m22, float dx, float dy)
- : this(new geom.AffineTransform(m11,m12,m21,m22,dx,dy))
- {
- }
-
- #endregion
-
- #region properties
-
- public float[] Elements
- {
- get
- {
- float [] elems = new float[] {
- (float)NativeObject.getScaleX(),
- (float)NativeObject.getShearY(),
- (float)NativeObject.getShearX(),
- (float)NativeObject.getScaleY(),
- (float)NativeObject.getTranslateX(),
- (float)NativeObject.getTranslateY()};
- return elems;
- }
- }
-
- public bool IsIdentity
- {
- get
- {
- return NativeObject.isIdentity();
- }
- }
-
- public bool IsInvertible
- {
- get
- {
- try
- {
- return NativeObject.getDeterminant() != 0.0;
- }
- catch(geom.NoninvertibleTransformException)
- {
- return false;
- }
- }
- }
-
- public float OffsetX
- {
- get
- {
- return (float)NativeObject.getTranslateX();
- }
- }
-
- public float OffsetY
- {
- get
- {
- return (float)NativeObject.getTranslateY();
- }
- }
-
- #endregion
-
- #region methods
-
- public Matrix Clone()
- {
- return new Matrix ((geom.AffineTransform) NativeObject.clone ());
- }
-
-
- public void Dispose ()
- {
- }
-
- internal void CopyTo(Matrix matrix) {
- matrix.NativeObject.setTransform(NativeObject);
- }
-
- public override bool Equals (object obj)
- {
- Matrix m = obj as Matrix;
-
-
- if (m == null)
- return false;
-
- return NativeObject.Equals(m.NativeObject);
- }
-
- public override int GetHashCode ()
- {
- return NativeObject.GetHashCode();
- }
-
- public void Invert ()
- {
- try {
- _nativeMatrix.setTransform( _nativeMatrix.createInverse() );
- }
- catch(geom.NoninvertibleTransformException e) {
- throw new ArgumentException(e.Message, e);
- }
- }
-
- public void Multiply (Matrix matrix)
- {
- Multiply (matrix, MatrixOrder.Prepend);
- }
-
- public void Multiply (Matrix matrix, MatrixOrder order)
- {
- Multiply(matrix.NativeObject, order);
- }
-
- public void Reset()
- {
- NativeObject.setToIdentity();
- }
-
- public void Rotate (float angle)
- {
- NativeObject.rotate (JMath.toRadians(angle));
- }
-
- public void Rotate (float angle, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getRotateInstance(JMath.toRadians(angle)), order);
- }
-
- public void RotateAt (float angle, PointF point)
- {
- NativeObject.rotate (JMath.toRadians(angle), point.X, point.Y);
- }
-
- public void RotateAt (float angle, PointF point, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getRotateInstance(JMath.toRadians(angle),point.X, point.Y), order);
- }
-
- public void Scale (float scaleX, float scaleY)
- {
- NativeObject.scale (scaleX, scaleY);
- }
-
- public void Scale (float scaleX, float scaleY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getScaleInstance(scaleX, scaleY), order);
- }
-
- public void Shear (float shearX, float shearY)
- {
- NativeObject.shear(shearX, shearY);
- }
-
- public void Shear (float shearX, float shearY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getShearInstance (shearX, shearY), order);
- }
-
- public void TransformPoints (Point[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.transform(pt,pt);
- pts[i].X=(int)pt.getX();
- pts[i].Y=(int)pt.getY();
- }
- }
-
- public void TransformPoints (PointF[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.transform(pt,pt);
- pts[i].X=(float)pt.getX();
- pts[i].Y=(float)pt.getY();
- }
- }
-
- public void TransformVectors (Point[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.deltaTransform(pt,pt);
- pts[i].X=(int)pt.getX();
- pts[i].Y=(int)pt.getY();
- }
- }
-
- public void TransformVectors (PointF[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.deltaTransform(pt,pt);
- pts[i].X=(float)pt.getX();
- pts[i].Y=(float)pt.getY();
- }
- }
-
- public void Translate (float offsetX, float offsetY)
- {
- NativeObject.translate (offsetX, offsetY);
- }
-
- public void Translate (float offsetX, float offsetY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getTranslateInstance(offsetX, offsetY), order);
- }
-
- public void VectorTransformPoints (Point[] pts)
- {
- TransformVectors (pts);
- }
-
- internal geom.AffineTransform NativeObject
- {
- get
- {
- return _nativeMatrix;
- }
- }
-
- void Multiply(geom.AffineTransform at, MatrixOrder order) {
- Multiply(NativeObject, at, order);
- }
-
- internal static void Multiply(geom.AffineTransform to, geom.AffineTransform add, MatrixOrder order) {
- if(order == MatrixOrder.Prepend)
- to.concatenate(add);
- else
- to.preConcatenate(add);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.jvm.cs
deleted file mode 100644
index dda2bc6c83..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PathGradientBrush.jvm.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using awt = java.awt;
-
-namespace System.Drawing.Drawing2D {
- ///
- /// Summary description for PathGradientBrush.
- ///
- [MonoTODO]
- public sealed class PathGradientBrush : Brush {
- Brush _nativeObject;
- Blend _blend;
- Color _centerColor;
- PointF _center;
- PointF _focus;
- RectangleF _rectangle;
- Color [] _surroundColors;
- ColorBlend _interpolationColors;
- WrapMode _wrapMode;
- GraphicsPath _texturePath;
- bool _triangularShape = false;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- #region initialize
-
- void Initialize(GraphicsPath path, WrapMode wrapMode, bool initColors, bool calcCenter) {
-
- _texturePath = path;
- _wrapMode = wrapMode;
- _rectangle = path.GetBounds();
-
- if (initColors) {
- _centerColor = Color.Black;
- _surroundColors = new Color []{ Color.White };
- }
-
- Bitmap texture = new Bitmap( (int)_rectangle.Width, (int)_rectangle.Height );
- Graphics g = Graphics.FromImage( texture );
- PointF [] pathPoints = path.PathPoints;
-
- if (calcCenter) {
- for (int i=0; i < pathPoints.Length; i++) {
- _center.X += pathPoints[i].X;
- _center.Y += pathPoints[i].Y;
- }
- _center.X /= pathPoints.Length;
- _center.Y /= pathPoints.Length;
- }
-
- int outerColor = 0;
- DrawSector( g, CenterPoint, pathPoints[pathPoints.Length-1], pathPoints[0], CenterColor, SurroundColors[outerColor] );
- for(int i=0; i < pathPoints.Length - 1; i++) {
- if (outerColor < SurroundColors.Length - 1)
- outerColor++;
- DrawSector( g, CenterPoint, pathPoints[i], pathPoints[i+1], CenterColor, SurroundColors[outerColor] );
- }
-
- _nativeObject = new TextureBrush( texture );
- }
- private void DrawSector(Graphics g, PointF center, PointF p1, PointF p2, Color innerColor, Color outerColor) {
- GraphicsPath pt = new GraphicsPath();
- pt.AddLine(p1, center);
- pt.AddLine(center, p2);
- LinearGradientBrush lgb = new LinearGradientBrush( GetVertical(center, p1, p2) , center, outerColor, innerColor );
- if (_triangularShape)
- lgb.SetBlendTriangularShape(0.5f);
- g.FillPath( lgb, pt );
- }
- private PointF GetVertical(PointF c, PointF p1, PointF p2) {
- if (p1.X == p2.X)
- return new PointF(p1.X, c.Y);
- if (p1.Y == p2.Y)
- return new PointF(c.X, p2.Y);
-
- float a = (float)(p2.Y - p1.Y) / (p2.X - p1.X);
- float av = - 1 / a;
-
- float b1 = p1.Y - a * p1.X;
- float b2 = c.Y - av * c.X;
-
- float ox = (b1 - b2) / (av - a);
- float oy = av * ox + b2;
-
- return new PointF(ox, oy);
- }
-
- #endregion
-
- #region ctors
-
- public PathGradientBrush (GraphicsPath path) {
- Initialize( path, WrapMode.Clamp, true, true );
- }
-
- public PathGradientBrush (Point [] points) : this (points, WrapMode.Clamp) {
- }
-
- public PathGradientBrush (PointF [] points) : this (points, WrapMode.Clamp) {
- }
-
- public PathGradientBrush (Point [] points, WrapMode wrapMode) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines( points );
- Initialize( path, wrapMode, true, true );
- }
-
- public PathGradientBrush (PointF [] points, WrapMode wrapMode) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines( points );
- Initialize( path, wrapMode, true, true );
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public Blend Blend {
- get {
- return _blend;
- }
- set {
- _blend = value;
- }
- }
-
- public Color CenterColor {
- get {
- return _centerColor;
- }
- set {
- _centerColor = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public PointF CenterPoint {
- get {
- return _center;
- }
- set {
- _center = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public PointF FocusScales {
- get {
- return _focus;
- }
- set {
- _focus = value;
- }
- }
-
- public ColorBlend InterpolationColors {
- get {
- return _interpolationColors;
- }
- set {
- _interpolationColors = value;
- }
- }
-
- public RectangleF Rectangle {
- get {
- return _rectangle;
- }
- }
-
- public Color [] SurroundColors {
- get {
- return _surroundColors;
- }
- set {
- _surroundColors = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public Matrix Transform {
- get {
- return BrushTransform;
- }
- set {
- BrushTransform = value;
- }
- }
-
- public WrapMode WrapMode {
- get {
- return _wrapMode;
- }
- set {
- _wrapMode = value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public void MultiplyTransform (Matrix matrix) {
- base.BrushMultiplyTransform( matrix );
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- base.BrushMultiplyTransform( matrix, order );
- }
-
- public void ResetTransform () {
- base.BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- base.BrushRotateTransform( angle );
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- base.BrushRotateTransform( angle, order );
- }
-
- public void ScaleTransform (float sx, float sy) {
- base.BrushScaleTransform( sx, sy );
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- base.BrushScaleTransform( sx, sy, order );
- }
-
- public void SetBlendTriangularShape (float focus) {
- SetBlendTriangularShape (focus, 1.0F);
- }
-
- public void SetBlendTriangularShape (float focus, float scale) {
- _triangularShape = true;
- Initialize( _texturePath, _wrapMode, false, false );
- }
-
- public void SetSigmaBellShape (float focus) {
- SetSigmaBellShape (focus, 1.0F);
- }
-
- [MonoTODO]
- public void SetSigmaBellShape (float focus, float scale) {
- // FALLBACK: Triangle shape used
- SetBlendTriangularShape (focus, scale);
- }
-
- public void TranslateTransform (float dx, float dy) {
- base.BrushTranslateTransform( dx, dy );
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- base.BrushTranslateTransform( dx, dy, order );
- }
-
- public override object Clone () {
- PathGradientBrush copy = (PathGradientBrush)InternalClone();
-
- if (copy._nativeObject != null)
- copy._nativeObject = (Brush)copy._nativeObject.Clone();
-
- if (copy._surroundColors != null)
- copy._surroundColors = (Color[])copy._surroundColors.Clone();
-
- if (copy._texturePath != null)
- copy._texturePath = (GraphicsPath)copy._texturePath.Clone();
-
- //TBD: clone _blend, _interpolationColors
- //copy._blend = copy._blend
-
- return copy;
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs
index 53d86e6e55..d1095dc1dd 100644
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs
@@ -34,9 +34,6 @@ namespace System.Drawing.Imaging
{
// MUST BE KEPT IN SYNC WITH gdip.h in libgdiplus!
// The first 6 fields MUST also match MS definition
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout(LayoutKind.Sequential)]
public sealed class BitmapData {
private int width;
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMap.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMap.cs
index 602434eedb..88584b271d 100644
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMap.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMap.cs
@@ -37,9 +37,6 @@ using System.IO;
using System.Reflection;
namespace System.Drawing.Imaging {
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class ColorMap {
private Color newColor;
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs
index 6e73ea4e6d..3b042cad17 100644
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrix.cs
@@ -36,9 +36,6 @@ using System.Runtime.InteropServices;
namespace System.Drawing.Imaging
{
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout (LayoutKind.Sequential)]
public sealed class ColorMatrix
{
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs
index 078af15916..28599a7b47 100644
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs
@@ -69,7 +69,6 @@ namespace System.Drawing.Imaging
return flags;
}
}
-#if !TARGET_JVM
/* Caller should call FreeHGlobal*/
internal IntPtr getGDIPalette()
{
@@ -112,6 +111,5 @@ namespace System.Drawing.Imaging
offset += 4;
}
}
-#endif
}
}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameter.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameter.jvm.cs
deleted file mode 100644
index 0f9ed05813..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameter.jvm.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// System.Drawing.Imaging.EncoderParameter.cs
-//
-// Author:
-// Ravindra (rkumar@novell.com)
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Imaging {
-
- [MonoTODO]
- public sealed class EncoderParameter : IDisposable {
-
- private Encoder encoder;
- private int valuesCount;
- private EncoderParameterValueType type;
-
- internal EncoderParameter ()
- {
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, short value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, short[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, string value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte value, bool undefined)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte[] value, bool undefined)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numerator, int denominator)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int[] numerator, int[] denominator)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long rangebegin, long rangeend)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long[] rangebegin, long[] rangeend)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2)
- {
- throw new NotImplementedException();
- }
-
- public Encoder Encoder {
- get {
- return encoder;
- }
-
- set {
- encoder = value;
- }
- }
-
- public int NumberOfValues {
- get {
- return valuesCount;
- }
- }
-
- public EncoderParameterValueType Type {
- get {
- return type;
- }
- }
-
- public EncoderParameterValueType ValueType {
- get {
- return type;
- }
- }
-
- void Dispose (bool disposing) {
- }
-
- public void Dispose () {
- Dispose (true);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameters.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameters.cs
index dfac530436..2a5b25c585 100644
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameters.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameters.cs
@@ -58,7 +58,6 @@ namespace System.Drawing.Imaging
// Nothing
GC.SuppressFinalize(this);
}
-#if !TARGET_JVM
internal IntPtr ToNativePtr () {
IntPtr result;
IntPtr ptr;
@@ -106,6 +105,5 @@ namespace System.Drawing.Imaging
return result;
}
-#endif
}
}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageAttributes.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ImageAttributes.jvm.cs
deleted file mode 100644
index dafafc83b5..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageAttributes.jvm.cs
+++ /dev/null
@@ -1,298 +0,0 @@
-
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-
-namespace System.Drawing.Imaging
-{
- ///
- /// Summary description for ImageAttributes.
- ///
- ///
- [MonoTODO]
- public sealed class ImageAttributes : ICloneable, IDisposable
- {
- [MonoTODO]
- public ImageAttributes()
- {
- }
-
- public void Dispose()
- {
- }
-
- public Object Clone()
- {
- ImageAttributes imgAttr = new ImageAttributes();
- imgAttr.clrMatrix = clrMatrix;
- imgAttr.clrMatrixFlag = clrMatrixFlag;
- imgAttr.clrAdjustType = clrAdjustType;
- imgAttr.gMatrix = gMatrix;
- imgAttr.thresh = thresh;
- imgAttr.gamma = gamma;
- imgAttr.clrChannelFlags = clrChannelFlags;
- imgAttr.clrProfileFilename = clrProfileFilename;
- imgAttr.clrLow = clrLow;
- imgAttr.clrHigh = clrHigh;
- imgAttr.clrMap = clrMap;
- imgAttr.wrapMode = wrapMode;
- imgAttr.col = col;
- imgAttr.bClamp = bClamp;
- imgAttr.clrPalette = clrPalette;
- imgAttr.bNoOp = bNoOp;
- return imgAttr;
- }
-
-
- public void SetColorMatrix(ColorMatrix newColorMatrix)
- {
- SetColorMatrix(newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
- }
-
- public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag flags)
- {
- SetColorMatrix(newColorMatrix, flags, ColorAdjustType.Default);
- }
-
- public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
- {
- clrMatrix = newColorMatrix;
- clrMatrixFlag = mode;
- clrAdjustType = type;
- }
-
- public void ClearColorMatrix()
- {
- ClearColorMatrix(ColorAdjustType.Default);
- }
-
- public void ClearColorMatrix(ColorAdjustType type)
- {
- ColorMatrix cm = new ColorMatrix();
- clrMatrix = cm;
- clrAdjustType = type;
- }
-
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix)
- {
- SetColorMatrices(newColorMatrix, gMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
- }
-
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag flags)
- {
- SetColorMatrices(newColorMatrix, gMatrix, flags, ColorAdjustType.Default);
- }
-
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag mode, ColorAdjustType type)
- {
- clrMatrix = newColorMatrix;
- this.gMatrix = gMatrix;
- clrMatrixFlag = mode;
- clrAdjustType = type;
- }
-
- public void SetThreshold(float thresh)
- {
- SetThreshold(thresh, ColorAdjustType.Default);
- }
-
- public void SetThreshold(float thresh, ColorAdjustType type)
- {
- this.thresh = thresh;
- clrAdjustType = type;
- }
-
- public void ClearThreshold()
- {
- ClearThreshold(ColorAdjustType.Default);
- }
-
- public void ClearThreshold(ColorAdjustType type)
- {
- thresh = 1.0F;
- clrAdjustType = type;
- }
-
- public void SetGamma(float gamma)
- {
- SetGamma(gamma, ColorAdjustType.Default);
- }
-
- public void SetGamma(float gamma, ColorAdjustType type)
- {
- this.gamma = gamma;
- clrAdjustType = type;
- return;
- }
-
- public void ClearGamma()
- {
- ClearGamma(ColorAdjustType.Default);
- }
-
- public void ClearGamma(ColorAdjustType type)
- {
- gamma = 1;
- clrAdjustType = type;
- }
-
- public void SetNoOp()
- {
- SetNoOp(ColorAdjustType.Default);
- }
-
- public void SetNoOp(ColorAdjustType type)
- {
- bNoOp = true;
- clrAdjustType = type;
- }
-
- public void ClearNoOp()
- {
- ClearNoOp(ColorAdjustType.Default);
- }
-
- public void ClearNoOp(ColorAdjustType type)
- {
- bNoOp = false;
- clrAdjustType = type;
- }
-
- public void SetColorKey(Color clrLow, Color clrHigh)
- {
- SetColorKey(clrLow, clrHigh, ColorAdjustType.Default);
- }
-
- public void SetColorKey(Color clrLow, Color clrHigh, ColorAdjustType type)
- {
- this.clrLow = clrLow;
- this.clrHigh = clrHigh;
- clrAdjustType = type;
- }
-
- public void ClearColorKey()
- {
- ClearColorKey(ColorAdjustType.Default);
- }
-
- public void ClearColorKey(ColorAdjustType type)
- {
- clrAdjustType = type;
- }
-
- public void SetOutputChannel(ColorChannelFlag flags)
- {
- SetOutputChannel(flags, ColorAdjustType.Default);
- }
-
- public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)
- {
- clrChannelFlags = flags;
- clrAdjustType = type;
- }
-
- public void ClearOutputChannel()
- {
- ClearOutputChannel(ColorAdjustType.Default);
- }
-
- public void ClearOutputChannel(ColorAdjustType type)
- {
- clrAdjustType = type;
- }
-
- public void SetOutputChannelColorProfile(String clrProfileFilename)
- {
- SetOutputChannelColorProfile(clrProfileFilename, ColorAdjustType.Default);
- }
-
- public void SetOutputChannelColorProfile(String clrProfileFilename, ColorAdjustType type)
- {
- this.clrProfileFilename = clrProfileFilename;
- clrAdjustType = type;
- }
-
- public void ClearOutputChannelColorProfile()
- {
- ClearOutputChannel(ColorAdjustType.Default);
- }
-
- public void ClearOutputChannelColorProfile(ColorAdjustType type)
- {
- clrProfileFilename = null;
- clrAdjustType = type;
- }
-
- public void SetRemapTable(ColorMap[] map)
- {
- SetRemapTable(map, ColorAdjustType.Default);
- }
-
- public void SetRemapTable(ColorMap[] map, ColorAdjustType type)
- {
- clrMap = map;
- clrAdjustType = type;
- }
-
- public void ClearRemapTable()
- {
- ClearRemapTable(ColorAdjustType.Default);
- }
-
- public void ClearRemapTable(ColorAdjustType type)
- {
- clrMap = null;
- clrAdjustType = type;
- }
-
- public void SetBrushRemapTable(ColorMap []map)
- {
- SetRemapTable(map, ColorAdjustType.Brush);
- }
-
- public void ClearBrushRemapTable()
- {
- ClearRemapTable(ColorAdjustType.Brush);
- }
-
- public void SetWrapMode(WrapMode mode)
- {
- SetWrapMode(mode, new Color(), false);
- }
-
- public void SetWrapMode(WrapMode mode, Color clr)
- {
- SetWrapMode(mode, clr, false);
- }
-
- public void SetWrapMode(WrapMode mode, Color clr, bool bClamp)
- {
- wrapMode = mode;
- col = clr;
- this.bClamp = bClamp;
- }
-
- public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)
- {
- clrPalette = palette;
- clrAdjustType = type;
- }
-
- public ColorMatrix clrMatrix;
- public ColorMatrixFlag clrMatrixFlag;
- public ColorAdjustType clrAdjustType;
- public ColorMatrix gMatrix;
- public float thresh;
- public float gamma;
- public ColorChannelFlag clrChannelFlags;
- public string clrProfileFilename;
- public Color clrLow;
- public Color clrHigh;
- public ColorMap[] clrMap;
- public WrapMode wrapMode;
- public Color col;
- public bool bClamp;
- public ColorPalette clrPalette;
- public bool bNoOp;
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodec.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodec.jvm.cs
deleted file mode 100644
index 8ded371ba7..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodec.jvm.cs
+++ /dev/null
@@ -1,700 +0,0 @@
-using System;
-using System.Configuration;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Drawing.Imaging;
-using System.Xml;
-using Mainsoft.Drawing.Configuration;
-
-using imageio = javax.imageio;
-using stream = javax.imageio.stream;
-using awt = java.awt;
-using image = java.awt.image;
-using spi = javax.imageio.spi;
-using dom = org.w3c.dom;
-
-namespace Mainsoft.Drawing.Imaging {
- ///
- /// Summary description for ImageCodec.
- ///
- public class ImageCodec : IDisposable {
-
- #region Members
-
- imageio.ImageReader _nativeReader = null;
- imageio.ImageWriter _nativeWriter = null;
- stream.ImageInputStream _nativeStream = null;
-
- ImageFormat _imageFormat = null;
-
- int _currentFrame = 0;
-
- #endregion
-
- #region Constructros
-
- protected ImageCodec() {
- }
-
- static ImageCodec() {
- }
-
- #endregion
-
- #region Internal properties
-
- internal imageio.ImageReader NativeReader {
- get { return _nativeReader; }
- set {
- _nativeReader = value;
- if (value == null)
- return;
- _imageFormat = MimeTypesToImageFormat( value.getOriginatingProvider().getMIMETypes() );
- }
- }
- internal imageio.ImageWriter NativeWriter {
- get { return _nativeWriter; }
- set {
- _nativeWriter = value;
- if (value == null)
- return;
- _imageFormat = MimeTypesToImageFormat( value.getOriginatingProvider().getMIMETypes() );
- }
- }
-
- internal stream.ImageInputStream NativeStream {
- get { return _nativeStream; }
- set {
- _nativeStream = value;
- if (value == null)
- return;
-
- if (NativeReader != null)
- NativeReader.setInput( value );
-
- if (NativeWriter != null)
- NativeWriter.setOutput( value );
- }
- }
-
- #endregion
-
- #region ImageCodec factory methods
-
- public static ImageCodec CreateReader(stream.ImageInputStream inputStream) {
- java.util.Iterator iter = imageio.ImageIO.getImageReaders( inputStream );
- return CreateReader(iter);
- }
-
- public static ImageCodec CreateReader(ImageFormat imageFormat) {
- return CreateReader( ImageFormatToClsid( imageFormat ) );
- }
-
- public static ImageCodec CreateReader(Guid clsid) {
- ImageCodec codec = null;
- try {
- ImageCodecInfo codecInfo = FindDecoder(clsid);
- java.util.Iterator iter = imageio.ImageIO.getImageReadersByMIMEType( codecInfo.MimeType );
- codec = CreateReader(iter);
- }
- catch {}
-
- if (codec == null) {
- ImageFormat format = ClsidToImageFormat(clsid);
- string name = (format != null) ? format.ToString() : clsid.ToString();
- throw new NotSupportedException(String.Format("The '{0}' format decoder is not installed.", name));
- }
-
- return codec;
- }
-
- private static ImageCodec CreateReader(java.util.Iterator iter) {
- if ( !iter.hasNext() )
- return null;
-
- ImageCodec imageCodec = new ImageCodec();
- imageCodec.NativeReader = (imageio.ImageReader) iter.next();
- return imageCodec;
- }
-
- public static ImageCodec CreateWriter(ImageFormat imageFormat) {
- return CreateWriter( ImageFormatToClsid( imageFormat ) );
- }
-
- public static ImageCodec CreateWriter(Guid clsid) {
- ImageCodec codec = null;
- try {
- ImageCodecInfo codecInfo = FindEncoder(clsid);
- java.util.Iterator iter = imageio.ImageIO.getImageWritersByMIMEType( codecInfo.MimeType );
- codec = CreateWriter(iter);
- }
- catch {}
-
- if (codec == null) {
- ImageFormat format = ClsidToImageFormat(clsid);
- string name = (format != null) ? format.ToString() : clsid.ToString();
- throw new NotSupportedException(String.Format("The '{0}' format encoder is not installed.", name));
- }
-
- return codec;
- }
-
- private static ImageCodec CreateWriter(java.util.Iterator iter) {
- if ( !iter.hasNext() )
- return null;
-
- ImageCodec imageCodec = new ImageCodec();
- imageCodec.NativeWriter = (imageio.ImageWriter) iter.next();
- return imageCodec;
- }
-
- #endregion
-
- #region Codec enumerations
-
- internal static Hashtable Decoders {
- get {
- const string MYNAME = "System.Drawing.Imaging.ImageCodecInfo.decoders";
- Hashtable o = (Hashtable) AppDomain.CurrentDomain.GetData (MYNAME);
- if (o != null)
- return o;
- o = new ReaderSpiIterator().Iterate();
- AppDomain.CurrentDomain.SetData(MYNAME, o);
- return o;
- }
- }
-
- internal static Hashtable Encoders {
- get {
- const string MYNAME = "System.Drawing.Imaging.ImageCodecInfo.encoders";
- Hashtable o = (Hashtable) AppDomain.CurrentDomain.GetData (MYNAME);
- if (o != null)
- return o;
- o = new WriterSpiIterator().Iterate();
- AppDomain.CurrentDomain.SetData(MYNAME, o);
- return o;
- }
- }
-
- internal static ImageCodecInfo FindEncoder (Guid clsid) {
- ImageCodecInfo codec = (ImageCodecInfo) Encoders[clsid];
- if (codec == null) {
- // .net saves in png if cannot find requested encoder. atc id 316563
- codec = (ImageCodecInfo) Encoders[ ImageCodec.PngClsid ];
- }
- return codec;
- }
-
- internal static ImageCodecInfo FindDecoder (Guid clsid) {
- ImageCodecInfo codec = (ImageCodecInfo) Decoders[clsid];
- if (codec == null) {
- ImageFormat format = ClsidToImageFormat(clsid);
- string name = (format != null) ? format.ToString() : clsid.ToString();
- throw new NotSupportedException(String.Format("The '{0}' format decoder is not installed.", name));
- }
- return codec;
- }
-
- #endregion
-
- #region SpiIterators
-
- abstract class BaseSpiIterator {
- protected abstract java.util.Iterator GetIterator (string mimeType);
- protected abstract spi.ImageReaderWriterSpi GetNext (java.util.Iterator iter);
-
- #region ProcessOneCodec
- private ImageCodecInfo ProcessOneCodec (Guid clsid, Guid formatID, string mimeType) {
- ImageCodecInfo ici = new ImageCodecInfo ();
- ici.Clsid = clsid;
- ici.FormatID = formatID;
- ici.MimeType = mimeType;
- java.util.Iterator iter = null;
- try {
- iter = GetIterator (mimeType);
- }
- catch(Exception) {
- return null;
- }
- while (iter.hasNext ()) {
- spi.ImageReaderWriterSpi rw = GetNext (iter);
-
- ici.CodecName = rw.getDescription (java.util.Locale.getDefault ());
- //ici.DllName = null;
- foreach (string suffix in rw.getFileSuffixes ()) {
- if (ici.FilenameExtension != null)
- ici.FilenameExtension += ";";
- ici.FilenameExtension += "*."+suffix;
- }
- ici.Flags = ImageCodecFlags.Builtin|ImageCodecFlags.SupportBitmap;
- if (rw is spi.ImageReaderSpi)
- ici.Flags |= ImageCodecFlags.Decoder;
-
- if (rw is spi.ImageWriterSpi)
- ici.Flags |= ImageCodecFlags.Encoder;
-
- ici.FormatDescription = string.Join(";",
- rw.getFormatNames());
- try {
- ici.Version = (int)Convert.ToDouble(rw.getVersion ());
- }
- catch (Exception) {
- ici.Version = 1;
- }
- break;
- }
- return ici;
- }
- #endregion
-
- internal Hashtable Iterate () {
- // TBD: Insert Exception handling here
- NameValueCollection nvc = (NameValueCollection) System.Configuration.ConfigurationSettings
- .GetConfig ("mainsoft.drawing/codecs");
- Hashtable codecs = new Hashtable (10);
-
- for (int i=0; i 0) {
- thArray = new awt.Image[ tmbNumber ];
-
- for (int i = 0; i < tmbNumber; i++) {
- thArray[i] = NativeReader.readThumbnail(frameIndex, i);
- }
- }
- }
- return thArray;
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-#endif
- internal void WritePlainImage(PlainImageCollection pic) {
- if ((pic == null) || (pic.Count == 0))
- return;
-
- if (pic.Count == 1) {
- WritePlainImage( pic[0] );
- return;
- }
-
- try {
- if (NativeWriter.canWriteSequence ()) {
- NativeWriter.prepareWriteSequence (null);
- for (int i=0; i < pic.Count; i++) {
- imageio.IIOImage iio = GetIIOImageContainer( pic[i] );
- NativeWriter.writeToSequence (iio, null);
- }
- NativeWriter.endWriteSequence ();
- }
- else
- WritePlainImage( pic[0] );
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-
- internal void WritePlainImage(PlainImage pi) {
- try {
- imageio.IIOImage iio = GetIIOImageContainer( pi );
- WriteImage( iio );
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-
- private void WriteImage(imageio.IIOImage iio) {
- if (NativeStream == null)
- throw new Exception("Output stream not specified");
-
- NativeWriter.write( iio );
- }
-
- private imageio.IIOImage GetIIOImageContainer(PlainImage pi) {
- java.util.ArrayList al = null;
-
- // prepare thumbnails list
- if (pi.Thumbnails != null) {
- al = new java.util.ArrayList( pi.Thumbnails.Length );
- for (int i=0; i < pi.Thumbnails.Length; i++)
- al.add(pi.Thumbnails[i]);
- }
-
- // prepare IIOImage container
- if (pi.NativeImage is image.BufferedImage) {
- imageio.IIOImage iio = new javax.imageio.IIOImage(
- (image.BufferedImage)pi.NativeImage, al, null /*pi.NativeMetadata*/);
- return iio;
- }
- else
- // TBD: This codec is for raster formats only
- throw new NotSupportedException("Only raster formats are supported");
- }
-
-
- private imageio.metadata.IIOMetadata ReadImageMetadata(int frameIndex) {
- if (NativeStream == null)
- throw new Exception("Input stream not specified");
-
- try {
- imageio.metadata.IIOMetadata md = NativeReader.getImageMetadata( frameIndex );
- return md;
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-
- #endregion
-
- #region Extra properties
-
- public ImageFormat ImageFormat {
- get { return _imageFormat; }
- }
-
- #endregion
-
- #region Metadata parse
-
- private float [] GetResolution(XmlDocument metaData) {
- if (metaData == null)
- return new float[]{0, 0};
-
- ResolutionConfigurationCollection rcc =
- (ResolutionConfigurationCollection)
- ConfigurationSettings.GetConfig ("mainsoft.drawing/codecsmetadata");
-
- if (rcc == null)
- throw new ConfigurationException("Configuration section codecsmetadata not found");
-
- ResolutionConfiguration rc = rcc[ ImageFormat.ToString() ];
-
- if (rc == null)
- return new float[]{0, 0};
-
- // Horizontal resolution
- string xResPath = rc.XResPath;
- string xRes;
-
- if (xResPath == string.Empty)
- xRes = rc.XResDefault;
- else
- xRes = GetValueFromMetadata(metaData, xResPath);
-
- if ((xRes == null) || (xRes == string.Empty))
- xRes = rc.XResDefault;
-
- // Vertical resolution
- string yResPath = rc.YResPath;
- string yRes;
-
- if (yResPath == string.Empty)
- yRes = rc.YResDefault;
- else
- yRes = GetValueFromMetadata(metaData, yResPath);
-
- if ((yRes == null) || (yRes == string.Empty))
- yRes = rc.YResDefault;
-
- // Resolution units
- string resUnitsPath = rc.UnitsTypePath;
- string resUnitsType;
-
- if (resUnitsPath == string.Empty)
- resUnitsType = rc.UnitsTypeDefault;
- else
- resUnitsType = GetValueFromMetadata(metaData, resUnitsPath);
-
- if (resUnitsType == null)
- resUnitsType = rc.UnitsTypeDefault;
-
- // Unit scale
- string unitScale = rc.UnitsScale[resUnitsType].ToString();
-
- // Adjust resolution to its units
- float [] res = new float[2];
- res[0] = ParseFloatValue(xRes) * ParseFloatValue(unitScale);
- res[1] = ParseFloatValue(yRes) * ParseFloatValue(unitScale);
-
- return res;
- }
-
- private string GetValueFromMetadata(XmlDocument metaData, string path) {
- XmlNode n = metaData.SelectSingleNode(path);
- if (n == null)
- return null;
-
- return n.InnerText;
- }
-
- private XmlDocument ConvertImageMetadata(imageio.metadata.IIOMetadata metaData) {
- string [] formatNames = metaData.getMetadataFormatNames();
- dom.Element rootNode = (dom.Element) metaData.getAsTree(formatNames[0]);
-
- XmlDocument _metadataDocument = new XmlDocument();
- XmlConvert(rootNode, _metadataDocument);
-
- return _metadataDocument;
- }
-
- private void XmlConvert(dom.Node jNode, XmlNode nNode) {
- XmlDocument document = nNode.OwnerDocument;
- if (document == null)
- document = (XmlDocument)nNode;
-
- XmlNode n = null;
- switch (jNode.getNodeType()) {
- case 1 :
- n = document.CreateNode(XmlNodeType.Element, jNode.getNodeName(), jNode.getNamespaceURI());
- break;
-
- case 4 :
- n = document.CreateNode(XmlNodeType.CDATA, jNode.getNodeName(), jNode.getNamespaceURI());
- break;
-
- default:
- return;
- }
- //set value
- n.InnerText = jNode.getNodeValue();
- nNode.AppendChild( n );
-
- //copy attributes
- org.w3c.dom.NamedNodeMap nm = jNode.getAttributes();
- for (int i=0; i
- /// Summary description for FontCollection.
- ///
- public abstract class FontCollection : IDisposable
- {
- private readonly Hashtable _fonts;
-
- protected FontCollection()
- {
- _fonts = CollectionsUtil.CreateCaseInsensitiveHashtable( new Hashtable() );
- }
-
- protected FontCollection(Hashtable fonts) {
- _fonts = fonts;
- }
-
- public FontFamily[] Families {
- get {
- ICollection values = _fonts.Keys;
- FontFamily[] families = new FontFamily[values.Count];
-
- string [] keys = new string[_fonts.Count];
- _fonts.Keys.CopyTo(keys, 0);
-
- for (int i = 0; i < _fonts.Count; i++)
- families[i] = new FontFamily( keys[i] );
-
- return families;
- }
- }
-
- internal virtual awt.Font GetInitialFont(string familyName) {
- return (awt.Font)_fonts[familyName];
- }
-
- internal virtual bool Contains(string familyName) {
- return _fonts.ContainsKey( familyName );
- }
-
- protected void AddFont(awt.Font font) {
- _fonts.Add(font.getFamily(), font);
- }
-
- #region IDisposable Members
-
- public void Dispose() {
- // TODO: Add FontCollection.Dispose implementation
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/LineLayout.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Text/LineLayout.jvm.cs
deleted file mode 100644
index 6da75b537a..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Text/LineLayout.jvm.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// System.Drawing.Test.LineLayout.jvm.cs
-//
-// Author:
-// Konstantin Triger
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-using font = java.awt.font;
-using text = java.text;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing.Text {
-
- internal sealed class LineLayout {
-
- #region Fields
-
- readonly font.TextLayout _layout;
-
- readonly float _accumulatedHeight;
- readonly TextLineIterator _lineIter;
-
- #endregion
-
- #region ctor
-
- internal LineLayout(font.TextLayout layout,
- TextLineIterator lineIter,
- float accumulatedHeight) {
-
- _layout = layout;
- _lineIter = lineIter;
- _accumulatedHeight = accumulatedHeight;
- }
-
- #endregion
-
- #region Properties
-
- internal float AccumulatedHeight {
- get { return _accumulatedHeight; }
- }
-
- internal float MeasureWidth {
- get {
- return _lineIter.PadWidth (Width);
- }
- }
-
- internal float WidthPadding {
- get {
- return _lineIter.PadWidth (Width) - Width;
- }
- }
-
- internal int CharacterCount {
- get { return _layout.getCharacterCount(); }
- }
-
- internal float Ascent {
- get { return _layout.getAscent(); }
- }
-
- internal float Descent {
- get { return _layout.getDescent(); }
- }
-
- public float Leading {
- get { return _layout.getLeading(); }
- }
-
- internal float NativeY {
- get {
- if (_lineIter.Format.IsVertical) {
- float height = _lineIter.Height;
- if (float.IsPositiveInfinity(height))
- height = 0;
- switch (_lineIter.Format.Alignment) {
- case StringAlignment.Center:
- return (height - Width) / 2;
- case StringAlignment.Far:
- return height - _layout.getVisibleAdvance () - WidthPadding;
- default:
- return WidthPadding;
- }
- }
- else
- return AccumulatedHeight + Ascent;
- }
- }
-
- internal float NativeX {
- get {
- float width = _lineIter.Width;
- if (float.IsPositiveInfinity(width))
- width = 0;
- if (_lineIter.Format.IsVertical)
- return (_lineIter.Format.IsRightToLeft) ?
- width - AccumulatedHeight - Ascent :
- AccumulatedHeight + Leading + Descent;
- else {
- float xOffset;
- switch ( _lineIter.Format.Alignment) {
- case StringAlignment.Center:
- xOffset = (width - Width) / 2;
- break;
- case StringAlignment.Far:
- if (_lineIter.Format.IsRightToLeft)
- xOffset = WidthPadding/2;
- else
- xOffset = width - _layout.getVisibleAdvance () - WidthPadding/2;
- break;
- default:
- if (_lineIter.Format.IsRightToLeft)
- xOffset = width - _layout.getVisibleAdvance () - WidthPadding/2;
- else
- xOffset = WidthPadding / 2;
- break;
- }
-
- return xOffset;
- }
- }
- }
-
- internal float Height {
- get {
- return Ascent + Descent + Leading;
- }
- }
-
- internal float Width {
- get {
- if (_lineIter.Format.MeasureTrailingSpaces)
- if (!(_lineIter.Format.IsRightToLeft ^
- (_lineIter.Format.Alignment == StringAlignment.Far)))
- return _layout.getAdvance();
-
- return _layout.getVisibleAdvance();
- }
- }
-
- #endregion
-
- #region Methods
-
- internal void Draw(awt.Graphics2D g2d, float x, float y) {
- if (_lineIter.Format.IsVertical)
- _layout.draw (g2d, y + NativeY, -(x + NativeX));
- else
- _layout.draw(g2d, x + NativeX, y + NativeY );
- }
-
- internal awt.Shape GetOutline(float x, float y) {
- geom.AffineTransform t = (geom.AffineTransform) _lineIter.Transform.clone();
-
- if (_lineIter.Format.IsVertical)
- t.translate(y + NativeY, -(x + NativeX));
- else
- t.translate(x + NativeX, y + NativeY);
-
- return _layout.getOutline(t);
- }
-
- #endregion
- }
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/TextLineIterator.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Text/TextLineIterator.jvm.cs
deleted file mode 100644
index 6be27b7029..0000000000
--- a/mcs/class/System.Drawing/System.Drawing.Text/TextLineIterator.jvm.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// System.Drawing.Test.TextLineIterator.jvm.cs
-//
-// Author:
-// Konstantin Triger
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-using font = java.awt.font;
-using text = java.text;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing.Text {
- internal sealed class TextLineIterator {
-
- #region Fields
-
- readonly float _width;
- readonly float _height;
- readonly StringFormat _format;
- readonly font.FontRenderContext _frc;
- readonly string _s;
- readonly Font _font;
- readonly float _margin;
-
- static readonly string NewLine;
-
- static readonly geom.AffineTransform Rotate90Transform =
- geom.AffineTransform.getRotateInstance(Math.PI/2);
-
- font.TextMeasurer _measurer;
- int _charsConsumed = 0;
- int _currentPos = 0;
- int _currentRun = 0;
- float _accumulatedHeight = 0;
-
- #endregion
-
- #region ctors
-
- static TextLineIterator() {
- string newLine = Environment.NewLine;
- if (newLine == null || newLine.Length == 0 || newLine[newLine.Length - 1] == '\n')
- newLine = "\n";
-
- NewLine = newLine;
- }
-
- internal TextLineIterator(string s, Font font, font.FontRenderContext frc, StringFormat format, float width, float height) {
- _format = (format != null) ? format : new StringFormat();
- _font = font;
- _s = (s != null) ? s : String.Empty;
- _frc = frc;
- FontFamily ff = font.FontFamily;
- _margin = font.Size*ff.GetDrawMargin(font.Style)/ff.GetEmHeight(font.Style);
-
- _width = width;
- _height = height;
- }
-
- #endregion
-
- #region Properties
-
- float WrapWidth
- {
- get {
- float widthOrHeight = _format.IsVertical ? Height : Width;
- if (!_format.IsGenericTypographic) {
- widthOrHeight =
- ((_format.IsVertical ? Height : Width) - (0.463f * FontSize)) / 1.028f;
- }
- return widthOrHeight;
- }
- }
-
- internal float WrapHeight {
- get {
- float widthOrHeight = _format.IsVertical ? Width : Height;
- if (!_format.IsGenericTypographic) {
- widthOrHeight = (_format.IsVertical ? Width : Height) / 1.08864f;
- }
- return widthOrHeight;
- }
- }
-
- internal float Width {
- get { return _width; }
- }
-
- internal float Height {
- get { return _height; }
- }
-
- internal StringFormat Format {
- get { return _format; }
- }
-
- internal float PadWidth (float origWidth)
- {
- if (Format.IsGenericTypographic)
- return origWidth;
-
- //This is a proximity to .NET calculated Width.
- return origWidth * 1.028f + 0.463f * FontSize;
- }
-
- internal float PadHeight (float origHeight)
- {
- if (Format.IsGenericTypographic)
- return origHeight;
-
- //This is a proximity to .NET calculated Height.
- return 1.08864f * origHeight;
- }
-
- internal float FontSize
- {
- get {
- return _font.Size;
- }
- }
-
- internal int CharsConsumed {
- get { return _charsConsumed; }
- }
-
- internal int CurrentRun {
- get { return _currentRun; }
- }
-
- internal int CurrentPosition {
- get { return _currentPos; }
- }
-
- internal float AccumulatedHeight {
- get { return _accumulatedHeight; }
- }
-
- internal float GetAdvanceBetween(int start, int limit) {
- return _measurer.getAdvanceBetween(start, limit);
- }
-
- internal geom.AffineTransform Transform {
- get { return Format.IsVertical ? Rotate90Transform : Matrix.IdentityTransform.NativeObject; }
- }
-
- #endregion
-
- #region Methods
-
- LineLayout NextTextLayoutFromMeasurer() {
- if (_accumulatedHeight >= WrapHeight) {
- _charsConsumed += _currentPos;
- return null;
- }
-
- int limit = _measurer.getLineBreakIndex(_currentPos, WrapWidth);
-
- int wordBreak = limit;
- if (wordBreak < _currentRun) {
- while (wordBreak >= _currentPos && char.IsLetterOrDigit(_s, _charsConsumed + wordBreak))
- wordBreak--;
-
- if (wordBreak > _currentPos)
- limit = wordBreak + 1;
- }
- font.TextLayout layout = _measurer.getLayout(_currentPos, limit);
-
- LineLayout lineLayout = new LineLayout(
- layout,
- this,
- _accumulatedHeight);
-
- float lineHeight = PadHeight (lineLayout.Ascent + lineLayout.Descent + lineLayout.Leading);
-
- if (Format.LineLimit && (_accumulatedHeight + lineHeight > WrapHeight)) {
- _charsConsumed += _currentPos;
- return null;
- }
-
- _accumulatedHeight += lineHeight + lineLayout.Leading;
-
- _currentPos = limit;
-
- while (_currentPos < _currentRun) {
- if (char.IsWhiteSpace(_s, _charsConsumed + _currentPos))
- _currentPos++;
- else
- break;
- }
- return lineLayout;
- }
-
- internal LineLayout NextLine() {
- if (_currentPos < _currentRun && !Format.NoWrap)
- return NextTextLayoutFromMeasurer();
-
- _charsConsumed += _currentRun;
- if (_charsConsumed >= _s.Length)
- return null;
-
- string s;
- int lineBreakIndex = _s.IndexOf(NewLine, _charsConsumed);
- if (lineBreakIndex >= 0) {
- s = _s.Substring(_charsConsumed, lineBreakIndex - _charsConsumed + NewLine.Length);
- }
- else
- s = _s.Substring(_charsConsumed);
-
- _currentRun = s.Length;
- _currentPos = 0;
-
- text.AttributedString aS = new text.AttributedString(s);
-
- // TODO: add more attribs according to StringFormat
- aS.addAttribute(font.TextAttribute.FONT, _font.NativeObject);
- if((_font.Style & FontStyle.Underline) != FontStyle.Regular)
- aS.addAttribute(font.TextAttribute.UNDERLINE, font.TextAttribute.UNDERLINE_ON);
- if((_font.Style & FontStyle.Strikeout) != FontStyle.Regular)
- aS.addAttribute(font.TextAttribute.STRIKETHROUGH, font.TextAttribute.STRIKETHROUGH_ON);
-
- text.AttributedCharacterIterator charIter = aS.getIterator();
-
- _measurer = new font.TextMeasurer(charIter, _frc);
- return NextTextLayoutFromMeasurer();
- }
-
- internal geom.AffineTransform CalcLineAlignmentTransform() {
- if (Format.LineAlignment == StringAlignment.Near)
- return null;
- float height = WrapHeight;
- if (float.IsPositiveInfinity(height))
- height = 0;
-
- float shift = height - AccumulatedHeight;
- if (height > 0 && shift <= 0)
- return null;
-
- if (Format.LineAlignment == StringAlignment.Center)
- shift /= 2;
- else
- if (Format.IsVertical && Format.IsRightToLeft)
- return null;
-
- return Format.IsVertical ?
- geom.AffineTransform.getTranslateInstance(shift, 0) :
- geom.AffineTransform.getTranslateInstance(0, shift);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/AdvancedStroke.jvm.cs b/mcs/class/System.Drawing/System.Drawing/AdvancedStroke.jvm.cs
deleted file mode 100644
index 92c9d40727..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/AdvancedStroke.jvm.cs
+++ /dev/null
@@ -1,554 +0,0 @@
-using System;
-using System.Drawing.Drawing2D;
-using java.lang;
-
-using java.awt;
-using java.awt.geom;
-using sun.dc.path;
-using sun.dc.pr;
-
-namespace System.Drawing {
-
- internal enum PenFit {
- NotThin,
- Thin,
- ThinAntiAlias
- }
-
- internal class AdvancedStroke : Stroke {
-
- public const float PenUnits = 0.01f;
- public const int MinPenUnits = 100;
- public const int MinPenUnitsAA = 20;
- public const float MinPenSizeAA = PenUnits * MinPenUnitsAA;
- public const double MinPenSizeAASquared = (MinPenSizeAA * MinPenSizeAA);
- public const double MinPenSizeSquared = 1.000000001;
- public const double MinPenSizeNorm = 1.5;
- public const double MinPenSizeSquaredNorm = (MinPenSizeNorm * MinPenSizeNorm);
-
- /**
- * Joins path segments by extending their outside edges until
- * they meet.
- */
- public const int JOIN_MITER = 0;
-
- /**
- * Joins path segments by rounding off the corner at a radius
- * of half the line width.
- */
- public const int JOIN_ROUND = 1;
-
- /**
- * Joins path segments by connecting the outer corners of their
- * wide outlines with a straight segment.
- */
- public const int JOIN_BEVEL = 2;
-
- /**
- * Ends unclosed subpaths and dash segments with no added
- * decoration.
- */
- public const int CAP_BUTT = 0;
-
- /**
- * Ends unclosed subpaths and dash segments with a round
- * decoration that has a radius equal to half of the width
- * of the pen.
- */
- public const int CAP_ROUND = 1;
-
- /**
- * Ends unclosed subpaths and dash segments with a square
- * projection that extends beyond the end of the segment
- * to a distance equal to half of the line width.
- */
- public const int CAP_SQUARE = 2;
-
- float width;
-
- int join;
- int cap;
- float miterlimit;
-
- float[] dash;
- float dash_phase;
-
- AffineTransform _penTransform;
- AffineTransform _outputTransform;
- PenFit _penFit;
-
- /**
- * Constructs a new AdvancedStroke with the specified
- * attributes.
- * @param width the width of this AdvancedStroke. The
- * width must be greater than or equal to 0.0f. If width is
- * set to 0.0f, the stroke is rendered as the thinnest
- * possible line for the target device and the antialias
- * hint setting.
- * @param cap the decoration of the ends of a AdvancedStroke
- * @param join the decoration applied where path segments meet
- * @param miterlimit the limit to trim the miter join. The miterlimit
- * must be greater than or equal to 1.0f.
- * @param dash the array representing the dashing pattern
- * @param dash_phase the offset to start the dashing pattern
- * @throws IllegalArgumentException if width is negative
- * @throws IllegalArgumentException if cap is not either
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE
- * @throws IllegalArgumentException if miterlimit is less
- * than 1 and join is JOIN_MITER
- * @throws IllegalArgumentException if join is not
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
- * @throws IllegalArgumentException if dash_phase
- * is negative and dash is not null
- * @throws IllegalArgumentException if the length of
- * dash is zero
- * @throws IllegalArgumentException if dash lengths are all zero.
- */
- public AdvancedStroke(float width, int cap, int join, float miterlimit,
- float[] dash, float dash_phase, AffineTransform penTransform,
- AffineTransform outputTransform, PenFit penFit) {
- if (width < 0.0f) {
- throw new IllegalArgumentException("negative width");
- }
- if (cap != CAP_BUTT && cap != CAP_ROUND && cap != CAP_SQUARE) {
- throw new IllegalArgumentException("illegal end cap value");
- }
- if (join == JOIN_MITER) {
- if (miterlimit < 1.0f) {
- throw new IllegalArgumentException("miter limit < 1");
- }
- } else if (join != JOIN_ROUND && join != JOIN_BEVEL) {
- throw new IllegalArgumentException("illegal line join value");
- }
- if (dash != null) {
- if (dash_phase < 0.0f) {
- throw new IllegalArgumentException("negative dash phase");
- }
- bool allzero = true;
- for (int i = 0; i < dash.Length; i++) {
- float d = dash[i];
- if (d > 0.0) {
- allzero = false;
- } else if (d < 0.0) {
- throw new IllegalArgumentException("negative dash length");
- }
- }
- if (allzero) {
- throw new IllegalArgumentException("dash lengths all zero");
- }
- }
- this.width = width;
- this.cap = cap;
- this.join = join;
- this.miterlimit = miterlimit;
- if (dash != null) {
- this.dash = (float []) dash.Clone();
- }
- this.dash_phase = dash_phase;
- this._penTransform = penTransform;
- this._outputTransform = outputTransform;
- this._penFit = penFit;
- }
-
- /**
- * Constructs a solid AdvancedStroke with the specified
- * attributes.
- * @param width the width of the AdvancedStroke
- * @param cap the decoration of the ends of a AdvancedStroke
- * @param join the decoration applied where path segments meet
- * @param miterlimit the limit to trim the miter join
- * @throws IllegalArgumentException if width is negative
- * @throws IllegalArgumentException if cap is not either
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE
- * @throws IllegalArgumentException if miterlimit is less
- * than 1 and join is JOIN_MITER
- * @throws IllegalArgumentException if join is not
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
- */
- public AdvancedStroke(float width, int cap, int join, float miterlimit) :
- this(width, cap, join, miterlimit, null, 0.0f, null, null, PenFit.NotThin) {
- }
-
- /**
- * Constructs a solid AdvancedStroke with the specified
- * attributes. The miterlimit parameter is
- * unnecessary in cases where the default is allowable or the
- * line joins are not specified as JOIN_MITER.
- * @param width the width of the AdvancedStroke
- * @param cap the decoration of the ends of a AdvancedStroke
- * @param join the decoration applied where path segments meet
- * @throws IllegalArgumentException if width is negative
- * @throws IllegalArgumentException if cap is not either
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE
- * @throws IllegalArgumentException if join is not
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER
- */
- public AdvancedStroke(float width, int cap, int join) :
- this(width, cap, join, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {
- }
-
- /**
- * Constructs a solid AdvancedStroke with the specified
- * line width and with default values for the cap and join
- * styles.
- * @param width the width of the AdvancedStroke
- * @throws IllegalArgumentException if width is negative
- */
- public AdvancedStroke(float width) :
- this(width, CAP_SQUARE, JOIN_MITER, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {
- }
-
- /**
- * Constructs a new AdvancedStroke with defaults for all
- * attributes.
- * The default attributes are a solid line of width 1.0, CAP_SQUARE,
- * JOIN_MITER, a miter limit of 10.0.
- */
- public AdvancedStroke() :
- this(1.0f, CAP_SQUARE, JOIN_MITER, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {
- }
-
-
- /**
- * Returns a Shape whose interior defines the
- * stroked outline of a specified Shape.
- * @param s the Shape boundary be stroked
- * @return the Shape of the stroked outline.
- */
- public Shape createStrokedShape(Shape s) {
- FillAdapter filler = new FillAdapter();
- PathStroker stroker = new PathStroker(filler);
- PathConsumer consumer;
-
- stroker.setPenDiameter(width);
- switch (_penFit) {
- case PenFit.Thin:
- stroker.setPenFitting(PenUnits, MinPenUnits);
- break;
- case PenFit.ThinAntiAlias:
- stroker.setPenFitting(PenUnits, MinPenUnitsAA);
- break;
- }
-
- float[] t4 = null;
- if (PenTransform != null && !PenTransform.isIdentity() && (PenTransform.getDeterminant() > 1e-25)) {
- t4 = new float[]{
- (float)PenTransform.getScaleX(), (float)PenTransform.getShearY(),
- (float)PenTransform.getShearX(), (float)PenTransform.getScaleY()
- };
- }
-
- float[] t6 = null;
- if (OutputTransform != null && !OutputTransform.isIdentity()) {
- t6 = new float[] {
- (float)OutputTransform.getScaleX(), (float)OutputTransform.getShearY(),
- (float)OutputTransform.getShearX(), (float)OutputTransform.getScaleY(),
- (float)OutputTransform.getTranslateX(), (float)OutputTransform.getTranslateY()
- };
- }
-
- stroker.setPenT4(t4);
- stroker.setOutputT6(t6);
- stroker.setCaps(RasterizerCaps[cap]);
- stroker.setCorners(RasterizerCorners[join], miterlimit);
- if (dash != null) {
- PathDasher dasher = new PathDasher(stroker);
- dasher.setDash(dash, dash_phase);
- dasher.setDashT4(t4);
- consumer = dasher;
- } else {
- consumer = stroker;
- }
-
- PathIterator pi = s.getPathIterator(null);
-
- try {
- consumer.beginPath();
- bool pathClosed = false;
- float mx = 0.0f;
- float my = 0.0f;
- float[] point = new float[6];
-
- while (!pi.isDone()) {
- int type = pi.currentSegment(point);
- if (pathClosed == true) {
- pathClosed = false;
- if (type != PathIterator__Finals.SEG_MOVETO) {
- // Force current point back to last moveto point
- consumer.beginSubpath(mx, my);
- }
- }
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_MOVETO:
- mx = point[0];
- my = point[1];
- consumer.beginSubpath(point[0], point[1]);
- break;
- case GraphicsPath.JPI.SEG_LINETO:
- consumer.appendLine(point[0], point[1]);
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- // Quadratic curves take two points
- consumer.appendQuadratic(point[0], point[1],
- point[2], point[3]);
- break;
- case GraphicsPath.JPI.SEG_CUBICTO:
- // Cubic curves take three points
- consumer.appendCubic(point[0], point[1],
- point[2], point[3],
- point[4], point[5]);
- break;
- case GraphicsPath.JPI.SEG_CLOSE:
- consumer.closedSubpath();
- pathClosed = true;
- break;
- }
- pi.next();
- }
-
- consumer.endPath();
- } catch (PathException e) {
- throw new InternalError("Unable to Stroke shape ("+
- e.Message+")");
- }
-
- return filler.getShape();
- }
-
- /**
- * Returns the line width. Line width is represented in user space,
- * which is the default-coordinate space used by Java 2D. See the
- * Graphics2D class comments for more information on
- * the user space coordinate system.
- * @return the line width of this AdvancedStroke.
- * @see Graphics2D
- */
- public float getLineWidth() {
- return width;
- }
-
- /**
- * Returns the end cap style.
- * @return the end cap style of this AdvancedStroke as one
- * of the static int values that define possible end cap
- * styles.
- */
- public int getEndCap() {
- return cap;
- }
-
- /**
- * Returns the line join style.
- * @return the line join style of the AdvancedStroke as one
- * of the static int values that define possible line
- * join styles.
- */
- public int getLineJoin() {
- return join;
- }
-
- /**
- * Returns the limit of miter joins.
- * @return the limit of miter joins of the AdvancedStroke.
- */
- public float getMiterLimit() {
- return miterlimit;
- }
-
- /**
- * Returns the array representing the lengths of the dash segments.
- * Alternate entries in the array represent the user space lengths
- * of the opaque and transparent segments of the dashes.
- * As the pen moves along the outline of the Shape
- * to be stroked, the user space
- * distance that the pen travels is accumulated. The distance
- * value is used to index into the dash array.
- * The pen is opaque when its current cumulative distance maps
- * to an even element of the dash array and transparent otherwise.
- * @return the dash array.
- */
- public float[] getDashArray() {
- if (dash == null) {
- return null;
- }
-
- return (float[]) dash.Clone();
- }
-
- /**
- * Returns the current dash phase.
- * The dash phase is a distance specified in user coordinates that
- * represents an offset into the dashing pattern. In other words, the dash
- * phase defines the point in the dashing pattern that will correspond to
- * the beginning of the stroke.
- * @return the dash phase as a float value.
- */
- public float getDashPhase() {
- return dash_phase;
- }
-
- /**
- * Returns the hashcode for this stroke.
- * @return a hash code for this stroke.
- */
- public override int GetHashCode() {
- int hash = Float.floatToIntBits(width);
- hash = hash * 31 + join;
- hash = hash * 31 + cap;
- hash = hash * 31 + Float.floatToIntBits(miterlimit);
- if (dash != null) {
- hash = hash * 31 + Float.floatToIntBits(dash_phase);
- for (int i = 0; i < dash.Length; i++) {
- hash = hash * 31 + Float.floatToIntBits(dash[i]);
- }
- }
- return hash;
- }
-
- /**
- * Returns true if this AdvancedStroke represents the same
- * stroking operation as the given argument.
- */
- /**
- * Tests if a specified object is equal to this AdvancedStroke
- * by first testing if it is a AdvancedStroke and then comparing
- * its width, join, cap, miter limit, dash, and dash phase attributes with
- * those of this AdvancedStroke.
- * @param obj the specified object to compare to this
- * AdvancedStroke
- * @return true if the width, join, cap, miter limit, dash, and
- * dash phase are the same for both objects;
- * false otherwise.
- */
- public override bool Equals(object obj) {
- if (!(obj is AdvancedStroke)) {
- return false;
- }
-
- AdvancedStroke bs = (AdvancedStroke) obj;
- if (width != bs.width) {
- return false;
- }
-
- if (join != bs.join) {
- return false;
- }
-
- if (cap != bs.cap) {
- return false;
- }
-
- if (miterlimit != bs.miterlimit) {
- return false;
- }
-
- if (dash != null) {
- if (dash_phase != bs.dash_phase) {
- return false;
- }
-
- if (!java.util.Arrays.equals(dash, bs.dash)) {
- return false;
- }
- }
- else if (bs.dash != null) {
- return false;
- }
-
- return true;
- }
-
- public AffineTransform PenTransform {
- get{
- return _penTransform;
- }
- set{
- _penTransform = value;
- }
- }
-
- public AffineTransform OutputTransform {
- get {
- return _outputTransform;
- }
- set {
- _outputTransform = value;
- }
- }
-
- private static readonly int[] RasterizerCaps = {
- Rasterizer.BUTT, Rasterizer.ROUND, Rasterizer.SQUARE
- };
-
- private static readonly int[] RasterizerCorners = {
- Rasterizer.MITER, Rasterizer.ROUND, Rasterizer.BEVEL
- };
-
- #region FillAdapter
-
- private class FillAdapter : PathConsumer {
- bool closed;
- GeneralPath path;
-
- public FillAdapter() {
- path = new GeneralPath(GeneralPath.WIND_NON_ZERO);
- }
-
- public Shape getShape() {
- return path;
- }
-
- public void beginPath() {}
-
- public void beginSubpath(float x0, float y0) {
- if (closed) {
- path.closePath();
- closed = false;
- }
- path.moveTo(x0, y0);
- }
-
- public void appendLine(float x1, float y1) {
- path.lineTo(x1, y1);
- }
-
- public void appendQuadratic(float xm, float ym, float x1, float y1) {
- path.quadTo(xm, ym, x1, y1);
- }
-
- public void appendCubic(float xm, float ym,
- float xn, float yn,
- float x1, float y1) {
- path.curveTo(xm, ym, xn, yn, x1, y1);
- }
-
- public void closedSubpath() {
- closed = true;
- }
-
- public void endPath() {
- if (closed) {
- path.closePath();
- closed = false;
- }
- }
-
- public virtual PathConsumer getConsumer () {
- return this;
- }
-
- public void useProxy(FastPathProducer proxy) {
- proxy.sendTo(this);
- }
-
- public long getCPathConsumer() {
- return 0;
- }
-
- public void dispose() {
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/BasicShape.jvm.cs b/mcs/class/System.Drawing/System.Drawing/BasicShape.jvm.cs
deleted file mode 100644
index 5aad895321..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/BasicShape.jvm.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing
-{
- ///
- /// Summary description for BasicShape.
- ///
- public abstract class BasicShape : MarshalByRefObject, awt.Shape, IDisposable
- {
- awt.Shape _shape;
-
- protected BasicShape(awt.Shape shape)
- {
- _shape = shape;
- }
-
- protected awt.Shape Shape {
- get {
- return _shape;
- }
- set {
- _shape = value;
- }
- }
-
- #region IDisposable
- public void Dispose () {
- Dispose (true);
- }
-
- void Dispose (bool disposing) {
- }
- #endregion
-
- #region Shape Members
-
- awt.Rectangle awt.Shape.getBounds() {
- return Shape.getBounds();
- }
-
- bool awt.Shape.contains(double arg_0, double arg_1) {
- return Shape.contains(arg_0, arg_1);
- }
-
- bool awt.Shape.contains(geom.Point2D arg_0) {
- return Shape.contains(arg_0);
- }
-
- bool awt.Shape.contains(double arg_0, double arg_1, double arg_2, double arg_3) {
- return Shape.contains(arg_0, arg_1, arg_2, arg_3);
- }
-
- bool awt.Shape.contains(geom.Rectangle2D arg_0) {
- return Shape.contains(arg_0);
- }
-
- geom.PathIterator awt.Shape.getPathIterator(geom.AffineTransform arg_0) {
- return Shape.getPathIterator(arg_0);
- }
-
- geom.PathIterator awt.Shape.getPathIterator(geom.AffineTransform arg_0, double arg_1) {
- return Shape.getPathIterator(arg_0, arg_1);
- }
-
- geom.Rectangle2D awt.Shape.getBounds2D() {
- return Shape.getBounds2D();
- }
-
- bool awt.Shape.intersects(double arg_0, double arg_1, double arg_2, double arg_3) {
- return Shape.intersects(arg_0, arg_1, arg_2, arg_3);
- }
-
- bool awt.Shape.intersects(geom.Rectangle2D arg_0) {
- return Shape.intersects(arg_0);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs
deleted file mode 100644
index 126e36145d..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Bitmap.jvm.cs
+++ /dev/null
@@ -1,427 +0,0 @@
-using System;
-using System.IO;
-using System.Drawing.Imaging;
-using System.Runtime.Serialization;
-using Mainsoft.Drawing.Imaging;
-
-using io = java.io;
-using imageio = javax.imageio;
-using stream = javax.imageio.stream;
-using spi = javax.imageio.spi;
-using BufferedImage = java.awt.image.BufferedImage;
-using JavaImage = java.awt.Image;
-using awt = java.awt;
-using image = java.awt.image;
-
-namespace System.Drawing
-{
- public sealed class Bitmap : Image {
-
- # region Static fields
-
- static readonly image.ColorModel _jpegColorModel = new image.DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
-
- #endregion
-
- #region constructors
-
- Bitmap (PlainImage orig) {
- base.Initialize( orig, false );
- }
-
- [MonoTODO]
- private Bitmap (SerializationInfo info, StreamingContext context) {
- throw new NotImplementedException ();
- }
-
- public Bitmap (int width, int height, Graphics g)
- :this (width, height, PixelFormat.Format32bppArgb) {
- CurrentImage.HorizontalResolution = g.DpiX;
- CurrentImage.VerticalResolution = g.DpiY;
- }
-
- public Bitmap (Image original)
- :this (original, original.Size) {}
-
- public Bitmap (Image orig, Size newSize)
- :this (orig, newSize.Width, newSize.Height) {}
-
- public Bitmap (Image orig, int width, int height)
- :base (CreateScaledImage (orig, width, height), ImageFormat.MemoryBmp) {}
-
- internal Bitmap (java.awt.Image nativeObject, ImageFormat format)
- :base (nativeObject, format) {}
-
- [MonoTODO]
- private Bitmap (java.awt.Image nativeObject, ImageFormat format, PixelFormat pixFormat)
- :this (nativeObject, format) {
- if (pixFormat != this.PixelFormat)
- throw new NotImplementedException ("Converting PixelFormat is not implemented yet.");
- }
-
- public Bitmap (int width, int height)
- :this (width, height, PixelFormat.Format32bppArgb) {}
-
- public Bitmap (int width, int height, PixelFormat format)
- :base (
- new java.awt.image.BufferedImage (width, height,
- ToBufferedImageFormat (format)),
- ImageFormat.Bmp) {
- }
-
- public Bitmap (Stream stream)
- :this (stream, false) {}
-
- public Bitmap (string filename)
- :this (filename, false) {}
-
- [MonoTODO]
- public Bitmap (Stream stream, bool useIcm)
- :this (stream, useIcm, null) {}
-
- [MonoTODO]
- public Bitmap (string filename, bool useIcm)
- :this (filename, useIcm, null) {}
-
- internal Bitmap (Stream stream, bool useIcm, ImageFormat format) {
- // TBD: useIcm param
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (stream);
- Initialize (new stream.MemoryCacheImageInputStream (jis), format);
- }
-
- internal Bitmap (string filename, bool useIcm, ImageFormat format) {
- using(FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
- // TBD: useIcm param
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (stream);
- Initialize (new stream.MemoryCacheImageInputStream (jis), format);
- }
- }
-
- public Bitmap (Type type, string resource) {
- using (Stream s = type.Assembly.GetManifestResourceStream (resource)) {
- if (s == null)
- throw new ArgumentException("Resource '" + resource + "' could not be found in class '" + type.ToString() + "'");
-
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (s);
- Initialize (new stream.MemoryCacheImageInputStream (jis), null);
- }
- }
-#if INTPTR_SUPPORT
- [MonoTODO]
- public Bitmap (int width, int height, int stride, PixelFormat format, IntPtr scan0)
- {
- throw new NotImplementedException();
- }
-#endif
- #endregion
-
- #region Internal Initialization
-
- private void Initialize (stream.ImageInputStream input, ImageFormat format) {
- ImageCodec ic = null;
-
- if (format == null)
- ic = ImageCodec.CreateReader(input);
- else
- ic = ImageCodec.CreateReader(format);
-
- if (ic == null)
- throw new ArgumentException ("Parameter is not valid.");
-
- try {
- ic.NativeStream = input;
- PlainImage pi = ic.ReadPlainImage();
- base.Initialize( pi, false );
-
- pi = ic.ReadNextPlainImage();
- while ( pi != null) {
- base.Initialize( pi, true );
- pi = ic.ReadNextPlainImage();
- }
-
- _flags |= (int)(ImageFlags.ImageFlagsReadOnly | ImageFlags.ImageFlagsHasRealPixelSize);
- }
- catch (IOException ex) {
- throw ex;
- }
- finally {
- ic.Dispose();
- }
- }
-
- #endregion
-
- #region InternalSave
- protected override void InternalSave (stream.ImageOutputStream output, Guid clsid) {
-
- ImageCodec ic = ImageCodec.CreateWriter( clsid );
- using (ic) {
-
- PlainImage plainImage = CurrentImage;
- plainImage.NativeImage.flush();
-
- if ( ImageCodec.ClsidToImageFormat( clsid ).Equals( ImageFormat.Jpeg ) ) {
- image.ColorModel cm = ((image.BufferedImage)CurrentImage.NativeImage).getColorModel();
- if (cm.hasAlpha()) {
- if (cm is image.DirectColorModel) {
- image.Raster raster = ((image.BufferedImage)CurrentImage.NativeImage).getRaster();
- image.DataBuffer db = raster.getDataBuffer();
- image.DirectColorModel dcm = (image.DirectColorModel)cm;
- image.SinglePixelPackedSampleModel jpegSampleModel = new image.SinglePixelPackedSampleModel(
- db.getDataType(), Width, Height,
- new int[] {dcm.getRedMask(), dcm.getGreenMask(), dcm.getBlueMask()} );
-
- image.BufferedImage tb = new image.BufferedImage(
- _jpegColorModel,
- image.Raster.createWritableRaster( jpegSampleModel, db, null ),
- false, null );
-
- plainImage = new PlainImage( tb, plainImage.Thumbnails, ImageFormat.Jpeg, plainImage.HorizontalResolution, plainImage.VerticalResolution, plainImage.Dimension );
- plainImage.NativeMetadata = plainImage.NativeMetadata;
- }
- }
- }
-
- ic.NativeStream = output;
- ic.WritePlainImage( plainImage );
- }
- }
-
- #endregion
-
- #region private statics: ToBufferedImageFormat, CreateScaledImage
-
- private static int ToBufferedImageFormat (PixelFormat format) {
- switch(format) {
- case PixelFormat.Format16bppGrayScale:
- return BufferedImage.TYPE_USHORT_GRAY;
- case PixelFormat.Format1bppIndexed:
- return BufferedImage.TYPE_BYTE_GRAY;
- case PixelFormat.Format32bppArgb:
- return BufferedImage.TYPE_INT_ARGB;
- case PixelFormat.Format32bppRgb:
- return BufferedImage.TYPE_INT_RGB;
- case PixelFormat.Format32bppPArgb:
- return BufferedImage.TYPE_INT_ARGB_PRE;
- case PixelFormat.Format16bppRgb555:
- return BufferedImage.TYPE_USHORT_555_RGB;
- case PixelFormat.Format16bppRgb565:
- return BufferedImage.TYPE_USHORT_565_RGB;
- case PixelFormat.Indexed:
- return BufferedImage.TYPE_BYTE_INDEXED;
- default:
- return BufferedImage.TYPE_INT_ARGB;
- }
- }
-
- private static java.awt.Image CreateScaledImage(Image original, int width, int height) {
- JavaImage oldscaled = original.CurrentImage.NativeImage.getScaledInstance(width, height,
- JavaImage.SCALE_DEFAULT);
- BufferedImage newimage = new BufferedImage(oldscaled.getWidth(null),
- oldscaled.getHeight(null),
- BufferedImage.TYPE_INT_ARGB);
- java.awt.Graphics2D graphics2d = newimage.createGraphics();
- graphics2d.drawImage(oldscaled, 0, 0, null);
- graphics2d.dispose();
- return newimage;
- }
- #endregion
-
- #region Get-SetPixel
- public Color GetPixel (int x, int y)
- {
-
- int argb = NativeObject.getRGB(x,y);
- return Color.FromArgb(argb);
- }
-
- public void SetPixel (int x, int y, Color color)
- {
- int rgb = color.ToArgb();
- NativeObject.setRGB(x,y,rgb);
- }
- #endregion
-
- #region Clone
- public override object Clone () {
- return new Bitmap ( (PlainImage)CurrentImage.Clone() );
- }
-
- public Bitmap Clone (Rectangle rect, PixelFormat pixFormat)
- {
- return Clone(new RectangleF( rect.X, rect.Y, rect.Width, rect.Height ), pixFormat);
- }
-
- public Bitmap Clone (RectangleF rect, PixelFormat pixFormat)
- {
- PlainImage plainImage = CurrentImage.Clone(false);
- BufferedImage clone = new BufferedImage( (int)rect.Width, (int)rect.Height, ToBufferedImageFormat( pixFormat ) );
- awt.Graphics2D g = clone.createGraphics();
- try {
- g.drawImage( NativeObject, -(int)rect.X, -(int)rect.Y, null );
- }
- finally {
- g.dispose();
- }
-
- plainImage.NativeImage = clone;
- return new Bitmap(plainImage);
- }
- #endregion
-
- #region LockBits
- [MonoTODO]
- public BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format) {
- throw new NotImplementedException();
- }
-
-#if NET_2_0
- public
-#endif
- BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData) {
- throw new NotImplementedException();
- }
- #endregion
-
- #region MakeTransparent
- public void MakeTransparent ()
- {
- Color clr = Color.FromArgb(0,0,0);
- MakeTransparent (clr);
- }
-
- public void MakeTransparent (Color transparentColor)
- {
- image.WritableRaster raster = NativeObject.getRaster();
- int numBands = raster.getNumBands();
- if (numBands != 4)
- return;
-
- int maxWidth = raster.getWidth() + raster.getMinX();
- int maxHeight = raster.getHeight() + raster.getMinY();
- int[] srcPix = new int[numBands];
-
- for (int y = raster.getMinY(); y < maxHeight; y++) {
- for (int x = raster.getMinX(); x < maxWidth; x++) {
- /*srcPix =*/ raster.getPixel(x, y, srcPix);
- if (srcPix[0] == transparentColor.R &&
- srcPix[1] == transparentColor.G &&
- srcPix[2] == transparentColor.B) {
- srcPix[3] = 0;
- raster.setPixel(x, y, srcPix);
- }
- }
- }
- }
- #endregion
-
- #region SetResolution
- public void SetResolution (float xDpi, float yDpi)
- {
- CurrentImage.HorizontalResolution = xDpi;
- CurrentImage.VerticalResolution = yDpi;
- }
- #endregion
-
- #region UnlockBits
- [MonoTODO]
- public void UnlockBits (BitmapData bitmap_data)
- {
- throw new NotImplementedException();
- }
- #endregion
-
- #region NativeObject
- internal new BufferedImage NativeObject {
- get {
- return (BufferedImage)base.NativeObject.CurrentImage.NativeImage;
- }
- }
-
- protected override java.awt.Image[] CloneNativeObjects(java.awt.Image[] src) {
- if (src == null)
- return null;
-
- awt.Image[] dst = new awt.Image[src.Length];
- for (int i = 0; i < dst.Length; i++) {
- BufferedImage image = src[i] as BufferedImage;
- if (image == null)
- throw new ArgumentException(String.Format("Unsupported image type '{0}'", src[i].ToString()), "src");
-
- dst[i] = new BufferedImage(image.getColorModel(), image.copyData(null), image.isAlphaPremultiplied(), null);
- }
-
- return dst;
- }
-
- #endregion
-
- #region InternalPixelFormat
- protected override PixelFormat InternalPixelFormat {
- get {
- int t = NativeObject.getType();
- switch(t) {
- case 11://JavaImage.TYPE_USHORT_GRAY:
- return PixelFormat.Format16bppGrayScale;
- case 10://JavaImage.TYPE_BYTE_GRAY:
- return PixelFormat.Format8bppIndexed;
- case 1: //JavaImage.TYPE_INT_RGB
- return PixelFormat.Format32bppRgb;
- case 2: //JavaImage.TYPE_INT_ARGB:
- return PixelFormat.Format32bppArgb;
- case 3://JavaImage.TYPE_INT_ARGB_PRE:
- return PixelFormat.Format32bppPArgb;
- case 9://JavaImage.TYPE_USHORT_555_RGB:
- return PixelFormat.Format16bppRgb555;
- case 8://JavaImage.TYPE_USHORT_565_RGB:
- return PixelFormat.Format16bppRgb565;
- case 13://JavaImage.TYPE_BYTE_INDEXED:
- return PixelFormat.Indexed;
- //TBD: support this
- case 12://JavaImage.TYPE_BYTE_BINARY:
- case 0://JavaImage.TYPE_CUSTOM:
- case 4://JavaImage.TYPE_INT_BGR:
- case 5://JavaImage.TYPE_3BYTE_BGR:
- case 6://JavaImage.TYPE_4BYTE_ABGR:
- case 7://JavaImage.TYPE_4BYTE_ABGR_PRE:
- default:
- return PixelFormat.Undefined;
- }
- }
- }
- #endregion
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static Bitmap FromHicon (IntPtr hicon)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static Bitmap FromResource (IntPtr hinstance, string bitmapName) //TBD: Untested
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHbitmap ()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHbitmap (Color background)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHicon ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Brush.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Brush.jvm.cs
deleted file mode 100644
index 8ec1ed5368..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Brush.jvm.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Collections;
-
-using awt = java.awt;
-using image = java.awt.image;
-using geom = java.awt.geom;
-
-
-namespace System.Drawing
-{
- public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable, awt.Paint {
-
- #region fields
-
- private Matrix _brushTransform = new Matrix();
-
- #endregion
-
- protected abstract java.awt.Paint NativeObject {
- get;
- }
-
- awt.PaintContext awt.Paint.createContext (image.ColorModel cm,
- awt.Rectangle deviceBounds, geom.Rectangle2D userBounds, geom.AffineTransform xform,
- awt.RenderingHints hints) {
-
- return createContextInternal(cm, deviceBounds, userBounds, xform, hints);
- }
-
- protected virtual awt.PaintContext createContextInternal (image.ColorModel cm,
- awt.Rectangle deviceBounds, geom.Rectangle2D userBounds, geom.AffineTransform xform,
- awt.RenderingHints hints) {
-
- Matrix.Multiply(xform, _brushTransform.NativeObject, MatrixOrder.Append);
- return NativeObject.createContext (cm, deviceBounds, userBounds, xform, hints);
- }
-
- int awt.Transparency.getTransparency () {
- return NativeObject.getTransparency ();
- }
-
- abstract public object Clone ();
-
- public void Dispose () {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing) {
- }
-
- protected Brush InternalClone() {
- Brush brush = (Brush)this.MemberwiseClone();
- brush._brushTransform = this._brushTransform.Clone();
- return brush;
- }
-
- #region Brush transform
-
- internal Matrix BrushTransform {
- get { return _brushTransform.Clone(); }
- set {
- if (value == null)
- throw new ArgumentNullException("matrix");
-
- value.CopyTo( _brushTransform );
- }
- }
-
- protected internal void BrushTranslateTransform (float dx, float dy) {
- BrushTranslateTransform(dx, dy, MatrixOrder.Prepend);
- }
- protected internal void BrushTranslateTransform (float dx, float dy, MatrixOrder order) {
- _brushTransform.Translate(dx,dy,order);
- }
- protected internal void BrushResetTransform () {
- _brushTransform.Reset();
- }
- protected internal void BrushRotateTransform (float angle) {
- BrushRotateTransform(angle, MatrixOrder.Prepend);
- }
- protected internal void BrushRotateTransform (float angle, MatrixOrder order) {
- _brushTransform.Rotate(angle, order);
- }
- protected internal void BrushScaleTransform (float sx, float sy) {
- BrushScaleTransform(sx, sy, MatrixOrder.Prepend);
- }
- protected internal void BrushScaleTransform (float sx, float sy, MatrixOrder order) {
- _brushTransform.Scale(sx, sy, order);
- }
- protected internal void BrushMultiplyTransform (Matrix matrix) {
- BrushMultiplyTransform(matrix, MatrixOrder.Prepend);
- }
- protected internal void BrushMultiplyTransform (Matrix matrix, MatrixOrder order) {
- if (matrix == null)
- throw new ArgumentNullException("matrix");
- _brushTransform.Multiply(matrix, order);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/Color.cs b/mcs/class/System.Drawing/System.Drawing/Color.cs
index 3f5235d3af..6c62a9f080 100644
--- a/mcs/class/System.Drawing/System.Drawing/Color.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Color.cs
@@ -42,9 +42,7 @@ namespace System.Drawing
#if ONLY_1_1
[ComVisible (true)]
#endif
-#if !TARGET_JVM
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
-#endif
[Serializable]
public struct Color {
@@ -71,29 +69,6 @@ namespace System.Drawing
// however it's bad to keep a string (reference) in a struct
internal string name;
// #endif
-#if TARGET_JVM
- internal java.awt.Color NativeObject {
- get {
- return new java.awt.Color (R, G, B, A);
- }
- }
-
- internal static Color FromArgbNamed (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgb (alpha, red, green, blue);
- color.state = (short) (ColorType.Known|ColorType.Named);
- color.name = KnownColors.GetName (knownColor);
- color.knownColor = (short) knownColor;
- return color;
- }
-
- internal static Color FromArgbSystem (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgbNamed (alpha, red, green, blue, name, knownColor);
- color.state |= (short) ColorType.System;
- return color;
- }
-#endif
public string Name {
get {
diff --git a/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs b/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
index 7cd02aeae1..2a49f6f945 100644
--- a/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
+++ b/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
@@ -225,15 +225,10 @@ namespace System.Drawing
lock (creatingCached) {
if (cached != null)
return cached;
-#if TARGET_JVM
- Color [] colors = new Color [KnownColors.Values.Length - 1];
- Array.Copy (KnownColors.Values, 1, colors, 0, colors.Length);
-#else
Array colors = Array.CreateInstance (typeof (Color), KnownColors.ArgbValues.Length - 1);
for (int i=1; i < KnownColors.ArgbValues.Length; i++) {
colors.SetValue (KnownColors.FromKnownColor ((KnownColor)i), i - 1);
}
-#endif
Array.Sort (colors, 0, colors.Length, new CompareColors ());
cached = new StandardValuesCollection (colors);
diff --git a/mcs/class/System.Drawing/System.Drawing/Font.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Font.jvm.cs
deleted file mode 100644
index 4a622f090f..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Font.jvm.cs
+++ /dev/null
@@ -1,382 +0,0 @@
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-using awt = java.awt;
-using TextAttribute = java.awt.font.TextAttribute;
-
-namespace System.Drawing {
- [Serializable]
- public sealed class Font: MarshalByRefObject, ISerializable, ICloneable, IDisposable {
-
- #region variables
-
- const byte DEFAULT_CHARSET = 1;
-
- private readonly GraphicsUnit _gUnit = GraphicsUnit.Point;
- private readonly FontFamily _fontFamily;
- private readonly awt.Font _jFont;
- private readonly byte _charset;
-
- static readonly float [] _screenResolutionConverter = {
- 1, // World
- 1, // Display
- 1, // Pixel
- Graphics.DefaultScreenResolution, // Point
- Graphics.DefaultScreenResolution, // Inch
- Graphics.DefaultScreenResolution, // Document
- Graphics.DefaultScreenResolution // Millimeter
- };
-
-#if NET_2_0
- private readonly string _systemFontName;
-#endif
-
- #endregion
-
- internal awt.Font NativeObject {
- get {
- return _jFont;
- }
- }
-
- #region ISerializable
-
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) {
- info.AddValue("Name", Name);
- info.AddValue("Size", Size);
- info.AddValue("Style", Style, typeof(FontStyle));
- info.AddValue("Unit", Unit, typeof(GraphicsUnit));
- }
-
- #endregion
-
- #region ctors
-
- private Font (SerializationInfo info, StreamingContext context)
- : this(
- info.GetString("Name"),
- info.GetSingle("Size"),
- (FontStyle)info.GetValue("Style", typeof(FontStyle)),
- (GraphicsUnit)info.GetValue("Unit", typeof(GraphicsUnit)) ) {
- }
-
- public Font(Font original, FontStyle style) {
- _jFont = original.NativeObject.deriveFont( DeriveStyle(original.NativeObject.getAttributes(), style, true) );
- _gUnit = original._gUnit;
- _fontFamily = original._fontFamily;
- _charset = original._charset;
- }
-
- public Font(FontFamily family, float emSize)
- : this(family, emSize, FontStyle.Regular, GraphicsUnit.Point, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style)
- : this(family, emSize, style, GraphicsUnit.Point, DEFAULT_CHARSET, false) {
- }
- public Font(FontFamily family, float emSize, GraphicsUnit unit)
- : this(family, emSize, FontStyle.Regular, unit, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit)
- : this(family, emSize, style, unit, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
- : this(family, emSize, style, unit, charSet, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical) {
- if (family == null)
- throw new ArgumentNullException("family");
-
- _gUnit = unit;
- _fontFamily = family;
- _charset = charSet;
-
- java.util.Hashtable attribs = new java.util.Hashtable();
- attribs.put(TextAttribute.FAMILY, family.Name/*TODO: family doungrade possibility*/);
- //init defaults
- attribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
-
- float newSize = emSize * Graphics.UnitConversion[ (int)_gUnit ];
- attribs.put(TextAttribute.SIZE, new java.lang.Float(newSize));
-
- DeriveStyle(attribs, style, false);
-
- _jFont = family.FamilyFont.deriveFont(attribs);
- }
-
- public Font(string familyName, float emSize)
- : this(familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style)
- : this(familyName, emSize, style, GraphicsUnit.Point, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, GraphicsUnit unit)
- : this(familyName, emSize, FontStyle.Regular, unit, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit)
- : this(familyName, emSize, style, unit, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
- : this(familyName, emSize, style, unit, charSet, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)
- : this (GetFontFamily (familyName), emSize, style, unit, charSet, isVertical) {
- }
-
-#if NET_2_0
- internal Font (string familyName, float emSize, string systemName)
- : this (familyName, emSize) {
- _systemFontName = systemName;
- }
-#endif
-
- static FontFamily GetFontFamily (string familyName) {
-#if ONLY_1_1
- if (familyName == null)
- throw new ArgumentNullException ("familyName");
-#endif
- // NOTE: If family name is null, empty or invalid,
- // MS creates Microsoft Sans Serif font.
- try {
- return new FontFamily (familyName);
- }
- catch {
- return FontFamily.GenericSansSerif;
- }
- }
-
- #endregion
-
- #region IDisposable members
-
- public void Dispose() {
- }
-
- #endregion
-
- #region ICloneable
-
- public object Clone() {
- return (Font)MemberwiseClone();
- }
-
- #endregion
-
- public override bool Equals (object obj)
- {
- Font other = obj as Font;
- if (other == null) {
- return false;
- }
-
- return NativeObject.Equals (other.NativeObject);
- }
-
- public override int GetHashCode ()
- {
- return NativeObject.GetHashCode ();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public IntPtr ToHfont ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- #region public properties
-
- public bool Bold {
- get {
- return _jFont.isBold();
- }
- }
-
- public FontFamily FontFamily {
- get {
- return _fontFamily;
- }
- }
-
- public byte GdiCharSet {
- get {
- return _charset;
- }
- }
-
- public bool GdiVerticalFont {
- get {
- return Name.StartsWith("@");
- }
- }
-
- public int Height {
- get {
- return FontFamily.Container.getFontMetrics(NativeObject).getHeight();
- }
- }
-
- public float GetHeight () {
- return GetHeight (Graphics.DefaultScreenResolution);
- }
-
- public float GetHeight (float dpi) {
- return (FontFamily.GetLineSpacing (Style) / FontFamily.GetEmHeight (Style))
- * (SizeInPoints / _screenResolutionConverter [(int) Unit])
- * dpi;
- }
-
- public float GetHeight (Graphics graphics) {
- if (graphics == null)
- throw new ArgumentNullException ("graphics");
- return GetHeight (graphics.DpiY);
- }
-
- public bool Italic {
- get {
- return _jFont.isItalic();
- }
- }
-
- public string Name {
- get {
- return _jFont.getName();
- }
- }
-
- public float Size {
- get {
- return SizeInPoints / Graphics.UnitConversion[ (int)_gUnit ];
- }
- }
-
- public float SizeInPoints {
- get {
- return _jFont.getSize2D();
- }
- }
-
- public bool Strikeout {
- get {
- try {
- if((java.lang.Boolean)_jFont.getAttributes().get(TextAttribute.STRIKETHROUGH)
- == TextAttribute.STRIKETHROUGH_ON )
- return true;
- }
- catch {
- }
- return false;
- }
- }
-
- public FontStyle Style {
- get {
- FontStyle style = FontStyle.Regular;
- if (Bold)
- style |= FontStyle.Bold;
- if (Italic)
- style |= FontStyle.Italic;
- if (Underline)
- style |= FontStyle.Underline;
- if (Strikeout)
- style |= FontStyle.Strikeout;
-
- return style;
- }
- }
-
- public bool Underline {
- get {
- try {
- if((java.lang.Integer)_jFont.getAttributes().get(TextAttribute.UNDERLINE)
- == TextAttribute.UNDERLINE_ON )
- return true;
- }
- catch {
- }
- return false;
- }
- }
-
- [TypeConverter(typeof(FontConverter.FontUnitConverter))]
- public GraphicsUnit Unit {
- get {
- return _gUnit;
- }
- }
-
-#if NET_2_0
- [Browsable (false)]
- public bool IsSystemFont {
- get {
- return !string.IsNullOrEmpty (_systemFontName);
- }
- }
-
- [Browsable (false)]
- public string SystemFontName {
- get {
- return _systemFontName;
- }
- }
-#endif
-
- #endregion
-
- public override System.String ToString() {
- return ("[Font: Name="+ Name +", Size="+ Size +", Style="+ Style +", Units="+ Unit +"]");
- }
-
- static internal java.util.Map DeriveStyle(java.util.Map attribs, FontStyle style, bool createNew) {
- java.util.Map newAttribs;
- if (createNew) {
- newAttribs = new java.util.Hashtable( attribs.size() );
- java.util.Iterator it = attribs.keySet().iterator();
- while (it.hasNext ()) {
- object key = it.next ();
- object value = attribs.get (key);
- if (value != null)
- newAttribs.put (key, value);
- }
- }
- else
- newAttribs = attribs;
-
- //Bold
- if((style & FontStyle.Bold) == FontStyle.Bold)
- newAttribs.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
- else
- newAttribs.remove(TextAttribute.WEIGHT);
-
- //Italic
- if((style & FontStyle.Italic) == FontStyle.Italic)
- newAttribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
- else
- newAttribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
-
- //Underline
- if((style & FontStyle.Underline) == FontStyle.Underline)
- newAttribs.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
- else
- newAttribs.remove(TextAttribute.UNDERLINE);
-
- //Strikeout
- if((style & FontStyle.Strikeout) == FontStyle.Strikeout)
- newAttribs.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
- else
- newAttribs.remove(TextAttribute.STRIKETHROUGH);
-
- return newAttribs;
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/FontConverter.cs b/mcs/class/System.Drawing/System.Drawing/FontConverter.cs
index 22baf05498..7998c487ec 100644
--- a/mcs/class/System.Drawing/System.Drawing/FontConverter.cs
+++ b/mcs/class/System.Drawing/System.Drawing/FontConverter.cs
@@ -46,12 +46,10 @@ namespace System.Drawing
public FontConverter ()
{
}
-#if !TARGET_JVM
~FontConverter ()
{
// required to match API definition
}
-#endif
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof (string))
diff --git a/mcs/class/System.Drawing/System.Drawing/FontFamily.jvm.cs b/mcs/class/System.Drawing/System.Drawing/FontFamily.jvm.cs
deleted file mode 100644
index 9004274376..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/FontFamily.jvm.cs
+++ /dev/null
@@ -1,233 +0,0 @@
-//
-// System.Drawing.FontFamily.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Text;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Globalization;
-using awt = java.awt;
-using geom = java.awt.geom;
-using font = java.awt.font;
-using TextAttribute = java.awt.font.TextAttribute;
-
-namespace System.Drawing {
-
- public sealed class FontFamily : MarshalByRefObject, IDisposable {
-
- static readonly FontFamily _genericMonospace;
- static readonly FontFamily _genericSansSerif;
- static readonly FontFamily _genericSerif;
- static readonly FontCollection _installedFonts;
- internal static readonly awt.Container Container;
-
- static FontFamily() {
- Container = new awt.Container();
- _installedFonts = new InstalledFontCollection();
- _genericMonospace = new FontFamily(GenericFontFamilies.Monospace);
- _genericSansSerif = new FontFamily(GenericFontFamilies.SansSerif);
- _genericSerif = new FontFamily(GenericFontFamilies.Serif);
- }
-
- private readonly string _name;
-
- private awt.FontMetrics _fontMetrics = null;
- private FontStyle _lastStyle = FontStyle.Regular;
- private readonly awt.Font _font;
-
- // this is unavailable through Java API, usually 2048 for TT fonts
- const int UnitsPerEm = 2048;
- // the margin for text drawing
- const int DrawMargin = 571;
-
- #region ctors
-
- // dummy ctors to work around convertor problems
- internal FontFamily() {}
- internal FontFamily(IntPtr family) {}
-
- static string ToGenericFontName(GenericFontFamilies genericFamily) {
- switch(genericFamily) {
- case GenericFontFamilies.SansSerif:
- return "SansSerif";
- case GenericFontFamilies.Serif:
- return "Serif";
- default:
- return "Monospaced";
- }
- }
-
- public FontFamily(string familyName) : this(familyName, null) {
- }
-
- public FontFamily(string name, FontCollection fontCollection) {
- if (name == null)
- throw new ArgumentNullException("name");
-
- if (fontCollection == null)
- fontCollection = _installedFonts;
-
- if (fontCollection.Contains(name))
- _name = name;
- else {
- _name = ToGenericFontName(GenericFontFamilies.SansSerif);
- fontCollection = _installedFonts;
- }
-
- _font = fontCollection.GetInitialFont( _name );
- }
-
- public FontFamily(GenericFontFamilies genericFamily) : this(ToGenericFontName(genericFamily)) {
- }
-
- #endregion
-
- public string Name {
- get {
- return _name;
- }
- }
-
- internal int GetDrawMargin(FontStyle style) {
- return DrawMargin;
- }
-
- awt.FontMetrics GetMetrics(FontStyle style) {
- if ((_lastStyle != style) || (_fontMetrics == null)) {
- java.util.Map attrib = Font.DeriveStyle( FamilyFont.getAttributes(), style, true);
- attrib.put(TextAttribute.SIZE, new java.lang.Float((float)(UnitsPerEm<<1)));
- _fontMetrics = Container.getFontMetrics( FamilyFont.deriveFont( attrib ) );
- }
- return _fontMetrics;
- }
-
- public int GetCellAscent(FontStyle style) {
- return GetMetrics(style).getMaxAscent()>>1;
- }
-
- public int GetCellDescent(FontStyle style) {
- return GetMetrics(style).getMaxDecent()>>1;
- }
-
- public int GetEmHeight(FontStyle style) {
- return UnitsPerEm;
- }
-
- public int GetLineSpacing(FontStyle style) {
- return GetMetrics(style).getHeight()>>1;
- }
-
- public string GetName(int language) {
- try {
- CultureInfo culture = new CultureInfo(language, false);
- java.util.Locale locale = vmw.@internal.EnvironmentUtils.getLocaleFromCultureInfo( culture );
-
- return FamilyFont.getFamily( locale );
- }
- catch {
- return Name;
- }
- }
-
- public bool IsStyleAvailable(FontStyle style) {
- //unable to get this infromation from java
- return true;
- }
-
- #region static members
-
- public static FontFamily[] Families {
- get {
- return _installedFonts.Families;
- }
- }
-
- public static FontFamily GenericMonospace {
- get {
- return (FontFamily)_genericMonospace.MemberwiseClone();
- }
- }
-
- public static FontFamily GenericSansSerif {
- get {
- return (FontFamily)_genericSansSerif.MemberwiseClone();
- }
- }
-
- public static FontFamily GenericSerif {
- get {
- return (FontFamily)_genericSerif.MemberwiseClone();
- }
- }
-
- public static FontFamily[] GetFamilies(Graphics graphics) {
- if (graphics == null) {
- throw new ArgumentNullException("graphics");
- }
- return _installedFonts.Families;
- }
-
- #endregion
-
- #region Object members
-
- public override bool Equals(object obj) {
- if (this == obj)
- return true;
-
- if (!(obj is FontFamily))
- return false;
-
- return string.Compare(Name, ((FontFamily)obj).Name, true) == 0;
- }
-
- public override int GetHashCode() {
- return Name.ToLower().GetHashCode();
- }
-
- public override string ToString() {
- return string.Format("[{0}: Name={1}]", GetType().Name, Name);
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose() {
- }
-
- #endregion
-
- internal awt.Font FamilyFont {
- get {
- return _font;
- }
- }
- }
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.jvm.cs
deleted file mode 100644
index 05becc8075..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Graphics.jvm.cs
+++ /dev/null
@@ -1,2628 +0,0 @@
-using System;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.Drawing.Text;
-using System.ComponentModel;
-using System.Collections;
-using System.Runtime.InteropServices;
-using System.Text;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing {
- [ComVisible(false)]
- public sealed class Graphics : MarshalByRefObject, IDisposable {
- sealed class DummyStroke : awt.Stroke {
- #region Stroke Members
-
- awt.Shape awt.Stroke.createStrokedShape(awt.Shape arg_0) {
- throw new NotImplementedException("DummyStroke");
- }
-
- #endregion
- }
-
- sealed class NormalizingPathIterator : geom.PathIterator {
-
- #region fields
-
- readonly geom.PathIterator _iter;
-
- const float norm = 0.5f;
- const float rnd = (1.0f - norm);
- float ax = 0.0f;
- float ay = 0.0f;
-
- #endregion
-
- #region ctor
-
- public NormalizingPathIterator(geom.PathIterator iter) {
- _iter = iter;
- }
-
- #endregion
-
- #region methods
-
- static int GetIndex(int type) {
- int index;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- index = 4;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- index = 2;
- break;
- case GraphicsPath.JPI.SEG_MOVETO:
- case GraphicsPath.JPI.SEG_LINETO:
- index = 0;
- break;
- case GraphicsPath.JPI.SEG_CLOSE:
- default:
- index = -1;
- break;
- }
-
- return index;
- }
-
- #endregion
-
- #region PathIterator Members
-
- void geom.PathIterator.next() {
- _iter.next();
- }
-
- bool geom.PathIterator.isDone() {
- return _iter.isDone();
- }
-
- int geom.PathIterator.currentSegment(float[] point) {
- int type = _iter.currentSegment(point);
-
- int index = GetIndex(type);
-
- if (index >= 0) {
- float ox = point[index];
- float oy = point[index+1];
- float newax = (float) java.lang.Math.floor(ox + rnd) + norm;
- float neway = (float) java.lang.Math.floor(oy + rnd) + norm;
- point[index] = newax;
- point[index+1] = neway;
- newax -= ox;
- neway -= oy;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- point[0] += ax;
- point[1] += ay;
- point[2] += newax;
- point[3] += neway;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- point[0] += (newax + ax) / 2;
- point[1] += (neway + ay) / 2;
- break;
- // case GraphicsPath.JPI.SEG_MOVETO:
- // case GraphicsPath.JPI.SEG_LINETO:
- // case GraphicsPath.JPI.SEG_CLOSE:
- // break;
- }
- ax = newax;
- ay = neway;
- }
-
- return type;
- }
-
- int geom.PathIterator.currentSegment(double[] point) {
- int type = _iter.currentSegment(point);
-
- int index = GetIndex(type);
-
- if (index >= 0) {
- float ox = (float)point[index];
- float oy = (float)point[index+1];
- float newax = (float)java.lang.Math.floor(ox + rnd) + norm;
- float neway = (float)java.lang.Math.floor(oy + rnd) + norm;
- point[index] = newax;
- point[index+1] = neway;
- newax -= ox;
- neway -= oy;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- point[0] += ax;
- point[1] += ay;
- point[2] += newax;
- point[3] += neway;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- point[0] += (newax + ax) / 2;
- point[1] += (neway + ay) / 2;
- break;
- // case GraphicsPath.JPI.SEG_MOVETO:
- // case GraphicsPath.JPI.SEG_LINETO:
- // case GraphicsPath.JPI.SEG_CLOSE:
- // break;
- }
- ax = newax;
- ay = neway;
- }
-
- return type;
- }
-
- int geom.PathIterator.getWindingRule() {
- return _iter.getWindingRule();
- }
-
- #endregion
-
- }
-
-
- #region Variables
-
- readonly awt.Graphics2D _nativeObject;
- PixelOffsetMode _pixelOffsetMode = PixelOffsetMode.Default;
- int _textContrast = 4;
- TextRenderingHint _textRenderingHint;
- readonly Image _image;
-
- readonly Matrix _transform;
- GraphicsUnit _pageUnit = GraphicsUnit.Display;
- float _pageScale = 1.0f;
-
- readonly Region _clip;
- readonly awt.Rectangle _windowRect;
-
- GraphicsState _nextGraphicsState = null;
-
- static readonly float [] _unitConversion = {
- 1, // World
- 1, // Display
- 1, // Pixel
- DefaultScreenResolution / 72.0f, // Point
- DefaultScreenResolution, // Inch
- DefaultScreenResolution / 300.0f,// Document
- DefaultScreenResolution / 25.4f // Millimeter
- };
-
- static int _isHeadless;
- static internal bool IsHeadless {
- get {
- if (_isHeadless == 0) {
- bool isHeadless = awt.GraphicsEnvironment.isHeadless();
- if (!isHeadless) {
- try {
- awt.Toolkit.getDefaultToolkit();
- }
- catch{
- isHeadless = true;
- }
- }
-
- _isHeadless = isHeadless ? 2 : 1;
- }
-
- return _isHeadless > 1;
- }
- }
-
- #endregion
-
-#if INTPTR_SUPPORT
- [ComVisible(false)]
- public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
- int flags,
- int dataSize,
- IntPtr data,
- PlayRecordCallback callbackData);
- [ComVisible (false)]
- public delegate bool DrawImageAbort (IntPtr callbackData);
-#endif
-
- #region Constr. and Destr.
- private Graphics (Image image) {
- _nativeObject = (awt.Graphics2D)image.NativeObject.CurrentImage.NativeImage.getGraphics();
- _image = image;
- _transform = new Matrix ();
-
- NativeObject.setStroke(new DummyStroke());
- NativeObject.setRenderingHint(awt.RenderingHints.KEY_COLOR_RENDERING, awt.RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-
- InterpolationMode = InterpolationMode.Bilinear;
- TextRenderingHint = TextRenderingHint.SystemDefault;
-
- _windowRect = new awt.Rectangle(_image.Width, _image.Height);
- _clip = new Region();
- }
-
- #endregion
-
- #region Internal Accessors
-
- static internal float [] UnitConversion {
- get {
- return _unitConversion;
- }
- }
-
- static internal int DefaultScreenResolution {
- get {
- return IsHeadless ? 96 :
- awt.Toolkit.getDefaultToolkit().getScreenResolution();
- }
- }
-
- internal java.awt.Graphics2D NativeObject {
- get {
- return _nativeObject;
- }
- }
- #endregion
-
- #region FromImage (static accessor)
- public static Graphics FromImage (Image image) {
- return new Graphics(image);
- }
- #endregion
-
-
- #region Workers [INTERNAL]
- void DrawShape(Pen pen, awt.Shape shape) {
- if (pen == null)
- throw new ArgumentNullException("pen");
-
- if (StrokeFactory.CanCreateAdvancedStroke &&
- (!pen.CanCreateBasicStroke || !NeedsNormalization)) {
- geom.AffineTransform oldT = NativeObject.getTransform();
- NativeObject.setTransform(Matrix.IdentityTransform.NativeObject);
-
- try {
- geom.AffineTransform t = GetFinalTransform();
- if (!oldT.isIdentity()) {
- t = (geom.AffineTransform)t.clone();
- t.preConcatenate(oldT);
- }
-
- double widthsquared = pen.GetSquaredTransformedWidth(t);
-
- bool antiAlias = (SmoothingMode == SmoothingMode.AntiAlias);
-
- bool thin = (widthsquared <= (antiAlias ?
- AdvancedStroke.MinPenSizeAASquared :
- AdvancedStroke.MinPenSizeSquared));
-
- PenFit penFit = thin ? (antiAlias ? PenFit.ThinAntiAlias : PenFit.Thin) : PenFit.NotThin;
-
- if (NeedsNormalization) {
-
- bool normThin =
- widthsquared <= AdvancedStroke.MinPenSizeSquaredNorm;
-
- if (normThin) {
- shape = GetNormalizedShape(shape, t);
- shape = pen.GetNativeObject(
- t, null, penFit).createStrokedShape(shape);
- }
- else {
- shape = pen.GetNativeObject(t, penFit).createStrokedShape(shape);
- shape = GetNormalizedShape(shape, null);
- }
- }
- else {
- shape = pen.GetNativeObject(t, penFit).createStrokedShape(shape);
- }
-
- FillScaledShape(pen.Brush, shape);
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- else {
- awt.Stroke oldStroke = NativeObject.getStroke();
- NativeObject.setStroke(pen.GetNativeObject(null, PenFit.NotThin));
- try {
-
- NativeObject.setPaint(pen.Brush);
-
- geom.AffineTransform oldT = NativeObject.getTransform();
- NativeObject.transform(GetFinalTransform());
- try {
- NativeObject.draw(shape);
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- finally {
- NativeObject.setStroke(oldStroke);
- }
- }
- }
- void FillShape(Brush paint, awt.Shape shape) {
- if (paint == null)
- throw new ArgumentNullException("brush");
-
- geom.AffineTransform oldT = null;
- if (NeedsNormalization) {
- oldT = NativeObject.getTransform();
- geom.AffineTransform t = GetFinalTransform();
- if (!oldT.isIdentity()) {
- t = (geom.AffineTransform) t.clone ();
- t.preConcatenate(oldT);
- }
- shape = GetNormalizedShape(shape, t);
- }
- else {
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- shape = t.createTransformedShape(shape);
- }
-
- if (oldT != null)
- NativeObject.setTransform(Matrix.IdentityTransform.NativeObject);
-
- try {
- FillScaledShape(paint, shape);
- }
- finally {
- if (oldT != null)
- NativeObject.setTransform(oldT);
- }
- }
-
- bool NeedsNormalization {
- get {
- return PixelOffsetMode != PixelOffsetMode.Half &&
- PixelOffsetMode != PixelOffsetMode.HighQuality;
- }
- }
-
- static awt.Shape GetNormalizedShape(awt.Shape shape, geom.AffineTransform t) {
- geom.PathIterator iter = new NormalizingPathIterator(shape.getPathIterator(t));
-
- geom.GeneralPath path = new geom.GeneralPath(iter.getWindingRule());
- path.append(iter, false);
- return path;
- }
-
- void FillScaledShape(Brush paint, awt.Shape shape) {
- Matrix m = null;
- if (!(paint is SolidBrush || paint is HatchBrush) && !_transform.IsIdentity) {
- m = paint.BrushTransform;
- paint.BrushMultiplyTransform( _transform );
- }
-
- try {
- NativeObject.setPaint(paint);
- NativeObject.fill(shape);
- }
- finally {
- if (m != null)
- paint.BrushTransform = m;
- }
- }
-
- #endregion
-
- #region Dispose
- public void Dispose() {
- NativeObject.dispose();
- }
- #endregion
-
- #region Clear
- public void Clear (Color color) {
- FillScaledShape(new SolidBrush( color ), _clip.NativeObject);
- }
- #endregion
-
- #region DrawArc
- public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle) {
- DrawArc (pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
-
- public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle) {
- DrawArc (pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- DrawArc(pen,
- (float)x,
- (float)y,
- (float)width,
- (float)height,
- (float)startAngle,
- (float)sweepAngle);
- }
-
- public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddArc(x, y, width, height, startAngle, sweepAngle);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawBezier(s)
- public void DrawBezier (Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4) {
- DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- public void DrawBezier (Pen pen, Point pt1, Point pt2, Point pt3, Point pt4) {
- DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- public void DrawBezier (Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) {
- geom.GeneralPath path = new geom.GeneralPath();
- path.moveTo(x1,y1);
- path.curveTo(x2,y2,x3,y3,x4,y4);
- DrawShape(pen, path);
- }
-
- public void DrawBeziers (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddBeziers(points);
- DrawPath(pen, path);
- }
-
- public void DrawBeziers (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddBeziers(points);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawClosedCurve
- public void DrawClosedCurve (Pen pen, PointF [] points) {
- DrawClosedCurve(pen, points, 0.5f, FillMode.Alternate);
- }
-
- public void DrawClosedCurve (Pen pen, Point [] points) {
- DrawClosedCurve(pen, points, 0.5f, FillMode.Alternate);
- }
-
- public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- DrawPath(pen, path);
- }
-
- public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawCurve
- public void DrawCurve (Pen pen, Point [] points) {
- DrawCurve(pen, points, 0.5f);
- }
-
- public void DrawCurve (Pen pen, PointF [] points) {
- DrawCurve(pen, points, 0.5f);
- }
-
- public void DrawCurve (Pen pen, PointF [] points, float tension) {
- DrawCurve(pen, points, 0, points.Length-1, tension);
- }
-
- public void DrawCurve (Pen pen, Point [] points, float tension) {
- DrawCurve(pen, points, 0, points.Length-1, tension);
- }
-
-
- public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments) {
- DrawCurve(pen, points, offset, numberOfSegments, 0.5f);
- }
-
- public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension) {
- GraphicsPath path = new GraphicsPath();
- path.AddCurve(points, offset, numberOfSegments, tension);
- DrawPath(pen, path);
- }
-
-
- public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension) {
- GraphicsPath path = new GraphicsPath();
- path.AddCurve(points, offset, numberOfSegments, tension);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawEllipse
- public void DrawEllipse (Pen pen, Rectangle rect) {
- DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawEllipse (Pen pen, RectangleF rect) {
- DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawEllipse (Pen pen, int x, int y, int width, int height) {
- DrawEllipse(pen,(float)x,(float)y,(float)width,(float)height);
- }
-
- public void DrawEllipse (Pen pen, float x, float y, float width, float height) {
- DrawShape(pen, new geom.Ellipse2D.Float(x,y,width,height));
- }
- #endregion
-
- #region DrawIcon
- public void DrawIcon (Icon icon, Rectangle targetRect) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImage (b, targetRect);
- }
-
- public void DrawIcon (Icon icon, int x, int y) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImage (b, x, y);
- }
-
- public void DrawIconUnstretched (Icon icon, Rectangle targetRect) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImageUnscaled (b, targetRect);
- }
- #endregion
-
- #region DrawImage
-
- public void DrawImage (Image image, Point point) {
- DrawImage(image, point.X, point.Y);
- }
-
- public void DrawImage (Image image, PointF point) {
- DrawImage(image, point.X, point.Y);
- }
-
-
- public void DrawImage (Image image, Point [] destPoints) {
- Matrix m = new Matrix(new Rectangle(0, 0, image.Width, image.Height), destPoints);
- DrawImage(image, m);
- }
-
- public void DrawImage (Image image, PointF [] destPoints) {
- Matrix m = new Matrix(new RectangleF(0, 0, image.Width, image.Height), destPoints);
- DrawImage(image, m);
- }
-
-
- public void DrawImage (Image image, Rectangle rect) {
- DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawImage (Image image, RectangleF rect) {
- DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
-
- public void DrawImage (Image image, int x, int y) {
- DrawImage(image, (float)x, (float)y);
- }
-
- public void DrawImage (Image image, float x, float y) {
- if ((image.HorizontalResolution != DpiX) || (image.VerticalResolution != DpiY))
- DrawImage( image, x, y,
- (float)image.Width * (DpiX / image.HorizontalResolution) / _unitConversion[(int)PageUnit],
- (float)image.Height * (DpiY / image.VerticalResolution) / _unitConversion[(int)PageUnit]) ;
- else
- DrawImage( image, x, y,
- (float)image.Width / _unitConversion[(int)PageUnit],
- (float)image.Height / _unitConversion[(int)PageUnit] );
- }
-
-
- public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(
- image,
- new Point [] {
- new Point( destRect.X, destRect.Y),
- new Point( destRect.X + destRect.Width, destRect.Y),
- new Point( destRect.X, destRect.Y + destRect.Height)},
- srcRect,
- srcUnit);
- }
-
- public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(
- image,
- new PointF [] {
- new PointF( destRect.X, destRect.Y),
- new PointF( destRect.X + destRect.Width, destRect.Y),
- new PointF( destRect.X, destRect.Y + destRect.Height)},
- srcRect,
- srcUnit);
- }
-
-
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, destPoints, srcRect, srcUnit, null);
- }
-
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, destPoints, srcRect, srcUnit, null);
- }
-
- [MonoLimitation("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: ImageAttributes
- if (srcUnit != GraphicsUnit.Pixel)
- throw new NotImplementedException();
- // Like in .NET http://dotnet247.com/247reference/msgs/45/227979.aspx
-
- Matrix mx = new Matrix(srcRect, destPoints);
-
- Region region = new Region(srcRect);
- DrawImage(image, mx, region);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: ImageAttributes
- if (srcUnit != GraphicsUnit.Pixel)
- throw new NotImplementedException();
- // Like in .NET http://dotnet247.com/247reference/msgs/45/227979.aspx
-
- Matrix mx = new Matrix(srcRect, destPoints);
-
- Region region = new Region(srcRect);
- DrawImage(image, mx, region);
- }
-
-
- public void DrawImage (Image image, int x, int y, int width, int height) {
- DrawImage(image, (float)x, (float)y, (float)width, (float)height);
- }
-
- public void DrawImage (Image image, float x, float y, float width, float height) {
- Matrix mx = new Matrix();
- mx.Translate((float)x, (float)y);
- mx.Scale(width / (float)image.Width, height / (float)image.Height);
-
- DrawImage( image, mx );
- }
-
-
- public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, new Rectangle(x, y, srcRect.Width, srcRect.Height), srcRect, srcUnit);
- }
-
- public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, new RectangleF(x, y, srcRect.Width, srcRect.Height), srcRect, srcUnit);
- }
-
-
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit) {
- DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit) {
- DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, null);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: attributes
- DrawImage(
- image,
- destRect,
- new Rectangle(srcX, srcY, srcWidth, srcHeight),
- srcUnit);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs) {
- //TBD: attributes
- DrawImage(
- image,
- destRect,
- new RectangleF(srcX, srcY, srcWidth, srcHeight),
- srcUnit);
- }
-
-
- public delegate bool DrawImageAbort (IntPtr callbackdata);
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- internal void DrawImage (Image image, Matrix m) {
- DrawImage(image, m, null);
- }
-
- internal void DrawImage (Image image, Matrix m, Region clip) {
- if (clip == null) {
- clip = new Region( new RectangleF( 0, 0, image.Width, image.Height ) );
- }
-
- geom.AffineTransform t = GetFinalTransform(_transform.NativeObject, PageUnit, 1.0f);
- if (!t.isIdentity())
- m.NativeObject.preConcatenate(t);
-
- clip.Transform( m );
-
- if (NeedsNormalization) {
- Matrix normMatrix = ComputeClipNormalization(clip.GetBounds(this));
- clip.Transform(normMatrix);
- }
-
- awt.Shape oldClip = NativeObject.getClip();
- IntersectScaledClipWithBase(clip);
-
- try {
- Matrix mm = ComputeImageNormalization(image, m);
- NativeObject.drawImage(image.NativeObject.CurrentImage.NativeImage, mm.NativeObject, null);
- }
- finally {
- NativeObject.setClip( oldClip );
- }
- }
-
- private static Matrix ComputeImageNormalization(Image img, Matrix m) {
- if ( m.IsIdentity )
- return m;
-
- //m.Translate( -(m.Elements[0] + m.Elements[2]) / 2.0f, -(m.Elements[3] + m.Elements[1]) / 2.0f, MatrixOrder.Append);
- m.Translate(
- -(float)(m.NativeObject.getScaleX() + m.NativeObject.getShearX()) / 2.0f,
- -(float)(m.NativeObject.getScaleY() + m.NativeObject.getShearY()) / 2.0f, MatrixOrder.Append);
-
- PointF [] p = new PointF[] {
- new PointF( 0, 0 ),
- new PointF( img.Width, 0 ),
- new PointF( 0, img.Height )};
-
- m.TransformPoints(p);
- for (int i=0; i < p.Length; i++) {
- p[i].X = (float)( p[i].X + 0.5f );
- p[i].Y = (float)( p[i].Y + 0.5f );
- }
-
- return new Matrix( new Rectangle(0, 0, img.Width, img.Height), p );
- }
- private static Matrix ComputeClipNormalization(RectangleF rect) {
- PointF [] p = new PointF[] {
- new PointF( rect.X, rect.Y ),
- new PointF( rect.X + rect.Width, rect.Y ),
- new PointF( rect.X, rect.Y + rect.Height )};
-
- for (int i=0; i < p.Length; i++) {
- p[i].X = (float)Math.Round( p[i].X + 0.5f ) + 0.5f;
- p[i].Y = (float)Math.Round( p[i].Y + 0.5f ) + 0.5f;
- }
-
- return new Matrix( rect, p );
- }
-
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
-
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException();
- }
-#endif
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException();
- }
-#endif
-
-#if INTPTR_SUPPORT
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,destRect.X,destRect.Y,destRect.Width,destRect.Height,srcX,srcY,srcWidth,srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- (int)destRect.X,
- (int)destRect.Y,
- (int)destRect.Width,
- (int)destRect.Height,
- (int)srcX,
- (int)srcY,
- (int)srcWidth,
- (int)srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- (int)destRect.X,
- (int)destRect.Y,
- (int)destRect.Width,
- (int)destRect.Height,
- (int)srcX,
- (int)srcY,
- (int)srcWidth,
- (int)srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- destRect.X,
- destRect.Y,
- destRect.Width,
- destRect.Height,
- srcX,
- srcY,
- srcWidth,
- srcHeight,null);
- }
-#endif
-
- public void DrawImageUnscaled (Image image, Point point)
- {
- DrawImageUnscaled (image, point.X, point.Y);
- }
-
- public void DrawImageUnscaled (Image image, Rectangle rect) {
- DrawImageUnscaled (image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawImageUnscaled (Image image, int x, int y) {
- DrawImage (image, x, y, image.Width, image.Height);
- }
-
- public void DrawImageUnscaled (Image image, int x, int y, int width, int height) {
- Image tmpImg = new Bitmap (width, height);
- Graphics g = FromImage (tmpImg);
- g.DrawImage (image, 0, 0, image.Width, image.Height);
- this.DrawImage (tmpImg, x, y, width, height);
- tmpImg.Dispose ();
- g.Dispose ();
- }
-
-#if NET_2_0
- [MonoNotSupported ("")]
- public void DrawImageUnscaledAndClipped (Image image, Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
-#endif
- #endregion
-
- #region DrawLine
- public void DrawLine (Pen pen, PointF pt1, PointF pt2) {
- DrawLine(pen,pt1.X,pt1.Y,pt2.X,pt2.Y);
- }
-
- public void DrawLine (Pen pen, Point pt1, Point pt2) {
- DrawLine(pen,(float)pt1.X,(float)pt1.Y,(float)pt2.X,(float)pt2.Y);
- }
-
- public void DrawLine (Pen pen, int x1, int y1, int x2, int y2) {
- DrawLine(pen,(float)x1,(float)y1,(float)x2,(float)y2);
- }
-
- public void DrawLine (Pen pen, float x1, float y1, float x2, float y2) {
- DrawShape(pen, new geom.Line2D.Float(x1,y1,x2,y2));
- }
-
- public void DrawLines (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines(points);
- DrawShape(pen, path);
- }
-
- public void DrawLines (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines(points);
- DrawShape(pen, path);
- }
- #endregion
-
- #region DrawPath
- public void DrawPath (Pen pen, GraphicsPath path) {
- DrawShape(pen, path);
- }
- #endregion
-
- #region DrawPie
- public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle) {
- DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle) {
- DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddPie(x, y, width, height, startAngle, sweepAngle);
- DrawPath(pen, path);
- }
-
- public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- DrawPie(pen,(float)x,(float)y,(float)width,(float)height,(float)startAngle,(float)sweepAngle);
- }
- #endregion
-
- #region DrawPolygon
- public void DrawPolygon (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddPolygon(points);
- DrawPath(pen, path);
- }
-
- public void DrawPolygon (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddPolygon(points);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawRectangle(s)
- internal void DrawRectangle (Pen pen, RectangleF rect) {
- DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void DrawRectangle (Pen pen, Rectangle rect) {
- DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void DrawRectangle (Pen pen, float x, float y, float width, float height) {
- DrawShape(pen, new geom.Rectangle2D.Float(x,y,width,height));
- }
-
- public void DrawRectangle (Pen pen, int x, int y, int width, int height) {
- DrawRectangle (pen,(float) x,(float) y,(float) width,(float) height);
- }
-
- public void DrawRectangles (Pen pen, RectangleF [] rects) {
- foreach(RectangleF r in rects)
- DrawRectangle (pen, r.Left, r.Top, r.Width, r.Height);
- }
-
- public void DrawRectangles (Pen pen, Rectangle [] rects) {
- foreach(Rectangle r in rects)
- DrawRectangle (pen, r.Left, r.Top, r.Width, r.Height);
- }
- #endregion
-
- #region DrawString
- public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle) {
- DrawString(s, font, brush, layoutRectangle.X, layoutRectangle.Y, layoutRectangle.Width, layoutRectangle.Height, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, PointF point) {
- DrawString(s, font, brush, point.X, point.Y, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format) {
- DrawString(s, font, brush, point.X, point.Y, float.PositiveInfinity, float.PositiveInfinity, format);
- }
-
- public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) {
- DrawString(s, font, brush, layoutRectangle.X, layoutRectangle.Y, layoutRectangle.Width, layoutRectangle.Height, format);
- }
-
- public void DrawString (string s, Font font, Brush brush, float x, float y) {
- DrawString(s, font, brush, x, y, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format) {
- DrawString(s, font, brush, x, y, float.PositiveInfinity, float.PositiveInfinity, format);
- }
-
- void DrawString (string s, Font font, Brush brush,
- float x, float y, float width, float height,
- StringFormat format) {
- if (brush == null)
- throw new ArgumentNullException("brush");
-
- if (font == null)
- throw new ArgumentNullException("font");
-
- if (format != null && format.LineAlignment != StringAlignment.Near) {
-
- SizeF sizeF = MeasureString(s, font, format, width, height, null);
-
- float lineAWidth = width;
- float lineAHeight = height;
-
- if (float.IsPositiveInfinity(width))
- lineAWidth = lineAHeight = 0;
-
- float wdelta = format.IsVertical ? lineAWidth - sizeF.Width : lineAHeight - sizeF.Height;
- float pdelta = format.LineAlignment == StringAlignment.Center ? wdelta/2 : wdelta;
- if (format.IsVertical) {
- if (!(format.IsRightToLeft && format.LineAlignment == StringAlignment.Far))
- x += pdelta;
- if (!float.IsPositiveInfinity(width))
- width -= wdelta;
- }
- else {
- y += pdelta;
- if (!float.IsPositiveInfinity(width))
- height -= wdelta;
- }
- }
-
- awt.Paint oldP = NativeObject.getPaint();
- NativeObject.setPaint(brush);
- try {
- geom.AffineTransform oldT = NativeObject.getTransform();
- try {
-
- bool noclip = float.IsPositiveInfinity(width) || (format != null && format.NoClip);
-
- awt.Shape oldClip = null;
- if (!noclip) {
- oldClip = NativeObject.getClip();
- NativeObject.clip(new geom.Rectangle2D.Float(x, y, width, height));
- }
- try {
- TextLineIterator iter = new TextLineIterator(s, font, NativeObject.getFontRenderContext(), format, width, height);
- NativeObject.transform(iter.Transform);
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
- layout.Draw (NativeObject, x * UnitConversion [(int) PageUnit], y * UnitConversion [(int) PageUnit]);
- }
- }
- finally {
- if (!noclip)
- NativeObject.setClip(oldClip);
- }
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- finally {
- NativeObject.setPaint(oldP);
- }
- }
- #endregion
-
- #region Container
-
- void PushGraphicsState(GraphicsState state) {
- state.Next = _nextGraphicsState;
- _nextGraphicsState = state;
- }
-
- GraphicsState PopGraphicsState() {
- GraphicsState state = _nextGraphicsState;
- _nextGraphicsState = _nextGraphicsState.Next;
- return state;
- }
-
- bool ContainsGraphicsState(GraphicsState state) {
- GraphicsState gs = _nextGraphicsState;
-
- while(gs != null) {
- if (gs == state)
- return true;
-
- gs = gs.Next;
- }
-
- return false;
- }
-
- public void EndContainer (GraphicsContainer container) {
- Restore(container.StateObject);
- }
-
- public GraphicsContainer BeginContainer () {
- return new GraphicsContainer(Save(Matrix.IdentityTransform, true));
- }
-
- public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit) {
- Matrix containerTransfrom =
- new Matrix( srcrect,
- new Point [] { new Point (dstrect.X, dstrect.Y),
- new Point (dstrect.X + dstrect.Width, dstrect.Y),
- new Point (dstrect.X, dstrect.Y + dstrect.Height) });
-
- float scale = _unitConversion[ (int)PageUnit ] / _unitConversion[ (int)unit ];
- containerTransfrom.Scale(scale, scale);
-
- return new GraphicsContainer(Save(containerTransfrom, true));
- }
-
-
- public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit) {
- Matrix containerTransfrom =
- new Matrix( srcrect,
- new PointF [] { new PointF (dstrect.X, dstrect.Y),
- new PointF (dstrect.X + dstrect.Width, dstrect.Y),
- new PointF (dstrect.X, dstrect.Y + dstrect.Height) });
-
- float scale = _unitConversion[ (int)PageUnit ] / _unitConversion[ (int)unit ];
- containerTransfrom.Scale(scale, scale);
-
- return new GraphicsContainer(Save(containerTransfrom, true));
- }
-
- GraphicsState Save(Matrix matrix, bool resetState) {
- GraphicsState graphicsState = new GraphicsState(this, matrix, resetState);
-
- PushGraphicsState( graphicsState );
- return graphicsState;
- }
-
- public GraphicsState Save () {
- return Save(Matrix.IdentityTransform, false);
- }
-
- public void Restore (GraphicsState graphicsState) {
- if (ContainsGraphicsState(graphicsState)) {
- GraphicsState gs = PopGraphicsState();
- while ( gs != graphicsState )
- gs = PopGraphicsState();
-
- graphicsState.RestoreState(this);
- }
- }
-
- #endregion
-
- #region Metafiles Staff
- [MonoTODO]
- public void AddMetafileComment (byte [] data) {
- throw new NotImplementedException ();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-#endif
- #endregion
-
- #region ExcludeClip
- void ExcludeClip(geom.Area area) {
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- area = (geom.Area) area.clone ();
- area.transform(t);
- }
-
- _clip.NativeObject.subtract(area);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void ExcludeClip (Rectangle rect) {
- ExcludeClip(new geom.Area(rect.NativeObject));
- }
-
- public void ExcludeClip (Region region) {
- if (region == null)
- throw new ArgumentNullException("region");
- ExcludeClip(region.NativeObject);
- }
- #endregion
-
- #region FillClosedCurve
- public void FillClosedCurve (Brush brush, PointF [] points) {
- FillClosedCurve (brush, points, FillMode.Alternate);
- }
-
-
- public void FillClosedCurve (Brush brush, Point [] points) {
- FillClosedCurve (brush, points, FillMode.Alternate);
- }
-
-
- public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode) {
- FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode) {
- FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- FillPath(brush, path);
- }
-
- public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- FillPath(brush, path);
- }
- #endregion
-
- #region FillEllipse
- public void FillEllipse (Brush brush, Rectangle rect) {
- FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void FillEllipse (Brush brush, RectangleF rect) {
- FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void FillEllipse (Brush brush, float x, float y, float width, float height) {
- FillShape(brush,new java.awt.geom.Ellipse2D.Float(x,y,width,height));
- }
-
- public void FillEllipse (Brush brush, int x, int y, int width, int height) {
- FillEllipse (brush,(float)x,(float)y,(float)width,(float)height);
- }
- #endregion
-
- #region FillPath
- public void FillPath (Brush brush, GraphicsPath path) {
- if (path == null)
- throw new ArgumentNullException("path");
-
- FillShape(brush,path);
- }
- #endregion
-
- #region FillPie
- public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle) {
- FillPie(brush,(float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height,(float)startAngle,(float)sweepAngle);
- }
-
- public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- FillPie(brush,(float)x,(float)y,(float)width,(float)height,(float)startAngle,(float)sweepAngle);
- }
-
- public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddPie(x, y, width, height, startAngle, sweepAngle);
- FillPath(brush, path);
- }
- #endregion
-
- #region FillPolygon
- public void FillPolygon (Brush brush, PointF [] points) {
- FillPolygon(brush, points, FillMode.Alternate);
- }
-
- public void FillPolygon (Brush brush, Point [] points) {
- FillPolygon(brush, points, FillMode.Alternate);
- }
-
- public void FillPolygon (Brush brush, Point [] points, FillMode fillMode) {
- GraphicsPath path = new GraphicsPath(fillMode);
- path.AddPolygon(points);
- FillPath(brush,path);
- }
-
- public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode) {
- GraphicsPath path = new GraphicsPath(fillMode);
- path.AddPolygon(points);
- FillPath(brush,path);
- }
- #endregion
-
- #region FillRectangle
- public void FillRectangle (Brush brush, RectangleF rect) {
- FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void FillRectangle (Brush brush, Rectangle rect) {
- FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void FillRectangle (Brush brush, int x, int y, int width, int height) {
- FillRectangle(brush,(float)x,(float)y,(float)width,(float)height);
- }
-
- public void FillRectangle (Brush brush, float x, float y, float width, float height) {
- FillShape(brush,new java.awt.geom.Rectangle2D.Float(x,y,width,height));
- }
-
- public void FillRectangles (Brush brush, Rectangle [] rects) {
- GraphicsPath path = new GraphicsPath();
- path.AddRectangles(rects);
- FillPath(brush,path);
- }
-
- public void FillRectangles (Brush brush, RectangleF [] rects) {
- GraphicsPath path = new GraphicsPath();
- path.AddRectangles(rects);
- FillPath(brush,path);
- }
- #endregion
-
- #region FillRegion
- public void FillRegion (Brush brush, Region region) {
- FillShape(brush,region);
- }
-
- #endregion
-
- public void Flush () {
- Flush (FlushIntention.Flush);
- }
-
-
- public void Flush (FlushIntention intention) {
- if (_image != null)
- _image.NativeObject.CurrentImage.NativeImage.flush();
- }
-
-#if INTPTR_SUPPORTED
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public void ReleaseHdc (IntPtr hdc)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public void ReleaseHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHwnd (IntPtr hwnd)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHwndInternal (IntPtr hwnd)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- internal static Graphics FromXDrawable (IntPtr drawable, IntPtr display)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static IntPtr GetHalftonePalette ()
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public IntPtr GetHdc ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- #region GetNearestColor
- [MonoTODO]
- public Color GetNearestColor (Color color) {
- throw new NotImplementedException();
- }
- #endregion
-
- #region IntersectClip
- void IntersectClip (geom.Area area) {
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- area = (geom.Area) area.clone ();
- area.transform(t);
- }
-
- _clip.NativeObject.intersect(area);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void IntersectClip (Region region) {
- if (region == null)
- throw new ArgumentNullException("region");
-
- IntersectClip(region.NativeObject);
- }
-
- public void IntersectClip (RectangleF rect) {
- IntersectClip(new geom.Area(rect.NativeObject));
- }
-
- public void IntersectClip (Rectangle rect) {
- IntersectClip(new geom.Area(rect.NativeObject));
- }
- #endregion
-
- #region IsVisible
- public bool IsVisible (Point point) {
- return IsVisible(point.X,point.Y);
- }
-
-
- public bool IsVisible (RectangleF rect) {
- return IsVisible ((float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height);
- }
-
- public bool IsVisible (PointF point) {
- return IsVisible(point.X,point.Y);
- }
-
- public bool IsVisible (Rectangle rect) {
- return IsVisible ((float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height);
- }
-
- public bool IsVisible (float x, float y) {
- double dx = x;
- double dy = y;
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- double[] p = new double[] {dx, dy};
- t.transform(p, 0, p, 0, 1);
-
- dx = p[0];
- dy = p[1];
- }
- if (!_clip.NativeObject.contains(dx, dy))
- return false;
-
- awt.Shape clip = NativeObject.getClip();
- if (clip == null)
- return true;
-
- return clip.contains(dx, dy);
- }
-
- public bool IsVisible (int x, int y) {
- return IsVisible ((float)x,(float)y);
- }
-
- public bool IsVisible (float x, float y, float width, float height) {
-
- geom.AffineTransform t = GetFinalTransform();
- geom.Rectangle2D r = new geom.Rectangle2D.Float(x, y, width, height);
-
- if (!t.isIdentity())
- r = t.createTransformedShape(r).getBounds2D();
-
- return NativeObject.hitClip(
- (int)(r.getX()+0.5), (int)(r.getY()+0.5),
- (int)(r.getWidth()+0.5), (int)(r.getHeight()+0.5))
- && _clip.NativeObject.intersects(r);
- }
-
-
- public bool IsVisible (int x, int y, int width, int height) {
- return IsVisible ((float)x,(float)y,(float)width,(float)height);
- }
- #endregion
-
- #region MeasureCharacterRanges
- public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat) {
- if (stringFormat == null)
- throw new ArgumentException("stringFormat");
-
- CharacterRange[] ranges = stringFormat.CharRanges;
- if (ranges == null || ranges.Length == 0)
- return new Region[0];
-
- GraphicsPath[] pathes = new GraphicsPath[ranges.Length];
- for (int i = 0; i < pathes.Length; i++)
- pathes[i] = new GraphicsPath();
-
- TextLineIterator iter = new TextLineIterator(text, font, NativeObject.getFontRenderContext(),
- stringFormat, layoutRect.Width, layoutRect.Height);
-
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
-
- for (int i = 0; i < ranges.Length; i++) {
- int start = ranges[i].First;
- int length = ranges[i].Length;
- start -= iter.CharsConsumed;
- int limit = start + length;
- int layoutStart = iter.CurrentPosition - layout.CharacterCount;
- if (start < iter.CurrentPosition && limit > layoutStart) {
-
- float layoutOffset;
- if (start > layoutStart)
- layoutOffset = iter.GetAdvanceBetween(layoutStart, start);
- else {
- layoutOffset = 0;
- start = layoutStart;
- }
-
- float width = (limit < iter.CurrentPosition) ?
- iter.GetAdvanceBetween(start, limit) :
- layout.Width - layoutOffset;
-
- float height = layout.Ascent + layout.Descent;
-
- float x = layout.NativeX;
- float y = layout.NativeY;
-
- if (stringFormat.IsVertical) {
- y += layoutOffset;
- x -= layout.Descent;
- }
- else {
- x += layoutOffset;
- y -= layout.Ascent;
- }
-
- if (layout.AccumulatedHeight + height > iter.WrapHeight) {
- float diff = iter.WrapHeight - layout.AccumulatedHeight;
- if (stringFormat.IsVertical && stringFormat.IsRightToLeft) {
- x += diff;
- height -= diff;
- }
- else
- height = diff;
- }
-
- if (stringFormat.IsVertical)
- pathes[i].AddRectangle(x + layoutRect.X, y + layoutRect.Y, height, width);
- else
- pathes[i].AddRectangle(x + layoutRect.X, y + layoutRect.Y, width, height);
- }
- }
- }
-
- geom.AffineTransform lineAlignT = iter.CalcLineAlignmentTransform();
- if (lineAlignT != null) {
- for (int i = 0; i < pathes.Length; i++)
- pathes[i].NativeObject.transform(lineAlignT);
- }
-
- Region[] regions = new Region[ranges.Length];
- for (int i = 0; i < regions.Length; i++)
- regions[i] = new Region(pathes[i]);
-
- return regions;
- }
- #endregion
-
- #region MeasureString
- public SizeF MeasureString (string text, Font font) {
- return MeasureString(text, font, null, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea) {
- return MeasureString(text, font, layoutArea, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, int width) {
- return MeasureString(text, font, width, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat format) {
- return MeasureString(text, font, format, layoutArea.Width, layoutArea.Height, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, int width, StringFormat format) {
- return MeasureString(text, font, format, width, float.PositiveInfinity, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, PointF origin, StringFormat format) {
- return MeasureString(text, font, format, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- SizeF MeasureString (string text, Font font, StringFormat format, float width, float height, int[] statistics) {
-
- if (statistics != null) {
- statistics[0] = 0;
- statistics[1] = 0;
- }
-
- TextLineIterator iter = new TextLineIterator(text, font, NativeObject.getFontRenderContext(), format, width, height);
-
- float mwidth = 0;
- int linesFilled = 0;
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
-
- linesFilled ++;
- float w = layout.MeasureWidth;
-
- if (w > mwidth)
- mwidth = w;
- }
-
- if (linesFilled == 0)
- return SizeF.Empty;
-
- float mheight = iter.AccumulatedHeight;
-
- if (format != null) {
- if (format.IsVertical) {
- float temp = mheight;
- mheight = mwidth;
- mwidth = temp;
- }
- }
-
- if (!(format != null && format.NoClip)) {
- if (mwidth > width)
- mwidth = width;
- if (mheight > height)
- mheight = height;
- }
-
- if (statistics != null) {
- statistics[0] = linesFilled;
- statistics[1] = iter.CharsConsumed;
- }
-
- return new SizeF (mwidth / UnitConversion [(int) _pageUnit], mheight / UnitConversion [(int) _pageUnit]);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, out int charactersFitted, out int linesFilled) {
- linesFilled = 0;
- charactersFitted = 0;
-
- int[] statistics = new int[2];
- SizeF sz = MeasureString(text, font, stringFormat, layoutArea.Width, layoutArea.Height, statistics);
- linesFilled = statistics[0];
- charactersFitted = statistics[1];
- return sz;
- }
- #endregion
-
- #region MultiplyTransform
- public void MultiplyTransform (Matrix matrix) {
- MultiplyTransform (matrix, MatrixOrder.Prepend);
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- ConcatenateTransform(matrix.NativeObject, order);
- }
- #endregion
-
- #region Reset (Clip and Transform)
- public void ResetClip () {
- _clip.MakeInfinite();
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void ResetTransform () {
- _transform.Reset();
- }
- #endregion
-
- #region RotateTransform
- public void RotateTransform (float angle) {
- RotateTransform (angle, MatrixOrder.Prepend);
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getRotateInstance(java.lang.Math.toRadians(angle)),
- order);
- }
- #endregion
-
- #region ScaleTransform
- public void ScaleTransform (float sx, float sy) {
- ScaleTransform (sx, sy, MatrixOrder.Prepend);
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getScaleInstance(sx, sy),
- order);
- }
- #endregion
-
- #region SetClip [Must be reviewed - more abstraction needed]
- public void SetClip (RectangleF rect) {
- SetClip (rect, CombineMode.Replace);
- }
-
- public void SetClip (GraphicsPath path) {
- SetClip (path, CombineMode.Replace);
- }
-
- public void SetClip (Rectangle rect) {
- SetClip (rect, CombineMode.Replace);
- }
-
- public void SetClip (Graphics g) {
- SetClip (g, CombineMode.Replace);
- }
-
- public void SetClip (Graphics g, CombineMode combineMode) {
- if(g == null)
- throw new NullReferenceException();
-
- CombineClipArea(g._clip.NativeObject, combineMode);
- }
-
- public void SetClip (Rectangle rect, CombineMode combineMode) {
- SetClip(rect.X,rect.Y,rect.Width,rect.Height,combineMode);
- }
- public void SetClip (RectangleF rect, CombineMode combineMode) {
- SetClip(rect.X,rect.Y,rect.Width,rect.Height,combineMode);
- }
-
- public void SetClip (Region region, CombineMode combineMode) {
- if(region == null)
- throw new ArgumentNullException("region");
-
- CombineClipArea ((geom.Area) region.NativeObject.clone (), combineMode);
- }
-
- public void SetClip (GraphicsPath path, CombineMode combineMode) {
- if(path == null)
- throw new ArgumentNullException("path");
-
- CombineClipArea(new geom.Area(path.NativeObject), combineMode);
- }
- #endregion
-
- #region Clipping Staff [INTERNAL]
- internal Region ScaledClip {
- get {
- return _clip.Clone();
- }
- set {
- _clip.NativeObject.reset();
- _clip.NativeObject.add(value.NativeObject);
- }
- }
- internal void SetClip(float x,float y,float width,float height,CombineMode combineMode) {
- CombineClipArea(new geom.Area(
- new geom.Rectangle2D.Float(x,y,width,height)),combineMode);
- }
-
- void CombineClipArea(geom.Area area, CombineMode combineMode) {
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- area.transform(t);
- if (combineMode == CombineMode.Replace) {
- _clip.NativeObject.reset();
- _clip.NativeObject.add(area);
- }
- else {
- geom.Area curClip = _clip.NativeObject;
- switch(combineMode) {
- case CombineMode.Complement:
- curClip.add(area);
- break;
- case CombineMode.Exclude:
- curClip.subtract(area);
- break;
- case CombineMode.Intersect:
- curClip.intersect(area);
- break;
- case CombineMode.Union:
- curClip.add(area);
- break;
- case CombineMode.Xor:
- curClip.exclusiveOr(area);
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- internal void IntersectScaledClipWithBase(awt.Shape clip) {
- NativeObject.clip(clip);
- }
-
- void RestoreBaseClip() {
- if (_nextGraphicsState == null) {
- NativeObject.setClip(_windowRect);
- return;
- }
-
- _nextGraphicsState.RestoreBaseClip(this);
- }
-
- #endregion
-
- #region TransformPoints
- [MonoTODO]
- public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts) {
- //TBD:CoordinateSpace
- java.awt.geom.AffineTransform tr = this.Transform.NativeObject;
- float[] fpts = new float[2];
- for(int i = 0; i< pts.Length; i++) {
- fpts[0] = pts[i].X;
- fpts[1] = pts[i].Y;
- tr.transform(fpts, 0, fpts, 0, 1);
- pts[i].X = fpts[0];
- pts[i].Y = fpts[1];
- }
- }
-
- [MonoTODO]
- public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts) {
- //TBD:CoordinateSpace
- java.awt.geom.AffineTransform tr = this.Transform.NativeObject;
- float[] fpts = new float[2];
- for(int i = 0; i< pts.Length; i++) {
- fpts[0] = pts[i].X;
- fpts[1] = pts[i].Y;
- tr.transform(fpts, 0, fpts, 0, 1);
- pts[i].X = (int)fpts[0];
- pts[i].Y = (int)fpts[1];
- }
- }
- #endregion
-
- #region TranslateClip
- public void TranslateClip (int dx, int dy) {
- TranslateClip((float)dx, (float)dy);
- }
-
-
- public void TranslateClip (float dx, float dy) {
- double x = dx;
- double y = dy;
- geom.AffineTransform f = GetFinalTransform();
-
- if (!f.isIdentity()) {
- double[] p = new double[] {x, y};
- f.deltaTransform(p, 0, p, 0, 1);
-
- x = p[0];
- y = p[1];
- }
-
- // It seems .Net does exactly this...
- x = Math.Floor(x+0.96875);
- y = Math.Floor(y+0.96875);
-
- geom.AffineTransform t = geom.AffineTransform.getTranslateInstance(x, y);
-
- _clip.NativeObject.transform(t);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
- #endregion
-
- #region TranslateTransform
- public void TranslateTransform (float dx, float dy) {
- TranslateTransform (dx, dy, MatrixOrder.Prepend);
- }
-
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getTranslateInstance(dx, dy),
- order);
- }
- #endregion
-
- #region Properties [Partial TODO]
- public Region Clip {
- get {
- Region r = _clip.Clone();
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- r.NativeObject.transform(t.createInverse());
-
- return r;
- }
- set {
- SetClip (value, CombineMode.Replace);
- }
- }
-
- public RectangleF ClipBounds {
- get {
- awt.Shape shape = _clip.NativeObject;
- if (shape == null)
- shape = Region.InfiniteRegion.NativeObject;
-
- geom.RectangularShape r = shape.getBounds2D();
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- geom.AffineTransform it = t.createInverse();
- r = it.createTransformedShape(r).getBounds2D();
- }
-
- return new RectangleF (r);
- }
- }
-
- public CompositingMode CompositingMode {
- //TBD:check this carefully
- get {
- return (NativeObject.getComposite() == awt.AlphaComposite.SrcOver) ?
- CompositingMode.SourceOver : CompositingMode.SourceCopy;
- }
- set {
- NativeObject.setComposite(
- (value == CompositingMode.SourceOver) ?
- awt.AlphaComposite.SrcOver : awt.AlphaComposite.Src);
- }
-
- }
-
- public CompositingQuality CompositingQuality {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_ALPHA_INTERPOLATION)) {
- object value_ai = hints.get(awt.RenderingHints.KEY_ALPHA_INTERPOLATION);
-
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED)
- return CompositingQuality.HighSpeed;
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)
- return CompositingQuality.HighQuality;
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT)
- return CompositingQuality.Default;
- }
-
- return CompositingQuality.Default;
-
- }
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- switch (value) {
- case CompositingQuality.AssumeLinear:
- case CompositingQuality.Default:
- case CompositingQuality.GammaCorrected:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT);
- break;
- case CompositingQuality.HighQuality:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- break;
- case CompositingQuality.HighSpeed:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
- break;
-// case CompositingQuality.Invalid:
-// if(hints.containsKey(awt.RenderingHints.KEY_ALPHA_INTERPOLATION))
-// hints.remove(awt.RenderingHints.KEY_ALPHA_INTERPOLATION);
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public float DpiX {
- get {
- if (_image != null)
- return _image.HorizontalResolution;
-
- return DefaultScreenResolution;
- }
- }
-
- public float DpiY {
- get {
- if (_image != null)
- return _image.VerticalResolution;
-
- return DefaultScreenResolution;
- }
- }
-
- public InterpolationMode InterpolationMode {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_INTERPOLATION)) {
- object value_i = hints.get(awt.RenderingHints.KEY_INTERPOLATION);
-
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR)
- return InterpolationMode.Bilinear;
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC)
- return InterpolationMode.Bicubic;
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR)
- return InterpolationMode.NearestNeighbor;
- }
-
- return InterpolationMode.Default;
- }
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
-
- switch (value) {
- case InterpolationMode.Bicubic:
- case InterpolationMode.HighQualityBicubic:
- case InterpolationMode.Low:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- break;
- case InterpolationMode.High:
- case InterpolationMode.Bilinear:
- case InterpolationMode.HighQualityBilinear:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- break;
- case InterpolationMode.Default:
- if (hints.containsKey(awt.RenderingHints.KEY_INTERPOLATION))
- hints.remove(awt.RenderingHints.KEY_INTERPOLATION);
- break;
- case InterpolationMode.NearestNeighbor:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
- break;
- case InterpolationMode.Invalid:
- throw new ArgumentException();
- default:
- throw new ArgumentOutOfRangeException();
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public bool IsClipEmpty {
- get {
- return _clip.IsEmpty(this);
- }
- }
-
- public bool IsVisibleClipEmpty {
- get {
- if (_clip.IsEmpty(this))
- return true;
-
- return VisibleClipBounds.IsEmpty;
- }
- }
-
- public float PageScale {
- get {
- return _pageScale;
- }
- set {
- _pageScale = value;
- }
- }
-
- public GraphicsUnit PageUnit {
- get {
- return _pageUnit;
- }
- set {
- _pageUnit = value;
- }
- }
-
- static internal geom.AffineTransform GetFinalTransform(
- geom.AffineTransform transform, GraphicsUnit pageUnit, float pageScale) {
- geom.AffineTransform t = null;
- if (pageUnit != GraphicsUnit.Display) {
- float scale = pageScale * _unitConversion[ (int)pageUnit ];
- if (Math.Abs(scale-1f) > float.Epsilon)
- t = geom.AffineTransform.getScaleInstance(scale, scale);
- }
-
- if (t != null)
- t.concatenate(transform);
- else
- t = transform;
-
- return t;
- }
-
- internal geom.AffineTransform GetFinalTransform() {
- return GetFinalTransform(_transform.NativeObject, PageUnit, PageScale);
- }
-
- public PixelOffsetMode PixelOffsetMode {
- get {
- return _pixelOffsetMode;
- }
- set {
- _pixelOffsetMode = value;
- }
- }
-
- [MonoTODO]
- public Point RenderingOrigin {
- get {
- throw new NotImplementedException();
- }
- set {
- throw new NotImplementedException();
- }
- }
-
- public SmoothingMode SmoothingMode {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_ANTIALIASING)) {
- object value_aa = hints.get(awt.RenderingHints.KEY_ANTIALIASING);
- if (value_aa == awt.RenderingHints.VALUE_ANTIALIAS_ON) {
- if(hints.containsKey(awt.RenderingHints.KEY_RENDERING)) {
- object value_render = hints.get(awt.RenderingHints.KEY_RENDERING);
- if (value_render == awt.RenderingHints.VALUE_RENDER_QUALITY)
- return SmoothingMode.HighQuality;
- if (value_render == awt.RenderingHints.VALUE_RENDER_SPEED)
- return SmoothingMode.HighSpeed;
- }
-
- return SmoothingMode.AntiAlias;
- }
-
- if (value_aa == awt.RenderingHints.VALUE_ANTIALIAS_DEFAULT)
- return SmoothingMode.Default;
- }
- return SmoothingMode.None;
-
- }
-
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
-
- switch (value) {
- case SmoothingMode.None:
- if(hints.containsKey(awt.RenderingHints.KEY_ANTIALIASING))
- hints.remove(awt.RenderingHints.KEY_ANTIALIASING);
- if(hints.containsKey(awt.RenderingHints.KEY_RENDERING))
- hints.remove(awt.RenderingHints.KEY_RENDERING);
- break;
- case SmoothingMode.AntiAlias:
- hints.put(awt.RenderingHints.KEY_ANTIALIASING, awt.RenderingHints.VALUE_ANTIALIAS_ON);
- break;
- case SmoothingMode.HighQuality:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_QUALITY);
- goto case SmoothingMode.AntiAlias;
- case SmoothingMode.HighSpeed:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_SPEED);
- goto case SmoothingMode.None;
- case SmoothingMode.Default:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_DEFAULT);
- goto case SmoothingMode.AntiAlias;
- case SmoothingMode.Invalid:
- throw new ArgumentException("Invalid parameter used.");
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- ///
- /// Java does not have similar functionality
- ///
- public int TextContrast {
- get {
- return _textContrast;
- }
-
- set {
- _textContrast = value;
- }
- }
-
- public TextRenderingHint TextRenderingHint {
- get {
- return _textRenderingHint;
-// awt.RenderingHints hints = NativeObject.getRenderingHints();
-// if(hints.containsKey(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING)) {
-// if(hints.get(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING) ==
-// java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON)
-// return TextRenderingHint.AntiAlias;
-// if(hints.get(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING) ==
-// java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)
-// return TextRenderingHint.SingleBitPerPixel;
-// }
-// //return TextRenderingHint.SystemDefault;
-// return TextRenderingHint.SingleBitPerPixelGridFit;
- }
-
- set {
- _textRenderingHint = value;
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- switch (value) {
- case TextRenderingHint.AntiAlias:
- case TextRenderingHint.AntiAliasGridFit:
- case TextRenderingHint.ClearTypeGridFit:
-// case TextRenderingHint.SystemDefault:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- break;
-
- case TextRenderingHint.SingleBitPerPixelGridFit:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
- break;
-
- case TextRenderingHint.SingleBitPerPixel:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
- break;
-
- case TextRenderingHint.SystemDefault:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
- break;
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public Matrix Transform {
- get {
- return _transform.Clone();
- }
- set {
- if (value == null)
- throw new ArgumentNullException("matrix");
-
- if (!value.IsInvertible)
- throw new ArgumentException("Invalid parameter used.");
-
- value.CopyTo(_transform);
- }
- }
-
- internal Matrix BaseTransform {
- get {
- return new Matrix(NativeObject.getTransform());
- }
- set {
- NativeObject.setTransform(value.NativeObject);
- }
- }
-
- internal void PrependBaseTransform(geom.AffineTransform t) {
- NativeObject.transform(t);
- }
-
- internal awt.Shape VisibleShape {
- get {
- return _windowRect;
- }
- }
-
- public RectangleF VisibleClipBounds {
- get {
- if (_clip.IsEmpty(this))
- return RectangleF.Empty;
-
- geom.Rectangle2D r = _clip.NativeObject.getBounds2D();
- awt.Shape clip = NativeObject.getClip();
- geom.Rectangle2D clipBounds = (clip != null) ? clip.getBounds2D() : _windowRect;
- geom.Rectangle2D.intersect(r, clipBounds, r);
- if ((r.getWidth() <= 0) || (r.getHeight() <= 0))
- return RectangleF.Empty;
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- geom.AffineTransform it = t.createInverse();
- r = it.createTransformedShape(r).getBounds2D();
- }
-
- return new RectangleF (r);
- }
- }
-
- void ConcatenateTransform(geom.AffineTransform transform, MatrixOrder order) {
- geom.AffineTransform at = _transform.NativeObject;
- Matrix.Multiply(at, transform, order);
- }
- #endregion
- }
-}
-
-
-
diff --git a/mcs/class/System.Drawing/System.Drawing/Icon.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Icon.jvm.cs
deleted file mode 100644
index 944ea0fd03..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Icon.jvm.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// System.Drawing.Icon.cs
-//
-// Authors:
-// Andrew Skiba (andrews@mainsoft.com)
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Sanjay Gupta (gsanjay@novell.com)
-//
-// Copyright (C) 2005 Mainsoft, Corp. http://mainsoft.com
-// Copyright (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Drawing.Imaging;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- [Serializable]
- [ComVisible (false)]
- [TypeConverter(typeof(IconConverter))]
- public sealed class Icon
- : MarshalByRefObject, ISerializable, ICloneable, IDisposable
- {
- private System.Drawing.Bitmap _bitmap;
-
- #region Ctors
- private void SelectSize (int width, int height) {
- int count = _bitmap.GetFrameCount (FrameDimension.Resolution);
- bool sizeObtained = false;
- for (int i=0; i= largestSize){
- largestSize = thisSize;
- _bitmap = tmpBmp;
- }
- }
- }
- }
-
- private Icon () {
- }
-
- internal Icon (Bitmap bitmap) {
- _bitmap = bitmap;
- }
-
- public Icon (Icon original, int width, int height) {
- _bitmap = original._bitmap;
- SelectSize (width, height);
- }
-
- public Icon (Icon original, Size size)
- :this (original, size.Width, size.Height) {
- }
-
- public Icon (Stream stream)
- : this (stream, 32, 32) {
- }
-
- public Icon (Stream stream, int width, int height)
- {
- _bitmap = new Bitmap (stream, false, ImageFormat.Icon);
- SelectSize (width, height);
- }
-
- public Icon (string fileName) {
- _bitmap = new Bitmap (fileName, false, ImageFormat.Icon);
- }
-
- public Icon (Type type, string resource)
- {
- using (Stream s = type.Assembly.GetManifestResourceStream (resource)) {
- if (s == null)
- throw new FileNotFoundException ("Resource name was not found: `" + resource + "'");
- _bitmap = new Bitmap (s, false, ImageFormat.Icon);
- }
- }
-
- [MonoTODO]
- private Icon (SerializationInfo info, StreamingContext context)
- {
- //FIXME, need to check how MS stores Icon structure
- //Will serialized form help
- throw new NotImplementedException ();
- }
- #endregion
-
- [MonoTODO]
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- public void Dispose ()
- {
-#if INTPTR_SUPPORT
- if (winHandle!=IntPtr.Zero)
- winHandle = IntPtr.Zero;
-#endif
- }
-
- public object Clone ()
- {
- Icon newIcon = new Icon ();
- newIcon._bitmap = (Bitmap)_bitmap.Clone ();
- return newIcon;
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static Icon FromHandle (IntPtr handle)
- {
- throw new NotImplementedException ();
- }
-#endif
- public void Save (Stream outputStream) {
- _bitmap.Save (outputStream, System.Drawing.Imaging.ImageFormat.Icon);
- }
-
- public Bitmap ToBitmap () {
- return _bitmap;
- }
-
- public override string ToString ()
- {
- //is this correct, this is what returned by .Net
- return "";
- }
-
-#if INTPTR_SUPPORT
- [Browsable (false)]
- public IntPtr Handle {
- get {
- return winHandle;
- }
- }
-#endif
-
- [Browsable (false)]
- public int Height {
- get {
- return _bitmap.Height;
- }
- }
-
- public Size Size {
- get {
- return _bitmap.Size;
- }
- }
-
- [Browsable (false)]
- public int Width {
- get {
- return _bitmap.Width;
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Image.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Image.jvm.cs
deleted file mode 100644
index e6334dfd0e..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Image.jvm.cs
+++ /dev/null
@@ -1,571 +0,0 @@
-//
-// System.Drawing.Image.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer (Christian.Meyer@cs.tum.edu)
-// Alexandre Pigolkine (pigolkine@gmx.de)
-// Jordi Mas i Hernandez (jordi@ximian.com)
-//
-namespace System.Drawing {
-
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Runtime.InteropServices;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.IO;
- using System.Xml;
- using Mainsoft.Drawing.Imaging;
-
- using BufferedImage = java.awt.image.BufferedImage;
- using java.io;
- using javax.imageio;
- using javax.imageio.stream;
- using vmw.common;
- using awt = java.awt;
- using image = java.awt.image;
-
- public abstract class Image : MarshalByRefObject, IDisposable , ICloneable {
- #region Vars
- PlainImageCollection _nativeObject = new PlainImageCollection();
- protected int _flags = 0;
-
- //consider using Image[] to support many thumbnails per Image
- #endregion
-
- #region flags enum
- [Flags]
- protected enum ImageFlags {
- ImageFlagsNone = 0,
- ImageFlagsScalable = 0x0001,
- ImageFlagsHasAlpha = 0x0002,
- ImageFlagsHasTranslucent = 0x0004,
- ImageFlagsPartiallyScalable = 0x0008,
- ImageFlagsColorSpaceRGB = 0x0010,
- ImageFlagsColorSpaceCMYK = 0x0020,
- ImageFlagsColorSpaceGRAY = 0x0040,
- ImageFlagsColorSpaceYCBCR = 0x0080,
- ImageFlagsColorSpaceYCCK = 0x0100,
- ImageFlagsHasRealDPI = 0x1000,
- ImageFlagsHasRealPixelSize = 0x2000,
- ImageFlagsReadOnly = 0x00010000,
- ImageFlagsCaching = 0x00020000
- }
- #endregion
-
- #region Constructor
- public void Dispose () {
- }
-
- protected virtual void DisposeResources () {
- }
-
- protected virtual void Dispose (bool disposing) {
- }
-
- // Derived classes must call Initialize () when they use this constructor
- protected Image () {
- }
-
- protected Image (java.awt.Image nativeObject) : this(nativeObject, ImageFormat.MemoryBmp) {
- }
-
- protected Image (java.awt.Image nativeObject, ImageFormat format) {
- PlainImage pi = new PlainImage( nativeObject, null, format, 0, 0, FrameDimension.Page );
- Initialize( pi, false );
- }
-
- protected void Initialize (PlainImage pi, bool addToCollection) {
- if (!addToCollection)
- NativeObject.Clear();
-
- NativeObject.Add( pi );
- }
-
- #endregion
-
- #region Internals
-
- internal PlainImageCollection NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- internal PlainImage CurrentImage {
- get {
- return NativeObject.CurrentImage;
- }
- }
-
- #endregion
-
- #region FromFile
- [MonoTODO]
- public static Image FromFile(string filename) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (filename);
- }
-
- [MonoTODO]
- public static Image FromFile(string filename, bool useIcm) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (filename, useIcm);
- }
- #endregion
-
- #region GetThumbnailImageAbort
- [Serializable]
- public delegate bool GetThumbnailImageAbort();
- #endregion
-
- #region Clone
- public abstract object Clone();
- #endregion
-
- // static
- #region FromStream
- [MonoTODO]
- public static Image FromStream (Stream stream) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (stream);
- }
-
- [MonoTODO]
- public static Image FromStream (Stream stream, bool useIcm) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (stream, useIcm);
- }
- #endregion
-
- #region GetPixelFormatSize
- public static int GetPixelFormatSize(PixelFormat pixfmt) {
-
- int result = 0;
- switch (pixfmt) {
- case PixelFormat.Format16bppArgb1555:
- case PixelFormat.Format16bppGrayScale:
- case PixelFormat.Format16bppRgb555:
- case PixelFormat.Format16bppRgb565:
- result = 16;
- break;
- case PixelFormat.Format1bppIndexed:
- result = 1;
- break;
- case PixelFormat.Format24bppRgb:
- result = 24;
- break;
- case PixelFormat.Format32bppArgb:
- case PixelFormat.Format32bppPArgb:
- case PixelFormat.Format32bppRgb:
- result = 32;
- break;
- case PixelFormat.Format48bppRgb:
- result = 48;
- break;
- case PixelFormat.Format4bppIndexed:
- result = 4;
- break;
- case PixelFormat.Format64bppArgb:
- case PixelFormat.Format64bppPArgb:
- result = 64;
- break;
- case PixelFormat.Format8bppIndexed:
- result = 8;
- break;
- }
- return result;
- }
- #endregion
-
- #region IsAlphaPixelFormat
- public static bool IsAlphaPixelFormat(PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Alpha) != PixelFormat.Undefined;
- }
- #endregion
-
- #region IsCanonicalPixelFormat
- // TBD: implement this
- public static bool IsCanonicalPixelFormat (PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Canonical) != PixelFormat.Undefined;
- }
- #endregion
-
- #region IsExtendedPixelFormat
- // TBD: implement this
- public static bool IsExtendedPixelFormat (PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Extended) != PixelFormat.Undefined;
- }
- #endregion
-
- // non-static
- #region GetBounds
- public RectangleF GetBounds (ref GraphicsUnit pageUnit) {
- pageUnit = GraphicsUnit.Pixel; //java.awt.Image always returns pixels
- return new RectangleF((float)0,(float)0,(float)Width,(float)Height);
- }
- #endregion
-
- #region GetEncoderParameterList
- [MonoTODO]
- public EncoderParameters GetEncoderParameterList(Guid encoder) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region GetFrameCount
- public int GetFrameCount(FrameDimension dimension) {
- // FALLBACK: now, only one dimension assigned for all frames
- if (dimension.Guid != CurrentImage.Dimension.Guid)
- throw new ArgumentException ("dimension");
-
- return NativeObject.Count;
- }
- #endregion
-
- #region GetPropertyItem
- [MonoTODO]
- public PropertyItem GetPropertyItem(int propid) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region RemovePropertyItem
- [MonoTODO]
- public void RemovePropertyItem (int propid) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region RotateFlip
- public void RotateFlip (RotateFlipType rotateFlipType) {
- awt.geom.AffineTransform tx;
-
- if ( !(CurrentImage.NativeImage is image.BufferedImage) )
- // TBD: This implementation is for raster formats only
- throw new NotImplementedException("Only raster formats are supported");
-
- switch (rotateFlipType) {
- case RotateFlipType.RotateNoneFlipNone :
- return;
-
- case RotateFlipType.Rotate90FlipNone :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.translate( 0, -Height );
- break;
-
- case RotateFlipType.Rotate180FlipNone :
- tx = awt.geom.AffineTransform.getScaleInstance(-1, -1);
- tx.translate( -Width, -Height );
- break;
-
- case RotateFlipType.Rotate270FlipNone :
- tx = awt.geom.AffineTransform.getRotateInstance(-Math.PI / 2);
- tx.translate( -Width, 0 );
- break;
-
- case RotateFlipType.RotateNoneFlipX :
- tx = awt.geom.AffineTransform.getScaleInstance(-1, 1);
- tx.translate( -Width, 0 );
- break;
-
- case RotateFlipType.Rotate90FlipX :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.scale(1, -1);
- break;
-
- case RotateFlipType.Rotate180FlipX :
- tx = awt.geom.AffineTransform.getScaleInstance(1, -1);
- tx.translate( 0, -Height );
- break;
-
- case RotateFlipType.Rotate270FlipX :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.scale(-1, 1);
- tx.translate( -Width, -Height );
- break;
-
- default:
- throw new ArgumentOutOfRangeException();
- }
- image.AffineTransformOp op = new image.AffineTransformOp(tx, image.AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
- CurrentImage.NativeImage = op.filter((BufferedImage)CurrentImage.NativeImage, null);
- }
- #endregion
-
- #region Save
- protected abstract void InternalSave (ImageOutputStream output, Guid clsid);
-
- [MonoTODO]
- public void Save (Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) {
- //TBD: implement encoderParams
- if (encoder == null)
- throw new ArgumentNullException("Value cannot be null.");
-
- try {
- java.io.OutputStream jos = vmw.common.IOUtils.ToOutputStream (stream);
- MemoryCacheImageOutputStream output = new MemoryCacheImageOutputStream(jos);
- InternalSave (output, encoder.Clsid);
- output.flush();
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-
- public void Save(string filename, ImageCodecInfo encoder, EncoderParameters encoderParams) {
- using (Stream outputStream = new FileStream(filename, FileMode.Create))
- Save(outputStream, encoder, encoderParams);
- }
-
- public void Save (string filename) {
- Save (filename, ImageFormat.Png);
- }
-
- public void Save (Stream stream, ImageFormat format) {
- ImageCodecInfo encoder = ImageCodec.FindEncoder ( ImageCodec.ImageFormatToClsid (format) );
- Save (stream, encoder, null);
- }
-
- public void Save(string filename, ImageFormat format) {
- using (Stream outputStream = new FileStream(filename, FileMode.Create))
- Save(outputStream, format);
- }
- #endregion
-
- #region SaveAdd
- [MonoTODO]
- public void SaveAdd(EncoderParameters encoderParams) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SaveAdd(Image image, EncoderParameters encoderParams) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region SelectActiveFrame
-
- // TBD: .Net does not load all frames at the initialization. New frames loaded by request.
- [MonoTODO]
- public int SelectActiveFrame(FrameDimension dimension, int frameIndex) {
- // FALLBACK: now, only one dimension assigned for all frames
- if (dimension.Guid != CurrentImage.Dimension.Guid)
- throw new ArgumentException ("dimension");
-
- if (frameIndex < NativeObject.Count)
- NativeObject.CurrentImageIndex = frameIndex;
-
- return frameIndex;
- }
- #endregion
-
- #region SetPropertyItem
- [MonoTODO]
- public void SetPropertyItem(PropertyItem propitem) {
- throw new NotImplementedException ();
- }
- #endregion
-
- // properties
- #region Flags
- public int Flags {
- // TDB: ImageFlagsScalable, ImageFlagsHasTranslucent, ImageFlagsPartiallyScalable, ImageFlagsCaching
- [MonoTODO]
- get {
- image.ColorModel colorModel = ((BufferedImage)CurrentImage.NativeImage).getColorModel();
- int t = colorModel.getColorSpace().getType();
-
- if (t == awt.color.ColorSpace.TYPE_RGB)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceRGB;
- else if (t == awt.color.ColorSpace.TYPE_CMYK)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceCMYK;
- else if (t == awt.color.ColorSpace.TYPE_GRAY)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceGRAY;
- else if (t == awt.color.ColorSpace.TYPE_YCbCr)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceYCBCR;
-
- if (colorModel.hasAlpha())
- _flags |= (int)ImageFlags.ImageFlagsHasAlpha;
-
- if ((CurrentImage.HorizontalResolution > 0) || (CurrentImage.VerticalResolution > 0))
- _flags |= (int)ImageFlags.ImageFlagsHasRealDPI;
-
- return _flags;
- }
- }
- #endregion
-
- #region FrameDimensionsList
- [MonoTODO]
- public Guid[] FrameDimensionsList {
- // TBD: look over all frames and build array of dimensions
- // FALLBACK: now, only one dimension assigned for all frames
- get {
- Guid [] dimList = new Guid[]{CurrentImage.Dimension.Guid};
- return dimList;
- }
- }
- #endregion
-
- #region Height
- public int Height {
- get {
- return CurrentImage.NativeImage.getHeight(null);
- }
- }
- #endregion
-
- #region HorizontalResolution
- public float HorizontalResolution {
- get {
- if (CurrentImage.HorizontalResolution <= 1)
- return Graphics.DefaultScreenResolution;
-
- return CurrentImage.HorizontalResolution;
- }
- }
- #endregion
-
- #region ColorPalette
- [MonoTODO]
- public ColorPalette Palette {
- get {
- if (!(CurrentImage.NativeImage is BufferedImage))
- // TBD: This implementation is for raster formats only
- throw new NotImplementedException("Only raster formats are supported");
-
- image.ColorModel colorModel = ((BufferedImage)CurrentImage.NativeImage).getColorModel();
- if (colorModel is image.IndexColorModel) {
-
- Color [] colors = new Color[ ((image.IndexColorModel)colorModel).getMapSize() ];
- for (int i=0; i
- ///
- ///
- /// transform which will be applied on the final shape
- /// ensure the shape will wide enough to be visible
- ///
- internal awt.Stroke GetNativeObject(geom.AffineTransform penTransform, geom.AffineTransform outputTransform, PenFit penFit) {
- float[] dashPattern = null;
-
- switch (DashStyle) {
- case DashStyle.Custom:
- if (_dashPattern != null) {
- dashPattern = new float[_dashPattern.Length];
- for(int i = 0; i < _dashPattern.Length; i++) {
-
- if (EndCap == LineCap.Flat)
- dashPattern[i] = _dashPattern[i] * Width;
- else {
- if ((i & 1) == 0) {
- // remove the size of caps from the opaque parts
- dashPattern[i] = (_dashPattern[i] * Width) - Width;
- if (_dashPattern[i] < 0)
- dashPattern[i] = 0;
- }
- else
- // add the size of caps to the transparent parts
- dashPattern[i] = (_dashPattern[i] * Width) + Width;
- }
- }
- }
- break;
- case DashStyle.Dash:
- dashPattern = DASH_ARRAY;
- break;
- case DashStyle.DashDot:
- dashPattern = DASHDOT_ARRAY;
- break;
- case DashStyle.DashDotDot:
- dashPattern = DASHDOTDOT_ARRAY;
- break;
-
- // default:
- // case DashStyle.Solid:
- // break;
- }
-
- int join;
- switch (LineJoin) {
- case LineJoin.Bevel:
- join = java.awt.BasicStroke.JOIN_BEVEL;
- break;
- default:
- case LineJoin.Miter:
- case LineJoin.MiterClipped:
- join = java.awt.BasicStroke.JOIN_MITER;
- break;
- case LineJoin.Round:
- join = java.awt.BasicStroke.JOIN_ROUND;
- break;
- }
-
- // We go by End cap for now.
- int cap;
- switch (EndCap) {
- default:
- case LineCap.Square:
- case LineCap.SquareAnchor:
- cap = awt.BasicStroke.CAP_SQUARE;
- break;
- case LineCap.Round:
- case LineCap.RoundAnchor:
- cap = awt.BasicStroke.CAP_ROUND;
- break;
- case LineCap.Flat:
- cap = awt.BasicStroke.CAP_BUTT;
- break;
- }
-
- geom.AffineTransform penT = _transform.NativeObject;
- if (penTransform != null && !penTransform.isIdentity()) {
- penT = (geom.AffineTransform) penT.clone();
- penT.concatenate(penTransform);
- }
-
- return StrokeFactory.CreateStroke(Width, cap,
- join, MiterLimit, dashPattern, DashOffset,
- penT, outputTransform, penFit);
- }
-
- #region Stroke Members
-
- awt.Shape awt.Stroke.createStrokedShape(awt.Shape arg_0) {
- return GetNativeObject(null, PenFit.NotThin).createStrokedShape(arg_0);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/PlainImage.jvm.cs b/mcs/class/System.Drawing/System.Drawing/PlainImage.jvm.cs
deleted file mode 100644
index aad9478bdb..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/PlainImage.jvm.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using System;
-using System.Drawing.Imaging;
-using System.Xml;
-
-using Mainsoft.Drawing.Imaging;
-
-using awt = java.awt;
-using java.awt.image;
-using imageio = javax.imageio;
-
-namespace Mainsoft.Drawing.Imaging
-{
- ///
- /// Summary description for PlainImage.
- ///
- public class PlainImage : ICloneable {
-
- #region Members
-
- awt.Image _nativeObject;
- awt.Image [] _thumbnails;
- FrameDimension _dimension;
- XmlDocument _metadata;
- imageio.metadata.IIOMetadata _nativeMetadata;
- ImageFormat _imageFormat;
-
- float _xResolution;
- float _yResolution;
-
-
- #endregion
-
- #region Constructors
-
- public PlainImage() {
- }
-
- public PlainImage(awt.Image image, awt.Image [] thumbnails, ImageFormat format, float xRes, float yRes, FrameDimension dimension) {
- _nativeObject = image;
- _thumbnails = thumbnails;
- _imageFormat = format;
-
- _xResolution = xRes;
- _yResolution = yRes;
-
- _dimension = dimension;
- }
-
- #endregion
-
-
- private awt.Image NativeObject {
- get { return _nativeObject; }
- set { _nativeObject = value; }
- }
-
- #region PlainImage properties
-
- public awt.Image NativeImage {
- get { return NativeObject; }
- set { NativeObject = value; }
- }
-
- internal imageio.metadata.IIOMetadata NativeMetadata {
- get { return _nativeMetadata; }
- set { _nativeMetadata = value; }
- }
-
- public XmlDocument Metadata {
- get { return _metadata; }
- set { _metadata = value; }
- }
-
- public ImageFormat ImageFormat {
- get { return _imageFormat; }
- }
-
- public FrameDimension Dimension {
- get { return _dimension; }
- set { _dimension = value; }
- }
-
- public awt.Image [] Thumbnails {
- get { return _thumbnails; }
- }
-
- public float HorizontalResolution {
- get { return _xResolution; }
- set { _xResolution = value; }
- }
-
- public float VerticalResolution {
- get { return _yResolution; }
- set { _yResolution = value; }
- }
-
- #endregion
-
- #region ICloneable members
-
- public object Clone() {
- return Clone(true);
- }
-
- public PlainImage Clone(bool cloneImage) {
- awt.Image img = NativeImage;
- awt.Image [] th = _thumbnails;
-
- if (cloneImage) {
- img = new BufferedImage(
- ((BufferedImage)NativeObject).getColorModel(),
- ((BufferedImage)NativeObject).copyData(null),
- ((BufferedImage)NativeObject).isAlphaPremultiplied(), null);
-
- if (Thumbnails != null) {
- th = new java.awt.Image[ Thumbnails.Length ];
- for (int i=0; i < Thumbnails.Length; i++) {
- th[i] = new BufferedImage(
- ((BufferedImage)Thumbnails[i]).getColorModel(),
- ((BufferedImage)Thumbnails[i]).copyData(null),
- ((BufferedImage)Thumbnails[i]).isAlphaPremultiplied(), null);
- }
- }
- }
-
- return new PlainImage(
- img,
- th,
- ImageFormat,
- HorizontalResolution,
- VerticalResolution,
- Dimension );
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/PlainImageCollection.jvm.cs b/mcs/class/System.Drawing/System.Drawing/PlainImageCollection.jvm.cs
deleted file mode 100644
index 1274948840..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/PlainImageCollection.jvm.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Collections;
-
-namespace Mainsoft.Drawing.Imaging
-{
- ///
- /// Summary description for PlainImageCollection.
- ///
- public class PlainImageCollection : ICollection, IEnumerable
- {
- ArrayList collection = new ArrayList();
- int _position = 0;
-
- public PlainImageCollection()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- #region ICollection members
-
- public bool IsSynchronized {
- get {
- return collection.IsSynchronized;
- }
- }
-
- public int Count {
- get {
- return collection.Count;
- }
- }
-
- public void CopyTo(Array array, int index) {
- collection.CopyTo(array, index);
- }
-
- public object SyncRoot {
- get {
- return collection.SyncRoot;
- }
- }
-
- #endregion
-
- #region IEnumerable members
-
- public IEnumerator GetEnumerator() {
- return collection.GetEnumerator();
- }
-
- #endregion
-
- #region Collection members
-
- public int Add(PlainImage plainImage) {
- return collection.Add( plainImage );
- }
-
- public void Clear() {
- collection.Clear();
- }
-
- public bool Contains(PlainImage plainImage) {
- return collection.Contains(plainImage);
- }
-
- public int IndexOf(PlainImage plainImage) {
- return collection.IndexOf( plainImage );
- }
-
- public void Insert(int index, PlainImage value) {
- collection.Insert( index, value );
- }
-
- public void Remove(PlainImage value) {
- collection.Remove( value );
- }
-
- public void RemoveAt(int index) {
- collection.RemoveAt( index );
- }
-
- public PlainImage this[int index] {
- get { return (PlainImage) collection[ index ]; }
- }
-
- public PlainImage CurrentImage {
- get { return (PlainImage) collection[ _position ]; }
- set { collection[ _position ] = value; }
- }
-
- public int CurrentImageIndex {
- get { return _position; }
- set { _position = value; }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
index 1ba6fd32a0..c8b3f6c728 100644
--- a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
@@ -54,13 +54,6 @@ namespace System.Drawing
public static readonly Rectangle Empty;
-#if TARGET_JVM
- internal java.awt.Rectangle NativeObject {
- get {
- return new java.awt.Rectangle(X,Y,Width,Height);
- }
- }
-#endif
///
/// Ceiling Shared Method
diff --git a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs b/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
index 0c651fe097..dc2ea17506 100644
--- a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
+++ b/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
@@ -47,13 +47,6 @@ namespace System.Drawing
public static readonly RectangleF Empty;
-#if TARGET_JVM
- internal java.awt.geom.Rectangle2D NativeObject {
- get {
- return new java.awt.geom.Rectangle2D.Float(X,Y,Width,Height);
- }
- }
-#endif
///
/// FromLTRB Shared Method
@@ -255,14 +248,6 @@ namespace System.Drawing
}
-#if TARGET_JVM
- internal RectangleF (java.awt.geom.RectangularShape r2d) {
- this.x = (float) r2d.getX ();
- this.y = (float) r2d.getY ();
- this.width = (float) r2d.getWidth ();
- this.height = (float) r2d.getHeight ();
- }
-#endif
///
/// Bottom Property
diff --git a/mcs/class/System.Drawing/System.Drawing/Region.jvm.cs b/mcs/class/System.Drawing/System.Drawing/Region.jvm.cs
deleted file mode 100644
index 18e1e37829..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/Region.jvm.cs
+++ /dev/null
@@ -1,389 +0,0 @@
-
-using System;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing
-{
- [ComVisible (false)]
- public sealed class Region : BasicShape
- {
- #region Member Vars
- internal static readonly Region InfiniteRegion = new Region(new Rectangle(-0x400000, -0x400000, 0x800000, 0x800000));
- #endregion
-
- #region Internals
- internal geom.Area NativeObject
- {
- get
- {
- return (geom.Area)Shape;
- }
- }
- #endregion
-
- #region Ctors. and Dtor
-
-
- public Region ()
- : this ((geom.Area) InfiniteRegion.NativeObject.clone ())
- {
- }
-
- internal Region(geom.Area native) : base(native)
- {
- }
-
-
- public Region (GraphicsPath path) : this(new geom.Area(path.NativeObject))
- {
- }
-
- public Region (Rectangle rect) : this(new geom.Area(rect.NativeObject))
- {
- }
-
- public Region (RectangleF rect) : this(new geom.Area(rect.NativeObject))
- {
- }
-
- [MonoTODO]
- public Region (RegionData region_data) : this((geom.Area)null)
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region Union
- public void Union (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.add(new geom.Area(path.NativeObject));
- }
-
-
- public void Union (Rectangle rect)
- {
- NativeObject.add(new geom.Area(rect.NativeObject));
- }
-
- public void Union (RectangleF rect)
- {
- NativeObject.add(new geom.Area(rect.NativeObject));
- }
-
- public void Union (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.add(region.NativeObject);
- }
- #endregion
-
- #region Intersect
- //
- public void Intersect (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.intersect(new geom.Area(path.NativeObject));
- }
-
- public void Intersect (Rectangle rect)
- {
- NativeObject.intersect(new geom.Area(rect.NativeObject));
- }
-
- public void Intersect (RectangleF rect)
- {
- NativeObject.intersect(new geom.Area(rect.NativeObject));
- }
-
- public void Intersect (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.intersect(region.NativeObject);
- }
- #endregion
-
- #region Complement
- //
- public void Complement (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- geom.Area a = new geom.Area(path.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (Rectangle rect)
- {
- geom.Area a = new geom.Area(rect.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (RectangleF rect)
- {
- geom.Area a = new geom.Area(rect.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- geom.Area a = (geom.Area) region.NativeObject.clone ();
- a.subtract(NativeObject);
- Shape = a;
- }
- #endregion
-
- #region Exclude
- //
- public void Exclude (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.subtract(new geom.Area(path.NativeObject));
- }
-
- public void Exclude (Rectangle rect)
- {
- NativeObject.subtract(new geom.Area(rect.NativeObject));
- }
-
- public void Exclude (RectangleF rect)
- {
- NativeObject.subtract(new geom.Area(rect.NativeObject));
- }
-
- public void Exclude (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.subtract(region.NativeObject);
- }
- #endregion
-
- #region Xor
- //
- public void Xor (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.exclusiveOr(new geom.Area(path.NativeObject));
- }
-
- public void Xor (Rectangle rect)
- {
- NativeObject.exclusiveOr(new geom.Area(rect.NativeObject));
- }
-
- public void Xor (RectangleF rect)
- {
- NativeObject.exclusiveOr(new geom.Area(rect.NativeObject));
- }
-
- public void Xor (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.exclusiveOr(region.NativeObject);
- }
- #endregion
-
- #region GetBounds
- //
- public RectangleF GetBounds (Graphics graphics)
- {
- if (graphics == null)
- throw new ArgumentNullException("graphics");
- return new RectangleF(NativeObject.getBounds2D());
- }
- #endregion
-
- #region Translate
- //
- public void Translate (int dx, int dy)
- {
- Translate((float)dx, (float)dy);
- }
-
- public void Translate (float dx, float dy)
- {
- if (NativeObject.equals(InfiniteRegion.NativeObject))
- return;
- NativeObject.transform(geom.AffineTransform.getTranslateInstance(
- dx,
- dy));
- }
- #endregion
-
- #region IsVisible [TODO]
- //
- public bool IsVisible (int x, int y, Graphics g)
- {
- return IsVisible((float)x, (float)y, g);
- }
-
- public bool IsVisible (int x, int y, int width, int height)
- {
- return IsVisible((float)x, (float)y, (float)width, (float)height);
- }
-
- public bool IsVisible (int x, int y, int width, int height, Graphics g)
- {
- return IsVisible((float)x, (float)y, (float)width, (float)height, g);
- }
-
- public bool IsVisible (Point point)
- {
- return IsVisible(point.X, point.Y);
- }
-
- public bool IsVisible (PointF point)
- {
- return IsVisible(point.X, point.Y);
- }
-
- public bool IsVisible (Point point, Graphics g)
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- public bool IsVisible (PointF point, Graphics g)
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- public bool IsVisible (Rectangle rect)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public bool IsVisible (RectangleF rect)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public bool IsVisible (Rectangle rect, Graphics g)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height, g);
- }
-
- public bool IsVisible (RectangleF rect, Graphics g)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height, g);
- }
-
- public bool IsVisible (float x, float y)
- {
- return NativeObject.contains(x,y);
- }
-
- public bool IsVisible (float x, float y, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.contains(x,y);
- }
-
- public bool IsVisible (float x, float y, float width, float height)
- {
- return NativeObject.intersects(x,y,width,height);
- }
-
- public bool IsVisible (float x, float y, float width, float height, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.intersects(x,y,width,height);
- }
- #endregion
-
- #region IsEmpty
- public bool IsEmpty(Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.isEmpty();
- }
- #endregion
-
- #region IsInfinite
- public bool IsInfinite(Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- //probably too naive.
- return NativeObject.equals(InfiniteRegion.NativeObject);
- }
- #endregion
-
- #region MakeEmpty
- public void MakeEmpty()
- {
- NativeObject.reset();
- }
- #endregion
-
- #region MakeInfinite
- public void MakeInfinite()
- {
- Shape = (geom.Area) InfiniteRegion.NativeObject.clone ();
- }
- #endregion
-
- #region Equals
- public bool Equals(Region region, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.equals(region.NativeObject);
- }
- #endregion
-
- [MonoTODO]
- public RegionData GetRegionData()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHrgn(Graphics g) {
- throw new NotImplementedException();
- }
-
-
- public RectangleF[] GetRegionScans(Matrix matrix)
- {
- throw new NotImplementedException();
- }
-
- #region Transform
- public void Transform(Matrix matrix)
- {
- if (matrix == null)
- throw new ArgumentNullException("matrix");
- if (NativeObject.equals(InfiniteRegion.NativeObject))
- return;
- NativeObject.transform(matrix.NativeObject);
- }
- #endregion
-
- #region Clone
- public Region Clone()
- {
- return new Region ((geom.Area) NativeObject.clone ());
- }
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringFormat.jvm.cs b/mcs/class/System.Drawing/System.Drawing/StringFormat.jvm.cs
deleted file mode 100644
index 3d9ec7944f..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringFormat.jvm.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-//
-// System.Drawing.StringFormat.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Miguel de Icaza (miguel@ximian.com)
-// Jordi Mas i Hernandez (jordi@ximian.com)
-//
-// Copyright (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing.Text;
-
-namespace System.Drawing {
- ///
- /// Summary description for StringFormat.
- ///
- public sealed class StringFormat : MarshalByRefObject, IDisposable, ICloneable {
-
-
- private CharacterRange [] _charRanges;
- private StringAlignment _alignment;
- private StringAlignment _lineAlignment;
- private HotkeyPrefix _hotkeyPrefix;
- private StringFormatFlags _flags;
- private StringDigitSubstitute _digitSubstituteMethod;
- private int _digitSubstituteLanguage;
- private StringTrimming _trimming;
-
- private float _firstTabOffset;
- private float [] _tabStops;
-
- private bool _genericTypeographic = false;
-
- #region Constructors
-
- public StringFormat() : this(0, 0) {
- }
-
- public StringFormat(StringFormatFlags options) : this(options,0) {
- }
-
- public StringFormat(StringFormatFlags options, int lang) {
- _alignment = StringAlignment.Near;
- _digitSubstituteLanguage = lang;
- _digitSubstituteMethod = StringDigitSubstitute.User;
- _flags = options;
- _hotkeyPrefix = HotkeyPrefix.None;
- _lineAlignment = StringAlignment.Near;
- _trimming = StringTrimming.Character;
- }
-
- public StringFormat (StringFormat source) {
- if (source == null)
- throw new ArgumentNullException("format");
-
- _alignment = source.LineAlignment;
- _digitSubstituteLanguage = source.DigitSubstitutionLanguage;
- _digitSubstituteMethod = source.DigitSubstitutionMethod;
- _flags = source.FormatFlags;
- _hotkeyPrefix = source.HotkeyPrefix;
- _lineAlignment = source.LineAlignment;
- _trimming = source.Trimming;
- }
-
-
- #endregion
-
- #region IDisposable
-
- public void Dispose() {
- }
-
- #endregion
-
- #region Public properties
-
- public StringAlignment Alignment {
- get {
- return _alignment;
- }
-
- set {
- _alignment = value;
- }
- }
-
- public StringAlignment LineAlignment {
- get {
- return _lineAlignment;
- }
- set {
- _lineAlignment = value;
- }
- }
-
- [MonoTODO]
- public StringFormatFlags FormatFlags {
- get {
- return _flags;
- }
-
- set {
- _flags = value;
- }
- }
-
- [MonoTODO]
- public HotkeyPrefix HotkeyPrefix {
- get {
- return _hotkeyPrefix;
- }
-
- set {
- _hotkeyPrefix = value;
- }
- }
-
- [MonoTODO]
- public StringTrimming Trimming {
- get {
- return _trimming;
- }
-
- set {
- _trimming = value;
- }
- }
-
- public int DigitSubstitutionLanguage {
- get {
- return _digitSubstituteLanguage;
- }
- }
-
- public StringDigitSubstitute DigitSubstitutionMethod {
- get {
- return _digitSubstituteMethod;
- }
- }
-
-
- #endregion
-
- #region static properties
-
- public static StringFormat GenericDefault {
- get {
- StringFormat genericDefault = new StringFormat();
- return genericDefault;
- }
- }
-
- public static StringFormat GenericTypographic {
- get {
- StringFormat genericTypographic = new StringFormat(
- StringFormatFlags.FitBlackBox |
- StringFormatFlags.LineLimit |
- StringFormatFlags.NoClip,
- 0 );
- genericTypographic.Trimming = StringTrimming.None;
- genericTypographic._genericTypeographic = true;
- return genericTypographic;
- }
- }
-
- #endregion
-
- #region internal accessors
- internal bool NoWrap {
- get {
- return (FormatFlags & StringFormatFlags.NoWrap) != 0;
- }
- }
-
- internal bool IsVertical {
- get {
- return (FormatFlags & StringFormatFlags.DirectionVertical) != 0;
- }
- }
-
- internal bool MeasureTrailingSpaces {
- get {
- return (FormatFlags & StringFormatFlags.MeasureTrailingSpaces) != 0;
- }
- }
-
- internal bool LineLimit {
- get {
- return (FormatFlags & StringFormatFlags.LineLimit) != 0;
- }
- }
-
- internal bool NoClip {
- get {
- return (FormatFlags & StringFormatFlags.NoClip) != 0;
- }
- }
-
- internal bool IsRightToLeft {
- get {
- return (FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0;
- }
- }
-
- internal CharacterRange [] CharRanges {
- get {
- return _charRanges;
- }
- }
-
- internal bool IsGenericTypographic
- {
- get {
- return _genericTypeographic;
- }
- }
- #endregion
-
- #region public methods
-
- public void SetMeasurableCharacterRanges (CharacterRange [] range) {
- _charRanges = range != null ? (CharacterRange [])range.Clone() : null;
- }
-
- public object Clone() {
- StringFormat copy = (StringFormat)MemberwiseClone();
- if (_charRanges != null)
- copy._charRanges = (CharacterRange [])_charRanges.Clone();
- if (_tabStops != null)
- copy._tabStops = (float[])_tabStops.Clone();
- return copy;
- }
-
- public override string ToString() {
- return "[StringFormat, FormatFlags=" + this.FormatFlags.ToString() + "]";
- }
-
- public void SetTabStops(float firstTabOffset, float[] tabStops) {
-// _firstTabOffset = firstTabOffset;
-// _tabStops = tabStops != null ? (float[])tabStops.Clone() : null;
- throw new NotImplementedException();
- }
-
- public void SetDigitSubstitution(int language, StringDigitSubstitute substitute) {
-// _digitSubstituteMethod = substitute;
-// _digitSubstituteLanguage = language;
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public float[] GetTabStops(out float firstTabOffset) {
- firstTabOffset = _firstTabOffset;
- return _tabStops != null ? (float[])_tabStops.Clone() : null;
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StrokeFactory.jvm.cs b/mcs/class/System.Drawing/System.Drawing/StrokeFactory.jvm.cs
deleted file mode 100644
index 8878ac73f1..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/StrokeFactory.jvm.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing {
- internal sealed class StrokeFactory {
-
- StrokeFactory() {}
-
- interface StrokeCreator {
- awt.Stroke Create(float width, int cap, int join, float miterlimit,
- float[] dash, float dash_phase, geom.AffineTransform penTransform,
- geom.AffineTransform outputTransform, PenFit penFit);
- }
-
- sealed class AdvancedCreator : StrokeCreator {
- #region StrokeCreator Members
-
- public awt.Stroke Create(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase, geom.AffineTransform penTransform,
- geom.AffineTransform outputTransform, PenFit penFit) {
- if ((penFit == PenFit.NotThin) &&
- (outputTransform == null || outputTransform.isIdentity()) &&
- (penTransform == null || penTransform.isIdentity()))
- return new awt.BasicStroke(width, cap, join, miterlimit, dash, dash_phase);
- return new System.Drawing.AdvancedStroke(width, cap, join, miterlimit, dash, dash_phase, penTransform, outputTransform, penFit);
- }
-
- #endregion
- }
-
- sealed class DefaultCreator : StrokeCreator {
- #region StrokeCreator Members
-
- public awt.Stroke Create(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase, geom.AffineTransform penTransform,
- geom.AffineTransform outputTransform, PenFit penFit) {
- return new awt.BasicStroke(width, cap, join, miterlimit, dash, dash_phase);
- }
-
- #endregion
- }
-
- static readonly StrokeCreator Creator;
- static StrokeFactory() {
- try {
- Type type = typeof(System.Drawing.AdvancedStroke);
- Activator.CreateInstance(type);
- Creator = new AdvancedCreator();
- }
- catch{
- Creator = new DefaultCreator();
- }
- }
-
- static public bool CanCreateAdvancedStroke {
- get {
- return !(Creator is DefaultCreator);
- }
- }
-
- static public awt.Stroke CreateStroke(float width, int cap, int join, float miterlimit,
- float[] dash, float dash_phase, geom.AffineTransform penTransform,
- geom.AffineTransform outputTransform, PenFit penFit) {
-
- return Creator.Create(width, cap, join, miterlimit, dash, dash_phase, penTransform, outputTransform, penFit);
- }
- }
-}
\ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing/SystemColors.jvm.cs b/mcs/class/System.Drawing/System.Drawing/SystemColors.jvm.cs
deleted file mode 100644
index af1d7b18fb..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/SystemColors.jvm.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-//
-// System.Drawing.SystemColors.cs
-//
-// Authors:
-// Andrew Skiba (andrews@mainsoft.com)
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Drawing {
-
- public sealed class SystemColors
- {
- private SystemColors (){}
-
- static Color [] SystemColorsCache {
- get {
- return KnownColors.Values;
- }
- }
-
- static public Color ActiveBorder
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveBorder];
- }
- }
-
- static public Color ActiveCaption
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveCaption];
- }
- }
-
- static public Color ActiveCaptionText
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveCaptionText];
- }
- }
-
- static public Color AppWorkspace
- {
- get {
- return SystemColorsCache[(int)KnownColor.AppWorkspace];
- }
- }
-
- static public Color Control
- {
- get {
- return SystemColorsCache[(int)KnownColor.Control];
- }
- }
-
- static public Color ControlDark
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlDark];
- }
- }
-
- static public Color ControlDarkDark
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlDarkDark];
- }
- }
-
- static public Color ControlLight
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlLight];
- }
- }
-
- static public Color ControlLightLight
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlLightLight];
- }
- }
-
- static public Color ControlText
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlText];
- }
- }
-
- static public Color Desktop
- {
- get {
- return SystemColorsCache[(int)KnownColor.Desktop];
- }
- }
-
- static public Color GrayText
- {
- get {
- return SystemColorsCache[(int)KnownColor.GrayText];
- }
- }
-
- static public Color Highlight
- {
- get {
- return SystemColorsCache[(int)KnownColor.Highlight];
- }
- }
-
- static public Color HighlightText
- {
- get {
- return SystemColorsCache[(int)KnownColor.HighlightText];
- }
- }
-
- static public Color HotTrack
- {
- get {
- return SystemColorsCache[(int)KnownColor.HotTrack];
- }
- }
-
- static public Color InactiveBorder
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveBorder];
- }
- }
-
- static public Color InactiveCaption
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveCaption];
- }
- }
-
- static public Color InactiveCaptionText
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveCaptionText];
- }
- }
-
- static public Color Info
- {
- get {
- return SystemColorsCache[(int)KnownColor.Info];
- }
- }
-
- static public Color InfoText
- {
- get {
- return SystemColorsCache[(int)KnownColor.InfoText];
- }
- }
-
- static public Color Menu
- {
- get {
- return SystemColorsCache[(int)KnownColor.Menu];
- }
- }
-
- static public Color MenuText
- {
- get {
- return SystemColorsCache[(int)KnownColor.MenuText];
- }
- }
-
- static public Color ScrollBar
- {
- get {
- return SystemColorsCache[(int)KnownColor.ScrollBar];
- }
- }
-
- static public Color Window
- {
- get {
- return SystemColorsCache[(int)KnownColor.Window];
- }
- }
-
- static public Color WindowFrame
- {
- get {
- return SystemColorsCache[(int)KnownColor.WindowFrame];
- }
- }
-
- static public Color WindowText
- {
- get {
- return SystemColorsCache[(int)KnownColor.WindowText];
- }
- }
-
-#if NET_2_0
-
- static public Color ButtonFace
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonFace];
- }
- }
-
- static public Color ButtonHighlight
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonHighlight];
- }
- }
-
- static public Color ButtonShadow
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonShadow];
- }
- }
-
- static public Color GradientActiveCaption
- {
- get {
- return SystemColorsCache [(int) KnownColor.GradientActiveCaption];
- }
- }
-
- static public Color GradientInactiveCaption
- {
- get {
- return SystemColorsCache [(int) KnownColor.GradientInactiveCaption];
- }
- }
-
- static public Color MenuBar
- {
- get {
- return SystemColorsCache [(int) KnownColor.MenuBar];
- }
- }
-
- static public Color MenuHighlight
- {
- get {
- return SystemColorsCache [(int) KnownColor.MenuHighlight];
- }
- }
-#endif
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/SystemIcons.jvm.cs b/mcs/class/System.Drawing/System.Drawing/SystemIcons.jvm.cs
deleted file mode 100644
index e3fdbade02..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/SystemIcons.jvm.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Drawing.systemIcons.cs
-//
-// Authors:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Configuration;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Reflection;
-
-namespace System.Drawing {
- public sealed class SystemIcons {
- static readonly Icon[] systemIcons;
-
- enum IconName {
- Application, Asterisk, Error,
- Exclamation, Hand, Information,
- Question, Warning, WinLogo
- }
-
- static SystemIcons() {
-
- Type nameType = typeof(IconName);
- string [] iconNames = Enum.GetNames(nameType);
- systemIcons = new Icon[iconNames.Length];
- Assembly assembly = Assembly.GetExecutingAssembly();
- for (int i = 0; i < iconNames.Length; i++)
- systemIcons[(int)(IconName)Enum.Parse(nameType, iconNames[i])] =
- new Icon(assembly.GetManifestResourceStream(String.Format("System.Drawing.Assembly.{0}.ico", iconNames[i])));
- }
-
- private SystemIcons() {
- }
-
- public static Icon Application { get { return systemIcons[(int)IconName.Application];} }
- public static Icon Asterisk { get { return systemIcons[(int)IconName.Asterisk];} }
- public static Icon Error { get { return systemIcons[(int)IconName.Error];} }
- public static Icon Exclamation { get { return systemIcons[(int)IconName.Exclamation];} }
- public static Icon Hand { get { return systemIcons[(int)IconName.Hand];} }
- public static Icon Information { get { return systemIcons[(int)IconName.Information];} }
- public static Icon Question { get { return systemIcons[(int)IconName.Question];} }
- public static Icon Warning { get { return systemIcons[(int)IconName.Warning];} }
- public static Icon WinLogo { get { return systemIcons[(int)IconName.WinLogo];} }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/TextureBrush.jvm.cs b/mcs/class/System.Drawing/System.Drawing/TextureBrush.jvm.cs
deleted file mode 100644
index f940dfb742..0000000000
--- a/mcs/class/System.Drawing/System.Drawing/TextureBrush.jvm.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// System.Drawing.TextureBrush.cs
-//
-// Author:
-// Dennis Hayes (dennish@Raytek.com)
-// Ravindra (rkumar@novell.com)
-//
-// (C) 2002 Ximian, Inc
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-using image = java.awt.image;
-
-namespace System.Drawing {
- ///
- /// Summary description for TextureBrush.
- ///
- public sealed class TextureBrush : Brush {
- readonly awt.TexturePaint _nativeObject;
- RectangleF _sourceRectangle;
- Image _texture = null;
- WrapMode _wrapMode;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- #region ctors
-
- public TextureBrush (Image image) : this (image, WrapMode.Tile) {
- }
-
- public TextureBrush (Image image, WrapMode wrapMode) :
- this( image, wrapMode, new RectangleF(0, 0, image.Width, image.Height )){
- }
-
- public TextureBrush (Image image, Rectangle dstRect) :
- this( image, WrapMode.Tile, dstRect ) {
- }
-
- public TextureBrush (Image image, RectangleF dstRect) :
- this( image, WrapMode.Tile, dstRect ) {
- }
-
- [MonoTODO]
- public TextureBrush (Image image, Rectangle dstRect, ImageAttributes imageAttr) : this( image, dstRect ) {
- // TBD: Implement ImageAttributes
- }
-
- [MonoTODO]
- public TextureBrush (Image image, RectangleF dstRect, ImageAttributes imageAttr) : this( image, dstRect ) {
- // TBD: Implement ImageAttributes
- }
-
- public TextureBrush (Image image, WrapMode wrapMode, Rectangle dstRect) :
- this( image, wrapMode, new RectangleF(dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height )){
- }
-
- [MonoTODO]
- public TextureBrush (Image image, WrapMode wrapMode, RectangleF dstRect) {
- // TBD: check if not metafile
- _sourceRectangle = dstRect;
- _texture = (Image)((Bitmap)image).Clone(dstRect, image.PixelFormat);
- _wrapMode = wrapMode;
-
- if (wrapMode != Drawing2D.WrapMode.Tile)
- image = CreateWrappedImage(_texture, wrapMode);
- else
- image = _texture;
-
- _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
- new geom.Rectangle2D.Float(0, 0, image.Width, image.Height));
- }
-
- #endregion
-
- #region CreateWrappedImage
-
- private Image CreateWrappedImage(Image image, WrapMode wrapMode) {
- Image b = null;
- Graphics g = null;
-
- switch (wrapMode) {
- case Drawing2D.WrapMode.TileFlipX :
- b = new Bitmap(image.Width * 2, image.Height);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(-1, 0, 0, 1, image.Width * 2 - 1, 0));
- break;
- case Drawing2D.WrapMode.TileFlipY :
- b = new Bitmap(image.Width, image.Height * 2);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(1, 0, 0, -1, 0, image.Height * 2 - 1));
- break;
- case Drawing2D.WrapMode.TileFlipXY :
- b = new Bitmap(image.Width * 2, image.Height * 2);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(-1, 0, 0, 1, image.Width * 2 - 1, 0));
- g.DrawImage(image, new Matrix(1, 0, 0, -1, 0, image.Height * 2 - 1));
- g.DrawImage(image, new Matrix(-1, 0, 0, -1, image.Width * 2 - 1, image.Height * 2 - 1));
- break;
- case Drawing2D.WrapMode.Clamp :
- // TBD: Implement WrapMode.Clamp
- return image;
- default :
- b = image;
- break;
- }
-
- return b;
- }
-
- #endregion
-
- #region properties
-
- public Image Image {
- get {
- return (Image)_texture.Clone();
- }
- }
-
- public Matrix Transform {
- get {
- return BrushTransform;
- }
- set {
- BrushTransform = value;
- }
- }
-
- [MonoTODO]
- public WrapMode WrapMode {
- get {
- return _wrapMode;
- }
- set {
- _wrapMode = value;
- }
- }
-
- #endregion
-
- #region public methods
-
- public override object Clone () {
- TextureBrush copy = (TextureBrush)InternalClone();
-
- if (_texture != null)
- copy._texture = (Image)_texture.Clone();
-
- return copy;
- }
-
- public void MultiplyTransform (Matrix matrix) {
- base.BrushMultiplyTransform( matrix );
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- base.BrushMultiplyTransform( matrix, order );
- }
-
- public void ResetTransform () {
- base.BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- base.BrushRotateTransform( angle );
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- base.BrushRotateTransform( angle, order );
- }
-
- public void ScaleTransform (float sx, float sy) {
- base.BrushScaleTransform( sx, sy );
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- base.BrushScaleTransform( sx, sy, order );
- }
-
- public void TranslateTransform (float dx, float dy) {
- base.BrushTranslateTransform( dx, dy );
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- base.BrushTranslateTransform( dx, dy, order );
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorCas.cs b/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorCas.cs
index 1fca5558d2..96e81b672f 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorCas.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorCas.cs
@@ -78,7 +78,6 @@ namespace MonoCasTests.System.Drawing.Design {
unit.DefaultValues ();
}
-#if !TARGET_JVM
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void UnitTests_PaintValue ()
@@ -87,7 +86,6 @@ namespace MonoCasTests.System.Drawing.Design {
unit.PaintValue_PaintValueEventArgs ();
unit.PaintValue ();
}
-#endif
// we use reflection to call UITypeEditor class as it's protected by a
// LinkDemand (which will be converted into full demand, i.e. a stack
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorTest.cs b/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorTest.cs
index b1027f46ff..c48dd5b3f8 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorTest.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Design/UITypeEditorTest.cs
@@ -65,7 +65,6 @@ namespace MonoTests.System.Drawing.Design {
#endif
}
-#if !TARGET_JVM
[Test]
public void PaintValue_PaintValueEventArgs_Null ()
{
@@ -83,6 +82,5 @@ namespace MonoTests.System.Drawing.Design {
{
editor.PaintValue (null, graphics, Rectangle.Empty);
}
-#endif
}
}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestColorBlend.cs b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestColorBlend.cs
index 3c8626244c..ffe43baaf8 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestColorBlend.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestColorBlend.cs
@@ -97,9 +97,6 @@ namespace MonoTests.System.Drawing.Drawing2D
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [Category ("NotWorking")] // defect 6364
-#endif
public void ColorBlend_Negative ()
{
ColorBlend cb = new ColorBlend (-1);
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestHatchBrush.cs b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestHatchBrush.cs
index 444e1e6066..5bbb621669 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestHatchBrush.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Drawing2D/TestHatchBrush.cs
@@ -97,9 +97,6 @@ namespace MonoTests.System.Drawing.Drawing2D
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestDrawing ()
{
// create a bitmap with big enough dimensions
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestBmpCodec.cs b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestBmpCodec.cs
index f792ecced8..47c8947577 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestBmpCodec.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestBmpCodec.cs
@@ -75,9 +75,6 @@ namespace MonoTests.System.Drawing.Imaging {
/* Checks bitmap features on a know 1bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap1bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
@@ -154,9 +151,6 @@ namespace MonoTests.System.Drawing.Imaging {
/* Checks bitmap features on a know 8bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
@@ -232,9 +226,6 @@ namespace MonoTests.System.Drawing.Imaging {
/* Checks bitmap features on a know 24-bits bitmap */
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[Test]
public void Bitmap24bitFeatures()
{
@@ -308,7 +299,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
@@ -434,7 +424,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
}
-#endif
/* Checks bitmap features on a know 32-bits bitmap (codec)*/
[Test]
@@ -548,36 +537,24 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format32bppRgb, true);
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestColorMatrix.cs b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestColorMatrix.cs
index 228594e726..ecce1ac458 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestColorMatrix.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestColorMatrix.cs
@@ -160,10 +160,8 @@ namespace MonoTests.System.Drawing.Imaging {
Assert.AreEqual (0, cm.Matrix41, "4,1");
Assert.AreEqual (0, cm.Matrix42, "4,2");
Assert.AreEqual (0, cm.Matrix43, "4,3");
-#if !TARGET_JVM
Assert.AreEqual (100, Marshal.SizeOf (cm), "object");
Assert.AreEqual (100, Marshal.SizeOf (typeof (ColorMatrix)), "type");
-#endif
}
[Test]
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
index dcca275389..b4724040e1 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageAttributes.cs
@@ -71,9 +71,6 @@ namespace MonoTests.System.Drawing.Imaging {
// Text Color Matrix processing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix1 ()
{
Color clr_src, clr_rslt;
@@ -93,9 +90,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix2 ()
{
Color clr_src, clr_rslt;
@@ -152,18 +146,12 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_UsingAlpha ()
{
Bug80323 (Color.FromArgb (100, 255, 0, 0));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_WithoutAlpha ()
{
// this color is identical, once drawn over the bitmap, to Color.FromArgb (100, 255, 0, 0)
@@ -186,9 +174,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Null ()
{
@@ -211,9 +196,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Any ()
{
@@ -223,9 +205,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Count ()
{
@@ -235,9 +214,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays ()
{
@@ -247,9 +223,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Any ()
{
@@ -259,9 +232,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Bitmap ()
{
@@ -271,9 +241,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Brush ()
{
@@ -283,9 +250,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Count ()
{
@@ -295,9 +259,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Default ()
{
@@ -307,9 +268,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Pen ()
{
@@ -319,9 +277,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Text ()
{
@@ -344,9 +299,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Any ()
{
@@ -356,9 +308,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Count ()
{
@@ -368,9 +317,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidFlag ()
{
@@ -380,9 +326,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidType()
{
@@ -392,9 +335,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_Null_ColorMatrix ()
{
@@ -414,9 +354,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_ColorMatrix_Null_AltGrays ()
{
@@ -437,9 +374,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Gray ()
{
Color c = ProcessColorMatrices (Color.Gray, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
@@ -453,9 +387,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Color ()
{
Color c = ProcessColorMatrices (Color.MidnightBlue, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
@@ -469,9 +400,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidFlags ()
{
@@ -481,9 +409,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidType ()
{
@@ -524,9 +449,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void ColorMatrixAlpha ()
{
for (int i = 0; i < 256; i++) {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageCodecInfo.cs b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageCodecInfo.cs
index c5159e65c4..45397a4b70 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageCodecInfo.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestImageCodecInfo.cs
@@ -122,9 +122,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Decoders ()
{
Assert.AreEqual (8, decoders.Count, "Count");
@@ -148,9 +145,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Encoders ()
{
Assert.AreEqual (5, encoders.Count, "Count");
@@ -171,9 +165,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void BMPCodec()
{
Guid g = new Guid ("557cf400-1a04-11d3-9a73-0000f81ef32e");
@@ -184,9 +175,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void GifCodec()
{
Guid g = new Guid ("557cf402-1a04-11d3-9a73-0000f81ef32e");
@@ -197,9 +185,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void JpegCodec()
{
Guid g = new Guid ("557cf401-1a04-11d3-9a73-0000f81ef32e");
@@ -210,9 +195,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void PngCodec()
{
Guid g = new Guid ("557cf406-1a04-11d3-9a73-0000f81ef32e");
@@ -223,9 +205,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TiffCodec ()
{
Guid g = new Guid ("557cf405-1a04-11d3-9a73-0000f81ef32e");
@@ -236,9 +215,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Encoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
@@ -246,9 +222,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Decoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
@@ -259,9 +232,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Encoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
@@ -269,9 +239,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Decoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
@@ -283,9 +250,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Encoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
@@ -293,9 +257,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Decoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
diff --git a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestJpegCodec.cs b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestJpegCodec.cs
index 5044a1ad3e..9644d8eedf 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestJpegCodec.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing.Imaging/TestJpegCodec.cs
@@ -72,9 +72,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Ignore ("#8853")]
-#endif
public void Bitmap8bbpIndexedGreyscaleFeatures ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
@@ -116,9 +113,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bbpIndexedGreyscalePixels ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
@@ -150,7 +144,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap8bbpIndexedGreyscaleData ()
{
@@ -212,13 +205,9 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
}
-#endif
/* Checks bitmap features on a known 24-bits bitmap */
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Bitmap24bitFeatures ()
{
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
@@ -283,7 +272,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
@@ -408,7 +396,6 @@ namespace MonoTests.System.Drawing.Imaging {
}
}
}
-#endif
private void Save (PixelFormat original, PixelFormat expected)
{
@@ -449,36 +436,24 @@ namespace MonoTests.System.Drawing.Imaging {
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format24bppRgb);
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/ColorConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/ColorConverter.cs
index 308f3ab47d..ff6d12c0ad 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/ColorConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/ColorConverter.cs
@@ -59,9 +59,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void CanConvertFrom () {
Assert.IsTrue (colconv.CanConvertFrom (typeof (String)), "CCF#1");
Assert.IsTrue (colconv.CanConvertFrom (null, typeof (String)), "CCF#1a");
@@ -92,9 +89,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Color color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -196,9 +190,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom_x4 ()
{
colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -367,9 +358,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_InvalidNumber ()
{
try {
@@ -399,9 +387,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_InvalidNumber ()
{
try {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs b/mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs
index eb1de4a8db..ffd4e83693 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/ColorTranslator.cs
@@ -83,9 +83,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_PoundNegative ()
{
ColorTranslator.FromHtml ("#-1");
@@ -100,9 +97,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_Unknown ()
{
ColorTranslator.FromHtml ("unknown-color-test");
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestBitmap.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestBitmap.cs
index 435377815f..d211412330 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestBitmap.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestBitmap.cs
@@ -47,9 +47,6 @@ namespace MonoTests.System.Drawing {
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public class TestBitmap {
[Test]
@@ -239,26 +236,17 @@ namespace MonoTests.System.Drawing {
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_BitmapData_Null ()
{
-#if !TARGET_JVM
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, null);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
@@ -269,16 +257,11 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
@@ -289,16 +272,11 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
@@ -309,16 +287,11 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
@@ -329,7 +302,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
#endif
@@ -634,9 +606,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FileDoesNotExists ()
{
Bitmap bmp = new Bitmap ("FileDoesNotExists.jpg");
@@ -675,7 +644,6 @@ namespace MonoTests.System.Drawing {
hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
return ByteArrayToString (hash);
}
-#if !TARGET_JVM
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
{
int pixels_per_byte;
@@ -726,7 +694,6 @@ namespace MonoTests.System.Drawing {
byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
-#endif
/*
@@ -749,7 +716,6 @@ namespace MonoTests.System.Drawing {
}
-#if !TARGET_JVM
/*
Rotate 1- and 4-bit bitmaps in different ways and check the
resulting pixels using MD5
@@ -1095,7 +1061,6 @@ namespace MonoTests.System.Drawing {
}
}
}
-#endif
[Test]
public void DefaultFormat1 ()
{
@@ -1712,11 +1677,7 @@ namespace MonoTests.System.Drawing {
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class BitmapFullTrustTest {
-#if !TARGET_JVM
[Test]
public void BitmapIntIntIntPixelFormatIntPtrCtor ()
{
@@ -1877,7 +1838,6 @@ namespace MonoTests.System.Drawing {
Assert.IsTrue (image2.RawFormat.Equals (ImageFormat.MemoryBmp), "2.RawFormat");
}
}
-#endif
}
}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestBrushes.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestBrushes.cs
index fd4ddc9d21..6b922e2a71 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestBrushes.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestBrushes.cs
@@ -49,9 +49,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Throws ArgumentException - Implementation specific")]
-#endif
public void Dispose ()
{
Brushes.YellowGreen.Dispose ();
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestColor.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestColor.cs
index 25ae527e75..a5d2eb58db 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestColor.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestColor.cs
@@ -1181,9 +1181,6 @@ namespace MonoTests.System.Drawing {
0x01, 0x00, 0x0B };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize ()
{
BinaryFormatter bf = new BinaryFormatter ();
@@ -1201,9 +1198,6 @@ namespace MonoTests.System.Drawing {
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,0,0,0,0,0,0,0,0,37,0,1,0,11 };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize2 ()
{
BinaryFormatter bf = new BinaryFormatter ();
@@ -1229,9 +1223,6 @@ namespace MonoTests.System.Drawing {
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,255,0,0,255,0,0,0,0,0,0,2,0,11};
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize3 ()
{
BinaryFormatter bf = new BinaryFormatter ();
@@ -1285,7 +1276,6 @@ namespace MonoTests.System.Drawing {
}
}
-#if !TARGET_JVM
private void Compare (KnownColor kc, GetSysColorIndex index)
{
// we get BGR than needs to be converted into ARGB
@@ -1335,7 +1325,6 @@ namespace MonoTests.System.Drawing {
Compare (KnownColor.MenuHighlight, GetSysColorIndex.COLOR_MENUHIGHLIGHT);
#endif
}
-#endif // TARGET_JVM
}
}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
index 05038a1136..f01160f3b7 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestFont.cs
@@ -118,7 +118,6 @@ namespace MonoTests.System.Drawing{
public string lfFaceName;
}
-#if !TARGET_JVM
[Test]
[Category ("CAS")]
[ExpectedException (typeof (SecurityException))]
@@ -199,13 +198,9 @@ namespace MonoTests.System.Drawing{
Font f = new Font ("Arial", 10);
f.ToLogFont (null);
}
-#endif
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
-#endif
-#if TARGET_JVM
- [Category ("NotWorking")]
#endif
public void Font_StringNull_Float ()
{
@@ -219,9 +214,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float ()
{
Font f = new Font (name, 12.5f);
@@ -240,9 +232,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle ()
{
Font f = new Font (name, 12.5f, FontStyle.Bold);
@@ -261,9 +250,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Pixel);
@@ -282,18 +268,12 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (name, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
@@ -312,9 +292,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (name, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
@@ -349,9 +326,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f);
@@ -370,9 +344,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Bold);
@@ -391,9 +362,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Millimeter);
@@ -413,18 +381,12 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
@@ -443,9 +405,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
@@ -484,9 +443,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_Height ()
{
Font f = new Font (name, 12.5f);
@@ -496,26 +452,17 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT();
f.ToLogFont (lf);
-#endif
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont_LoopCharSet ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT ();
@@ -560,21 +507,15 @@ namespace MonoTests.System.Drawing{
Assert.Fail ("Unexcepted exception {0} at iteration {1}", e, i);
}
}
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToHFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
f.ToHfont ();
-#endif
}
[Test]
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestIcon.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestIcon.cs
index 36568741c3..203dfe3479 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestIcon.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestIcon.cs
@@ -94,18 +94,12 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Int_Int ()
{
new Icon ((Icon)null, 32, 32);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_IntNegative_Int Not Working")]
-#endif
public void Constructor_Icon_IntNegative_Int ()
{
Icon neg = new Icon (icon, -32, 32);
@@ -115,18 +109,12 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Size ()
{
new Icon ((Icon) null, new Size (32, 32));
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Size_Negative Not Working")]
-#endif
public void Constructor_Icon_Size_Negative ()
{
Icon neg = new Icon (icon, new Size (-32, -32));
@@ -135,9 +123,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Int_Int_NonSquare Not Working")]
-#endif
public void Constructor_Icon_Int_Int_NonSquare ()
{
Icon non_square = new Icon (icon, 32, 16);
@@ -217,9 +202,6 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_Type_StringNull ()
{
new Icon (typeof (Icon), null);
@@ -227,38 +209,23 @@ namespace MonoTests.System.Drawing {
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StreamNull_Size Not Implemented")]
-#endif
public void Constructor_StreamNull_Size ()
{
-#if !TARGET_JVM
new Icon ((Stream) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Size Not Implemented")]
-#endif
public void Constructor_StringNull_Size ()
{
-#if !TARGET_JVM
new Icon ((string) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Int_Int Not Implemented")]
-#endif
public void Constructor_StringNull_Int_Int ()
{
-#if !TARGET_JVM
new Icon ((string) null, 32, 32);
-#endif
}
#endif
@@ -281,7 +248,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (32, clone.Size.Height, "Size.Height");
}
-#if !TARGET_JVM
[Test]
public void CloneHandleIcon ()
{
@@ -291,7 +257,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (SystemIcons.Hand.Size.Width, clone.Size.Width, "Size.Width");
Assert.AreEqual (SystemIcons.Hand.Size.Height, clone.Size.Height, "Size.Height");
}
-#endif
private void XPIcon (int size)
{
@@ -331,9 +296,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("SelectFromUnusualSize_Small16 Not Working")]
-#endif
public void SelectFromUnusualSize_Small16 ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/80509.ico"))) {
@@ -421,18 +383,12 @@ namespace MonoTests.System.Drawing {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [Ignore ("Throws NullReference, do we need to follow?")]
-#endif
public void Save_Null ()
{
icon.Save (null);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon16ToBitmap Not Working")]
-#endif
public void Icon16ToBitmap ()
{
using (Bitmap b = icon16.ToBitmap ()) {
@@ -447,9 +403,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon32ToBitmap Not Working")]
-#endif
public void Icon32ToBitmap ()
{
using (Bitmap b = icon32.ToBitmap ()) {
@@ -464,9 +417,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon48ToBitmap Not Working")]
-#endif
public void Icon48ToBitmap ()
{
using (Bitmap b = icon48.ToBitmap ()) {
@@ -481,9 +431,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon64ToBitmap Not Working")]
-#endif
public void Icon64ToBitmap ()
{
using (Bitmap b = icon64.ToBitmap ()) {
@@ -498,9 +445,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon96ToBitmap Not Working")]
-#endif
public void Icon96ToBitmap ()
{
using (Bitmap b = icon96.ToBitmap ()) {
@@ -515,9 +459,6 @@ namespace MonoTests.System.Drawing {
}
[Test] // bug #415581
-#if TARGET_JVM
- [Ignore ("Icon256ToBitmap Not Working")]
-#endif
public void Icon256ToBitmap ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/415581.ico"))) {
@@ -572,38 +513,23 @@ namespace MonoTests.System.Drawing {
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Null ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (null);
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Empty ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (String.Empty);
-#endif
}
[Test]
[ExpectedException (typeof (FileNotFoundException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_DoesNotExists ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon ("does-not-exists.png");
-#endif
}
#endif
@@ -617,11 +543,7 @@ namespace MonoTests.System.Drawing {
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class IconFullTrustTest {
-#if !TARGET_JVM
#if NET_2_0
[Test]
public void ExtractAssociatedIcon ()
@@ -721,6 +643,5 @@ namespace MonoTests.System.Drawing {
IconTest.SaveAndCompare ("HICON", icon3, false);
}
}
-#endif
}
}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestIconConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestIconConverter.cs
index 76e5098cf1..6fcfadabe4 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestIconConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestIconConverter.cs
@@ -81,9 +81,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (icoConv.CanConvertFrom (typeof (byte [])), "CCF#1");
@@ -115,9 +112,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (icoConv.CanConvertTo (typeof (String)), "CCT#1");
@@ -151,9 +145,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Icon newIcon = (Icon) icoConv.ConvertFrom (null, CultureInfo.InvariantCulture, iconBytes);
@@ -264,9 +255,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertTo ()
{
Assert.AreEqual (iconStr, (String) icoConv.ConvertTo (null,
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestImageConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestImageConverter.cs
index 94a71a8cbb..4176be6e71 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestImageConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestImageConverter.cs
@@ -77,9 +77,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (imgConv.CanConvertFrom (typeof (byte [])), "CCF#1");
@@ -111,9 +108,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (imgConv.CanConvertTo (typeof (String)), "CCT#1");
@@ -147,9 +141,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Image newImage = (Image) imgConv.ConvertFrom (null, CultureInfo.InvariantCulture, imageBytes);
@@ -166,9 +157,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString ()
{
@@ -176,9 +164,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString_WithCulture ()
{
@@ -186,9 +171,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Bitmap ()
{
@@ -196,9 +178,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Point ()
{
@@ -206,9 +185,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_SizeF ()
{
@@ -216,9 +192,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Object ()
{
@@ -226,9 +199,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString ()
{
@@ -236,9 +206,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString_Culture ()
{
@@ -246,9 +213,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Bitmap ()
{
@@ -256,9 +220,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Point ()
{
@@ -266,9 +227,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_SizeF ()
{
@@ -276,9 +234,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Object ()
{
@@ -286,9 +241,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertTo ()
{
Assert.AreEqual (imageStr, (String) imgConv.ConvertTo (null, CultureInfo.InvariantCulture,
@@ -326,9 +278,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Rectangle ()
{
@@ -336,9 +285,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Image ()
{
@@ -346,9 +292,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Size ()
{
@@ -356,9 +299,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Bitmap ()
{
@@ -366,9 +306,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Point ()
{
@@ -376,9 +313,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Metafile ()
{
@@ -386,9 +320,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Object ()
{
@@ -396,9 +327,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Int ()
{
@@ -406,9 +334,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Rectangle ()
{
@@ -416,9 +341,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Image ()
{
@@ -426,9 +348,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Size ()
{
@@ -436,9 +355,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Bitmap ()
{
@@ -446,9 +362,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Point ()
{
@@ -456,9 +369,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Metafile ()
{
@@ -466,9 +376,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Object ()
{
@@ -476,9 +383,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Int ()
{
@@ -486,9 +390,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetPropertiesSupported ()
{
Assert.IsTrue (imgConv.GetPropertiesSupported (), "GPS#1");
@@ -496,9 +397,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
#if NET_2_0
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestPointConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestPointConverter.cs
index f4e3cdd301..b96d206539 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestPointConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestPointConverter.cs
@@ -63,9 +63,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (ptconv.CanConvertFrom (typeof (String)), "CCF#1");
@@ -97,9 +94,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (pt, (Point) ptconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -280,9 +274,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
@@ -325,9 +316,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
@@ -341,9 +329,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
@@ -367,9 +352,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs
index 9a91763397..9f48a9e623 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs
@@ -69,9 +69,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (rconv.CanConvertFrom (typeof (String)), "CCF#1");
@@ -103,9 +100,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (rect, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -334,9 +328,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
@@ -394,9 +385,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
@@ -410,9 +398,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
@@ -438,9 +423,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestRegion.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestRegion.cs
index 7a12e92b94..29bb158d5f 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestRegion.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestRegion.cs
@@ -85,9 +85,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestCloneAndEquals()
{
Bitmap bmp = new Bitmap (600, 800);
@@ -122,9 +119,6 @@ namespace MonoTests.System.Drawing
/*Tests infinite, empty, etc*/
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestInfiniteAndEmpty()
{
Bitmap bmp = new Bitmap (600, 800);
@@ -160,9 +154,6 @@ namespace MonoTests.System.Drawing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup1 ()
{
Bitmap bmp = new Bitmap (600, 800);
@@ -316,9 +307,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup2 ()
{
RectangleF[] rects;
@@ -466,9 +454,6 @@ namespace MonoTests.System.Drawing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup1 ()
{
RectangleF[] rects;
@@ -573,9 +558,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup2 ()
{
@@ -614,9 +596,6 @@ namespace MonoTests.System.Drawing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup1 ()
{
RectangleF[] rects;
@@ -880,9 +859,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup2 ()
{
Bitmap bmp = new Bitmap (600, 800);
@@ -912,9 +888,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ExcludeBug402613 ()
{
Region r = new Region();
@@ -925,9 +898,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestIntersect()
{
@@ -972,9 +942,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestXor()
{
Bitmap bmp = new Bitmap (600, 800);
@@ -1064,9 +1031,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestTranslate()
{
Region rgn1 = new Region (new RectangleF (10, 10, 120,120));
@@ -1085,9 +1049,6 @@ namespace MonoTests.System.Drawing
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_GraphicsPath_Null ()
{
GraphicsPath gp = null;
@@ -1096,9 +1057,6 @@ namespace MonoTests.System.Drawing
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_RegionData_Null ()
{
RegionData rd = null;
@@ -1204,27 +1162,18 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntNull ()
{
Assert.IsTrue (new Region ().IsVisible (0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntIntIntNull ()
{
Assert.IsFalse (new Region ().IsVisible (0, 0, 0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointNull ()
{
Point p = new Point ();
@@ -1232,9 +1181,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointFNull ()
{
PointF p = new PointF ();
@@ -1242,9 +1188,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleNull ()
{
Rectangle r = new Rectangle ();
@@ -1252,9 +1195,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleFNull ()
{
RectangleF r = new RectangleF ();
@@ -1262,18 +1202,12 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleNull ()
{
Assert.IsTrue (new Region ().IsVisible (0f, 0f, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleSingleSingleNull ()
{
Assert.IsFalse (new Region ().IsVisible (0f, 0f, 0f, 0f, null));
@@ -1294,9 +1228,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void Equals_NullGraphics ()
{
@@ -1319,9 +1250,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void GetRegionScans_Null ()
{
@@ -1349,9 +1277,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Region_Empty ()
{
Region region = new Region ();
@@ -1388,9 +1313,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Rectangle_GetRegionScans ()
{
Matrix matrix = new Matrix ();
@@ -1579,12 +1501,8 @@ namespace MonoTests.System.Drawing
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
// the test cases in this fixture aren't restricted wrt running unmanaged code
public class RegionTestUnmanaged {
-#if !TARGET_JVM
private Bitmap bitmap;
private Graphics graphic;
@@ -1687,7 +1605,6 @@ namespace MonoTests.System.Drawing
Assert.IsFalse (IntPtr.Zero == ptr, "ptr");
r.ReleaseHrgn (ptr);
}
-#endif
#endif
}
}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestSizeConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestSizeConverter.cs
index 56ccc9cb95..7b0f751b61 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestSizeConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestSizeConverter.cs
@@ -64,9 +64,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
@@ -98,9 +95,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (Size) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -283,9 +277,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
@@ -330,9 +321,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
@@ -346,9 +334,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
@@ -374,9 +359,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestSizeFConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestSizeFConverter.cs
index edb0f74ccd..63c1a1410b 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestSizeFConverter.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestSizeFConverter.cs
@@ -66,9 +66,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
@@ -100,9 +97,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (SizeF) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -284,9 +278,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
@@ -331,9 +322,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
@@ -347,9 +335,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
@@ -375,9 +360,6 @@ namespace MonoTests.System.Drawing
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs
index 31aaf10211..e8b68c56f4 100644
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs
+++ b/mcs/class/System.Drawing/Test/System.Drawing/TestStringFormat.cs
@@ -67,9 +67,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Default_Dispose ()
{
StringFormat sf = new StringFormat ();
@@ -93,9 +90,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags)Int32.MinValue)) {
@@ -104,9 +98,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags_Int32 ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags) Int32.MinValue, Int32.MinValue)) {
@@ -130,9 +121,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericDefault_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericDefault;
@@ -168,9 +156,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericTypographic_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericTypographic;
@@ -191,9 +176,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Alignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -214,9 +196,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void HotkeyPrefix_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -237,9 +216,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void LineAlignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -260,9 +236,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Trimming_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -281,9 +254,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Clone_Complex ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -321,9 +291,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TabsStops()
{
using (StringFormat smf = new StringFormat ()) {
@@ -345,9 +312,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetTabStops_Null ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -356,9 +320,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetDigitSubstitution ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -370,9 +331,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_Null ()
{
using (StringFormat sf = new StringFormat ()) {
@@ -400,9 +358,6 @@ namespace MonoTests.System.Drawing{
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_TooBig ()
{
using (StringFormat sf = new StringFormat ()) {
diff --git a/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.exclude.sources b/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.exclude.sources
deleted file mode 100644
index f4fe0d38a2..0000000000
--- a/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.exclude.sources
+++ /dev/null
@@ -1,82 +0,0 @@
-##files existing in both profiles
-System.Drawing.Drawing2D/AdjustableArrowCap.cs
-System.Drawing.Drawing2D/CustomLineCap.cs
-System.Drawing.Drawing2D/GraphicsContainer.cs
-System.Drawing.Drawing2D/GraphicsPath.cs
-System.Drawing.Drawing2D/GraphicsPathIterator.cs
-System.Drawing.Drawing2D/GraphicsState.cs
-System.Drawing.Drawing2D/HatchBrush.cs
-System.Drawing.Drawing2D/LinearGradientBrush.cs
-System.Drawing.Drawing2D/Matrix.cs
-System.Drawing.Drawing2D/PathGradientBrush.cs
-System.Drawing.Imaging/EncoderParameter.cs
-System.Drawing.Imaging/ImageAttributes.cs
-System.Drawing.Imaging/ImageCodecInfo.cs
-System.Drawing.Imaging/Metafile.cs
-System.Drawing.Text/FontCollection.cs
-System.Drawing.Text/InstalledFontCollection.cs
-System.Drawing.Text/PrivateFontCollection.cs
-System.Drawing/Bitmap.cs
-System.Drawing/Brush.cs
-System.Drawing/Font.cs
-System.Drawing/FontFamily.cs
-System.Drawing/Graphics.cs
-System.Drawing/Icon.cs
-System.Drawing/Image.cs
-System.Drawing/Pen.cs
-System.Drawing/Region.cs
-System.Drawing/SolidBrush.cs
-System.Drawing/StringFormat.cs
-System.Drawing/SystemColors.cs
-System.Drawing/SystemIcons.cs
-System.Drawing/TextureBrush.cs
-
-##completely different files
-System.Drawing.Design/CategoryNameCollection.cs
-System.Drawing.Design/IPropertyValueUIService.cs
-System.Drawing.Design/IToolboxService.cs
-System.Drawing.Design/IToolboxUser.cs
-System.Drawing.Design/PaintValueEventArgs.cs
-System.Drawing.Design/PropertyValueItem.cs
-System.Drawing.Design/PropertyValueUIHandler.cs
-System.Drawing.Design/PropertyValueUIItemInvokeHandler.cs
-System.Drawing.Design/ToolboxItemCollection.cs
-System.Drawing.Design/ToolboxItemCreatorCallback.cs
-System.Drawing.Imaging/PlayRecordCallback.cs
-System.Drawing.Printing/Duplex.cs
-System.Drawing.Printing/InvalidPrinterException.cs
-System.Drawing.Printing/Margins.cs
-System.Drawing.Printing/MarginsConverter.cs
-System.Drawing.Printing/PageSettings.cs
-System.Drawing.Printing/PaperKind.cs
-System.Drawing.Printing/PaperSize.cs
-System.Drawing.Printing/PaperSource.cs
-System.Drawing.Printing/PaperSourceKind.cs
-System.Drawing.Printing/PreviewPageInfo.cs
-System.Drawing.Printing/PreviewPrintController.cs
-System.Drawing.Printing/PrintController.cs
-System.Drawing.Printing/PrintDocument.cs
-System.Drawing.Printing/PrintEventArgs.cs
-System.Drawing.Printing/PrintEventHandler.cs
-System.Drawing.Printing/PrintPageEventArgs.cs
-System.Drawing.Printing/PrintPageEventHandler.cs
-System.Drawing.Printing/PrintRange.cs
-System.Drawing.Printing/PrinterResolution.cs
-System.Drawing.Printing/PrinterResolutionKind.cs
-System.Drawing.Printing/PrinterSettings.cs
-System.Drawing.Printing/PrinterUnit.cs
-System.Drawing.Printing/PrinterUnitConvert.cs
-System.Drawing.Printing/PrintingPermission.cs
-System.Drawing.Printing/PrintingPermissionAttribute.cs
-System.Drawing.Printing/PrintingPermissionLevel.cs
-System.Drawing.Printing/QueryPageSettingsEventArgs.cs
-System.Drawing.Printing/QueryPageSettingsEventHandler.cs
-System.Drawing.Printing/StandardPrintController.cs
-System.Drawing/ComIStreamMarshaler.cs
-System.Drawing/ComIStreamWrapper.cs
-System.Drawing/SRDescriptionAttribute.cs
-System.Drawing/gdipEnums.cs
-System.Drawing/gdipFunctions.cs
-System.Drawing/gdipStructs.cs
-System.Drawing/carbonFunctions.cs
-
diff --git a/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.sources b/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.sources
deleted file mode 100644
index 9d557f864e..0000000000
--- a/mcs/class/System.Drawing/net_1_1_java_System.Drawing.dll.sources
+++ /dev/null
@@ -1,49 +0,0 @@
-#include System.Drawing.dll.sources
-
-##files existing in both profiles
-System.Drawing.Drawing2D/AdjustableArrowCap.jvm.cs
-System.Drawing.Drawing2D/CustomLineCap.jvm.cs
-System.Drawing.Drawing2D/GraphicsContainer.jvm.cs
-System.Drawing.Drawing2D/GraphicsPath.jvm.cs
-System.Drawing.Drawing2D/GraphicsPathIterator.jvm.cs
-System.Drawing.Drawing2D/GraphicsState.jvm.cs
-System.Drawing.Drawing2D/HatchBrush.jvm.cs
-System.Drawing.Drawing2D/LinearGradientBrush.jvm.cs
-System.Drawing.Drawing2D/Matrix.jvm.cs
-System.Drawing.Drawing2D/PathGradientBrush.jvm.cs
-System.Drawing.Imaging/EncoderParameter.jvm.cs
-System.Drawing.Imaging/ImageAttributes.jvm.cs
-System.Drawing.Imaging/ImageCodecInfo.jvm.cs
-System.Drawing.Imaging/Metafile.jvm.cs
-System.Drawing.Text/FontCollection.jvm.cs
-System.Drawing.Text/InstalledFontCollection.jvm.cs
-System.Drawing.Text/PrivateFontCollection.jvm.cs
-System.Drawing/Bitmap.jvm.cs
-System.Drawing/Brush.jvm.cs
-System.Drawing/Font.jvm.cs
-System.Drawing/FontFamily.jvm.cs
-System.Drawing/Graphics.jvm.cs
-System.Drawing/Icon.jvm.cs
-System.Drawing/Image.jvm.cs
-System.Drawing/Pen.jvm.cs
-System.Drawing/Region.jvm.cs
-System.Drawing/SolidBrush.jvm.cs
-System.Drawing/StringFormat.jvm.cs
-System.Drawing/SystemColors.jvm.cs
-System.Drawing/SystemIcons.jvm.cs
-System.Drawing/TextureBrush.jvm.cs
-
-##completely different files
-System.Drawing.Drawing2D/ExtendedGeneralPath.jvm.cs
-System.Drawing.Drawing2D/GeneralPathIterator.jvm.cs
-System.Drawing.Imaging/ImageCodec.jvm.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfiguration.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationCollection.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationHandler.cs
-System.Drawing.Text/LineLayout.jvm.cs
-System.Drawing.Text/TextLineIterator.jvm.cs
-System.Drawing/AdvancedStroke.jvm.cs
-System.Drawing/BasicShape.jvm.cs
-System.Drawing/PlainImage.jvm.cs
-System.Drawing/PlainImageCollection.jvm.cs
-System.Drawing/StrokeFactory.jvm.cs
diff --git a/mcs/class/System.IO.Compression.FileSystem/Makefile b/mcs/class/System.IO.Compression.FileSystem/Makefile
index 4e36c8abfd..764cf083f8 100644
--- a/mcs/class/System.IO.Compression.FileSystem/Makefile
+++ b/mcs/class/System.IO.Compression.FileSystem/Makefile
@@ -4,7 +4,6 @@ include ../../build/rules.make
LIBRARY = System.IO.Compression.FileSystem.dll
LIB_MCS_FLAGS = /r:System /r:System.IO.Compression.dll
-
-NO_TEST = yes
+TEST_MCS_FLAGS = /r:System /r:System.Core /r:System.IO.Compression.dll
include ../../build/library.make
diff --git a/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem_test.dll.sources b/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem_test.dll.sources
new file mode 100644
index 0000000000..dc67ea0cf1
--- /dev/null
+++ b/mcs/class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem_test.dll.sources
@@ -0,0 +1 @@
+System.IO.Compression.FileSystem/ZipTest.cs
diff --git a/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs b/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs
new file mode 100644
index 0000000000..0354311b47
--- /dev/null
+++ b/mcs/class/System.IO.Compression.FileSystem/Test/System.IO.Compression.FileSystem/ZipTest.cs
@@ -0,0 +1,109 @@
+//
+// ZipTest.cs
+//
+// Author:
+// João Matos
+//
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Security.Cryptography;
+using NUnit.Framework;
+
+namespace MonoTests.System.IO.Compression.FileSystem
+{
+ [TestFixture]
+ public class ZipArchiveTests
+ {
+ [TearDown]
+ public void Dispose()
+ {
+ File.Delete ("foo.zip");
+ }
+
+ [Test]
+ public void ZipCreateFromDirectory()
+ {
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip");
+ Assert.IsTrue(File.Exists("foo.zip"));
+
+ using (var archive = new ZipArchive (File.Open ("foo.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ Assert.IsNotNull (archive.GetEntry ("foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("bar.txt"));
+
+ Assert.IsNotNull (archive.GetEntry ("foobar/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foobar/bar.txt"));
+ }
+ }
+
+ [Test]
+ public void ZipCreateFromDirectoryIncludeBase()
+ {
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip", CompressionLevel.Fastest,
+ includeBaseDirectory: true);
+ Assert.IsTrue (File.Exists ("foo.zip"));
+
+ using (var archive = new ZipArchive (File.Open ("foo.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ Assert.IsNotNull (archive.GetEntry ("foo/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foo/bar.txt"));
+
+ Assert.IsNotNull (archive.GetEntry ("foo/foobar/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foo/foobar/bar.txt"));
+ }
+ }
+
+ [Test]
+ public void ZipExtractToDirectory()
+ {
+ if (Directory.Exists ("extract"))
+ Directory.Delete ("extract", true);
+
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip");
+
+ ZipFile.ExtractToDirectory ("foo.zip", "extract");
+ Assert.IsTrue(Directory.Exists ("extract"));
+
+ Assert.IsTrue (File.Exists ("extract/foo.txt"));
+ Assert.IsTrue (File.Exists ("extract/bar.txt"));
+ Assert.IsTrue (Directory.Exists ("extract/foobar"));
+ Assert.IsTrue (File.Exists ("extract/foobar/foo.txt"));
+ Assert.IsTrue (File.Exists ("extract/foobar/bar.txt"));
+
+ Directory.Delete ("extract", true);
+ }
+ }
+}
diff --git a/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs b/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs
index e6016708ab..eaa3b75230 100644
--- a/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs
+++ b/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs
@@ -2,6 +2,7 @@
// ZipFile.cs
//
// Author:
+// João Matos
// Martin Baulig
//
// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
@@ -28,20 +29,21 @@ using System.Text;
namespace System.IO.Compression
{
- [MonoTODO]
public static class ZipFile
{
public static void CreateFromDirectory (
string sourceDirectoryName, string destinationArchiveFileName)
{
- throw new NotImplementedException ();
+ CreateFromDirectory (sourceDirectoryName, destinationArchiveFileName,
+ CompressionLevel.Fastest, includeBaseDirectory: false);
}
public static void CreateFromDirectory (
string sourceDirectoryName, string destinationArchiveFileName,
CompressionLevel compressionLevel, bool includeBaseDirectory)
{
- throw new NotImplementedException ();
+ CreateFromDirectory (sourceDirectoryName, destinationArchiveFileName,
+ CompressionLevel.Fastest, includeBaseDirectory, Encoding.UTF8);
}
public static void CreateFromDirectory (
@@ -51,38 +53,129 @@ namespace System.IO.Compression
bool includeBaseDirectory,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (sourceDirectoryName == null)
+ throw new ArgumentNullException ("sourceDirectoryName");
+
+ if (destinationArchiveFileName == null)
+ throw new ArgumentNullException ("destinationArchiveFileName");
+
+ if (string.IsNullOrWhiteSpace (sourceDirectoryName))
+ throw new ArgumentException ("sourceDirectoryName");
+
+ if (string.IsNullOrWhiteSpace (destinationArchiveFileName))
+ throw new ArgumentException ("destinationArchiveFileName");
+
+ if (entryNameEncoding == Encoding.Unicode ||
+ entryNameEncoding == Encoding.UTF32 ||
+ entryNameEncoding == Encoding.UTF7)
+ throw new ArgumentException ("entryNameEncoding");
+
+ if (entryNameEncoding == null)
+ entryNameEncoding = Encoding.UTF8;
+
+ if (!Directory.Exists (sourceDirectoryName))
+ throw new DirectoryNotFoundException ("sourceDirectoryName is invalid or does not exist");
+
+ var sourceDir = new DirectoryInfo (Path.GetFullPath (sourceDirectoryName));
+
+ string fullBaseName = sourceDir.FullName;
+ if (includeBaseDirectory && sourceDir.Parent != null)
+ fullBaseName = sourceDir.Parent.FullName;
+
+ bool hasEntries = false;
+ char[] separators = new char[] {
+ Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar
+ };
+
+ using (var zipFile = ZipFile.Open (destinationArchiveFileName, ZipArchiveMode.Create,
+ entryNameEncoding)) {
+ var entries = sourceDir.EnumerateFileSystemInfos ("*", SearchOption.AllDirectories);
+ foreach (var entry in entries) {
+ hasEntries = true;
+
+ int length = entry.FullName.Length - fullBaseName.Length;
+ string entryName = entry.FullName.Substring(fullBaseName.Length, length);
+
+ entryName = entryName.TrimStart(separators);
+
+ if (entry is FileInfo)
+ zipFile.CreateEntryFromFile (entry.FullName, entryName, compressionLevel);
+ else
+ zipFile.CreateEntry (entryName + Path.DirectorySeparatorChar);
+ }
+
+ // Create the base directory even if we had no entries
+ if (includeBaseDirectory && !hasEntries)
+ zipFile.CreateEntry(sourceDir.Name + Path.DirectorySeparatorChar);
+ }
}
public static void ExtractToDirectory (
string sourceArchiveFileName, string destinationDirectoryName)
{
- throw new NotImplementedException ();
+ ExtractToDirectory (sourceArchiveFileName, destinationDirectoryName,
+ Encoding.UTF8);
}
public static void ExtractToDirectory (
string sourceArchiveFileName, string destinationDirectoryName,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (sourceArchiveFileName == null)
+ throw new ArgumentNullException ("sourceArchiveFileName");
+
+ using (ZipArchive zipArchive = ZipFile.Open(sourceArchiveFileName,
+ ZipArchiveMode.Read, entryNameEncoding))
+ {
+ zipArchive.ExtractToDirectory(destinationDirectoryName);
+ }
}
public static ZipArchive Open (
string archiveFileName, ZipArchiveMode mode)
{
- throw new NotImplementedException ();
+ return Open (archiveFileName, mode);
}
public static ZipArchive Open (
string archiveFileName, ZipArchiveMode mode,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (archiveFileName == null)
+ throw new ArgumentNullException ("archiveFileName");
+
+ if (string.IsNullOrWhiteSpace (archiveFileName))
+ throw new ArgumentException ("archiveFileName");
+
+ FileStream stream;
+
+ switch (mode) {
+ case ZipArchiveMode.Read:
+ if (!File.Exists (archiveFileName))
+ throw new FileNotFoundException ();
+ stream = new FileStream (archiveFileName, FileMode.Open, FileAccess.Read,
+ FileShare.Read);
+ break;
+ case ZipArchiveMode.Create:
+ if (File.Exists (archiveFileName))
+ throw new IOException ("mode is set to Create but the file already exists");
+ stream = new FileStream (archiveFileName, FileMode.CreateNew, FileAccess.Write);
+ break;
+ case ZipArchiveMode.Update:
+ stream = new FileStream (archiveFileName, FileMode.OpenOrCreate,
+ FileAccess.ReadWrite);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+
+ return new ZipArchive (stream, mode, false, entryNameEncoding);
}
public static ZipArchive OpenRead (string archiveFileName)
{
- throw new NotImplementedException ();
+ return ZipFile.Open (archiveFileName, ZipArchiveMode.Read);
}
}
}
diff --git a/mcs/class/System.IO.Compression.FileSystem/ZipFileExtensions.cs b/mcs/class/System.IO.Compression.FileSystem/ZipFileExtensions.cs
index 1abe0e0e16..07a8448171 100644
--- a/mcs/class/System.IO.Compression.FileSystem/ZipFileExtensions.cs
+++ b/mcs/class/System.IO.Compression.FileSystem/ZipFileExtensions.cs
@@ -2,6 +2,7 @@
// ZipFileExtensions.cs
//
// Author:
+// João Matos
// Martin Baulig
//
// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
@@ -27,43 +28,95 @@ using System;
namespace System.IO.Compression
{
- [MonoTODO]
public static class ZipFileExtensions
{
public static ZipArchiveEntry CreateEntryFromFile (
this ZipArchive destination, string sourceFileName,
string entryName)
{
- throw new NotImplementedException ();
+ return CreateEntryFromFile (destination, sourceFileName, entryName,
+ CompressionLevel.Fastest);
}
public static ZipArchiveEntry CreateEntryFromFile (
this ZipArchive destination, string sourceFileName,
- string entryName, CompressionLevel compressionLevel
- )
+ string entryName, CompressionLevel compressionLevel)
{
- throw new NotImplementedException ();
+ if (destination == null)
+ throw new ArgumentNullException ("destination");
+
+ if (sourceFileName == null)
+ throw new ArgumentNullException ("sourceFileName");
+
+ if (entryName == null)
+ throw new ArgumentNullException ("entryName");
+
+ ZipArchiveEntry entry;
+ using (Stream stream = File.Open (sourceFileName, FileMode.Open,
+ FileAccess.Read, FileShare.Read))
+ {
+ var zipArchiveEntry = destination.CreateEntry (entryName, compressionLevel);
+
+ using (Stream entryStream = zipArchiveEntry.Open ())
+ stream.CopyTo (entryStream);
+
+ entry = zipArchiveEntry;
+ }
+
+ return entry;
}
public static void ExtractToDirectory (
this ZipArchive source,
string destinationDirectoryName)
{
- throw new NotImplementedException ();
+ if (source == null)
+ throw new ArgumentNullException ("source");
+
+ if (destinationDirectoryName == null)
+ throw new ArgumentNullException ("destinationDirectoryName");
+
+ var destDirInfo = Directory.CreateDirectory (destinationDirectoryName);
+ string fullName = destDirInfo.FullName;
+
+ foreach (var zipEntry in source.Entries)
+ {
+ var fullPath = Path.GetFullPath (Path.Combine (fullName, zipEntry.FullName));
+
+ var isFileName = Path.GetFileName (fullPath).Length != 0;
+ var dirPath = isFileName ? Path.GetDirectoryName (fullPath) : fullPath;
+ Directory.CreateDirectory (dirPath);
+
+ if (isFileName)
+ zipEntry.ExtractToFile (fullPath, false);
+ }
}
public static void ExtractToFile (
this ZipArchiveEntry source,
string destinationFileName)
{
- throw new NotImplementedException ();
+ ExtractToFile (source, destinationFileName, overwrite: false);
}
public static void ExtractToFile (
this ZipArchiveEntry source, string destinationFileName,
bool overwrite)
{
- throw new NotImplementedException ();
+ if (source == null)
+ throw new ArgumentNullException ("source");
+
+ if (destinationFileName == null)
+ throw new ArgumentNullException ("destinationFileName");
+
+ var mode = overwrite ? FileMode.Create : FileMode.CreateNew;
+ using (var stream = File.Open (destinationFileName, mode, FileAccess.Write))
+ {
+ using (var stream2 = source.Open ())
+ stream2.CopyTo(stream);
+ }
+
+ File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime);
}
}
}
diff --git a/mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs b/mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs
index 83032d92ec..76a8853d0a 100644
--- a/mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs
+++ b/mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs
@@ -132,7 +132,7 @@ namespace SharpCompress.Writer.Zip
if (pos >= 0)
filename = filename.Remove(0, pos + 1);
- return filename.Trim('/');
+ return filename;
}
private int WriteHeader(string filename, DateTime? modificationTime)
diff --git a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
index 8158dfd757..478af95dbe 100644
--- a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
+++ b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
@@ -166,6 +166,8 @@ namespace MonoTests.System.IO.Compression
using (var archive = new ZipArchive(File.Open("create.zip", FileMode.Create),
ZipArchiveMode.Create))
{
+ var dir = archive.CreateEntry("foobar/");
+
var entry = archive.CreateEntry("foo.txt");
using (var stream = entry.Open())
{
@@ -177,6 +179,8 @@ namespace MonoTests.System.IO.Compression
using (var archive = new ZipArchive(File.Open("create.zip", FileMode.Open),
ZipArchiveMode.Read))
{
+ Assert.IsNotNull(archive.GetEntry("foobar/"));
+
var entry = archive.GetEntry("foo.txt");
Assert.IsNotNull(entry);
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/ICustomIdentityConfiguration.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/ICustomIdentityConfiguration.cs
new file mode 100644
index 0000000000..91ae5d7ec6
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/ICustomIdentityConfiguration.cs
@@ -0,0 +1,39 @@
+//
+// ICustomIdentityConfiguration.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System.Xml;
+
+namespace System.IdentityModel.Configuration
+{
+ public interface ICustomIdentityConfiguration
+ {
+ void LoadCustomConfiguration(XmlNodeList nodeList);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/IdentityModelCaches.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/IdentityModelCaches.cs
new file mode 100644
index 0000000000..cbe68f8f05
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Configuration/IdentityModelCaches.cs
@@ -0,0 +1,40 @@
+//
+// IdentityModelCaches.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Configuration
+{
+ public sealed class IdentityModelCaches
+ {
+ public SessionSecurityTokenCache SessionSecurityTokenCache { get; set; }
+ public TokenReplayCache TokenReplayCache { get; set; }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/BinaryExchange.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/BinaryExchange.cs
new file mode 100644
index 0000000000..84f8f3bb77
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/BinaryExchange.cs
@@ -0,0 +1,53 @@
+//
+// BinaryExchange.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class BinaryExchange
+ {
+ private const string defaultEncodingTypeUrl = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary";
+
+ public byte[] BinaryData { get; private set; }
+ public Uri EncodingType { get; private set; }
+ public Uri ValueType { get; private set; }
+
+ public BinaryExchange (byte[] binaryData, Uri valueType)
+ : this (binaryData, valueType, new Uri (defaultEncodingTypeUrl))
+ { }
+
+ public BinaryExchange (byte[] binaryData, Uri valueType, Uri encodingType) {
+ BinaryData = binaryData;
+ ValueType = valueType;
+ EncodingType = encodingType;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleInfoMessageEventArgs.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/EndpointReference.cs
similarity index 54%
rename from mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleInfoMessageEventArgs.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/EndpointReference.cs
index d16d52a724..22828af6bd 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleInfoMessageEventArgs.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/EndpointReference.cs
@@ -1,12 +1,10 @@
+//
+// EndpointReference.cs
//
-// System.Data.SqlClient.SqlInfoMessageEventArgs
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-// Authors:
-// Konstantin Triger
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -27,51 +25,40 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_4_5
using System;
-using System.Data;
+using System.Collections.ObjectModel;
+using System.Xml;
-namespace System.Data.OracleClient {
- ///
- /// Summary description for SqlInfoMessageEventArgs.
- ///
- public sealed class OracleInfoMessageEventArgs : EventArgs {
- #region Fields
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class EndpointReference
+ {
+ private Collection details = new Collection ();
+ private Uri uri = null;
- readonly OracleErrorCollection errors ;
+ public Collection Details { get { return details; } }
+ public Uri Uri { get { return uri; } }
- #endregion // Fields
-
- #region Constructors
-
- internal OracleInfoMessageEventArgs (OracleErrorCollection errors) {
- this.errors = errors;
+ public EndpointReference (string uri) {
+ this.uri = new Uri (uri);
}
- #endregion // Constructors
-
- #region Properties
-
- public OracleErrorCollection Errors {
- get { return errors; }
- }
-
- public string Message {
- get { return errors[0].Message; }
- }
-
- public string Source {
- get { return errors[0].Source; }
+ [MonoTODO]
+ public static EndpointReference ReadFrom (XmlDictionaryReader reader) {
+ throw new NotImplementedException ();
}
- #endregion // Properties
-
- #region Methods
-
- public override string ToString() {
- return Message;
+ [MonoTODO]
+ public static EndpointReference ReadFrom(Xml.XmlReader reader) {
+ throw new NotImplementedException ();
}
- #endregion // Methods
+ [MonoTODO]
+ public void WriteTo (XmlWriter writer) {
+ throw new NotImplementedException ();
+ }
}
}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Entropy.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Entropy.cs
new file mode 100644
index 0000000000..4ec0c3e07b
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Entropy.cs
@@ -0,0 +1,60 @@
+//
+// Entropy.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System.IdentityModel.Tokens;
+using System.Security.Cryptography;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Entropy : ProtectedKey
+ {
+ public Entropy (ProtectedKey protectedKey) : base (protectedKey.GetKeyBytes (), protectedKey.WrappingCredentials)
+ { }
+
+ public Entropy (byte[] secret) : base (secret)
+ { }
+
+ public Entropy (int entropySizeInBits)
+ : this(Entropy.GetRandomByteArray(entropySizeInBits / 8))
+ { }
+
+ public Entropy (byte[] secret, EncryptingCredentials wrappingCredentials) : base (secret, wrappingCredentials)
+ { }
+
+ private static byte[] GetRandomByteArray (int arraySize) {
+ byte[] b = new byte[arraySize];
+
+ RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
+ rng.GetNonZeroBytes(b);
+
+ return b;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Lifetime.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Lifetime.cs
new file mode 100644
index 0000000000..403b420090
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Lifetime.cs
@@ -0,0 +1,49 @@
+//
+// Lifetime.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Lifetime
+ {
+ public DateTime? Created { get; set; }
+ public DateTime? Expires { get; set; }
+
+ public Lifetime (DateTime created, DateTime expires)
+ : this ((DateTime?)created, (DateTime?)expires)
+ { }
+
+ public Lifetime (DateTime? created, DateTime? expires) {
+ if (created.HasValue) { Created = created.Value.ToUniversalTime (); }
+ if (expires.HasValue) { Expires = expires.Value.ToUniversalTime (); }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/ProtectedKey.cs
similarity index 59%
rename from mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/ProtectedKey.cs
index fbdb138062..d04010538a 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleError.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/ProtectedKey.cs
@@ -1,12 +1,10 @@
-//
-// System.Data.OleDb.OleDbError
+//
+// ProtectedKey.cs
//
-// Authors:
-// Konstantin Triger
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -26,42 +24,32 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.OracleClient {
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- internal sealed class OracleError : AbstractDbError {
-
- internal OracleError(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
-
- public String Message {
- get {
- return DbMessage;
- }
- }
-
- public int NativeError {
- get {
- return DbErrorCode;
- }
- }
-
- public String Source {
- get {
- return DbSource;
- }
- }
-
- public String SQLState {
- get {
- return DbSQLState;
- }
- }
- }
-}
\ No newline at end of file
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class ProtectedKey
+ {
+ private byte[] secret;
+
+ public EncryptingCredentials WrappingCredentials { get; private set; }
+
+ public ProtectedKey (byte[] secret) {
+ this.secret = secret;
+ }
+
+ public ProtectedKey (byte[] secret, EncryptingCredentials wrappingCredentials) {
+ this.secret = secret;
+ WrappingCredentials = wrappingCredentials;
+ }
+
+ public byte[] GetKeyBytes () {
+ return secret;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestSecurityTokenResponse.cs
similarity index 52%
rename from mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestSecurityTokenResponse.cs
index b806967f33..f374d023a7 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestSecurityTokenResponse.cs
@@ -1,13 +1,10 @@
-//
-// Novell.Directory.Ldap.Security.ExchangeTokenPrivilegedAction.cs
+//
+// RequestSecurityTokenResponse.cs
//
-// Authors:
-// Boris Kirzner
-// Konstantin Triger
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -27,47 +24,32 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using org.ietf.jgss;
-using java.security;
-
-namespace Novell.Directory.Ldap.Security
-{
- internal class ExchangeTokenPrivilegedAction : PrivilegedAction
- {
- #region Fields
-
- private readonly sbyte [] _token;
- private readonly GSSContext _context;
-
- #endregion // Fields
-
- #region Constructors
-
- public ExchangeTokenPrivilegedAction(GSSContext context, sbyte [] token)
- {
- _token = token;
- _context = context;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- public object run()
- {
- try {
- sbyte [] token = _context.initSecContext (_token, 0, _token.Length);
- return token;
- }
- catch (GSSException e) {
- throw new PrivilegedActionException (e);
- }
- }
-
- #endregion // Methods
- }
-}
+//
+#if NET_4_5
+
+using System.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestSecurityTokenResponse : WSTrustMessage
+ {
+ public bool IsFinal { get; set; }
+ public SecurityKeyIdentifierClause RequestedAttachedReference { get; set; }
+ public RequestedProofToken RequestedProofToken { get; set; }
+ public RequestedSecurityToken RequestedSecurityToken { get; set; }
+ public bool RequestedTokenCancelled { get; set; }
+ public SecurityKeyIdentifierClause RequestedUnattachedReference { get; set; }
+ public Status Status { get; set; }
+
+ public RequestSecurityTokenResponse ()
+ { }
+
+ public RequestSecurityTokenResponse (WSTrustMessage message) {
+ Context = message.Context;
+ KeyType = message.KeyType;
+ KeySizeInBits = message.KeySizeInBits;
+ RequestType = message.RequestType;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedProofToken.cs
similarity index 56%
rename from mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedProofToken.cs
index 1f67bc1a32..098fe44ecf 100644
--- a/mcs/class/System.Drawing/System.Drawing.Text/PrivateFontCollection.jvm.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedProofToken.cs
@@ -1,10 +1,10 @@
+//
+// RequestedProofToken.cs
//
-// System.Drawing.PrivateFontCollection.cs
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.com)
-//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -24,35 +24,34 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using awt = java.awt;
-using io = java.io;
-using vmw.common;
-
-namespace System.Drawing.Text
-{
- ///
- /// Summary description for PrivateFontCollection.
- ///
- public sealed class PrivateFontCollection : FontCollection
- {
- public PrivateFontCollection()
- {
- }
-
- public void AddFontFile(string filename) {
- using(FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
- io.InputStream stream = vmw.common.IOUtils.ToInputStream (fs);
- awt.Font font = awt.Font.createFont(awt.Font.TRUETYPE_FONT, stream);
- AddFont(font);
- }
- }
-#if INTPTR_SUPPORT
- public void AddMemoryFont(IntPtr memory, int length) {
- }
-#endif
- }
-}
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestedProofToken
+ {
+ public string ComputedKeyAlgorithm { get; private set; }
+ public ProtectedKey ProtectedKey { get; private set; }
+
+ public RequestedProofToken (ProtectedKey protectedKey) {
+ ProtectedKey = protectedKey;
+ }
+
+ public RequestedProofToken (Byte[] secret) {
+ ProtectedKey = new ProtectedKey (secret);
+ }
+
+ public RequestedProofToken (string computedKeyAlgorithm) {
+ ComputedKeyAlgorithm = computedKeyAlgorithm;
+ }
+
+ public RequestedProofToken (Byte[] secret, EncryptingCredentials wrappingCredentials) {
+ ProtectedKey = new ProtectedKey (secret, wrappingCredentials);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedSecurityToken.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedSecurityToken.cs
new file mode 100644
index 0000000000..21f2356ec0
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/RequestedSecurityToken.cs
@@ -0,0 +1,50 @@
+//
+// RequestedSecurityToken.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Tokens;
+using System.Xml;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestedSecurityToken
+ {
+ public SecurityToken SecurityToken { get; private set; }
+ public virtual XmlElement SecurityTokenXml { get; private set; }
+
+ public RequestedSecurityToken (SecurityToken token) {
+ SecurityToken = token;
+ }
+
+ public RequestedSecurityToken (XmlElement tokenAsXml) {
+ SecurityTokenXml = tokenAsXml;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Status.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Status.cs
new file mode 100644
index 0000000000..d4cecc7962
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/Status.cs
@@ -0,0 +1,45 @@
+//
+// Status.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Status
+ {
+ public string Code { get; set; }
+ public string Reason { get; set; }
+
+ public Status (string code, string reason) {
+ Code = code;
+ Reason = reason;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/UseKey.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/UseKey.cs
new file mode 100644
index 0000000000..ad75cffe62
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/UseKey.cs
@@ -0,0 +1,57 @@
+//
+// UseKey.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class UseKey
+ {
+ public SecurityKeyIdentifier SecurityKeyIdentifier { get; private set; }
+ public SecurityToken Token { get; private set; }
+
+ public UseKey () : this (null, null)
+ { }
+
+ public UseKey (SecurityKeyIdentifier ski)
+ : this (ski, null)
+ { }
+
+ public UseKey (SecurityToken token)
+ : this (null, token)
+ { }
+
+ public UseKey (SecurityKeyIdentifier ski, SecurityToken token) {
+ SecurityKeyIdentifier = ski;
+ Token = token;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing/SolidBrush.jvm.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/WSTrustMessage.cs
similarity index 50%
rename from mcs/class/System.Drawing/System.Drawing/SolidBrush.jvm.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/WSTrustMessage.cs
index 7d0e4df26b..d4f6f7be8e 100644
--- a/mcs/class/System.Drawing/System.Drawing/SolidBrush.jvm.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Protocols/WSTrust/WSTrustMessage.cs
@@ -1,17 +1,10 @@
-//
-// System.Drawing.SolidBrush.cs
+//
+// WSTrustMessage.cs
//
// Author:
-// Dennis Hayes (dennish@Raytek.com)
-// Alexandre Pigolkine(pigolkine@gmx.de)
-// Ravindra (rkumar@novell.com)
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-// (C) 2002 Ximian, Inc.
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -32,46 +25,34 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if NET_4_5
+
using System;
-namespace System.Drawing
+using System.IdentityModel;
+
+namespace System.IdentityModel.Protocols.WSTrust
{
- public sealed class SolidBrush : Brush
+ public abstract class WSTrustMessage : OpenObject
{
- internal bool isModifiable = true;
- Color _color;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _color.NativeObject;
- }
- }
-
- public SolidBrush (Color color)
- {
- _color = color;
- }
-
- public Color Color {
- get {
- return _color;
- }
- set {
- if (isModifiable)
- _color = value;
- else
- throw new ArgumentException ("This SolidBrush object can't be modified.");
- }
- }
-
- public override object Clone()
- {
- return new SolidBrush(_color);
- }
-
- protected override void Dispose (bool disposing)
- {
- if (!isModifiable && disposing)
- throw new ArgumentException ("This SolidBrush object can't be modified.");
- }
+ public bool AllowPostdating { get; set; }
+ public EndpointReference AppliesTo { get; set; }
+ public string AuthenticationType { get; set; }
+ public BinaryExchange BinaryExchange { get; set; }
+ public string CanonicalizationAlgorithm { get; set; }
+ public string Context { get; set; }
+ public string EncryptionAlgorithm { get; set; }
+ public string EncryptWith { get; set; }
+ public Entropy Entropy { get; set; }
+ public int? KeySizeInBits { get; set; }
+ public string KeyType { get; set; }
+ public string KeyWrapAlgorithm { get; set; }
+ public Lifetime Lifetime { get; set; }
+ public string ReplyTo { get; set; }
+ public string RequestType { get; set; }
+ public string SignatureAlgorithm { get; set; }
+ public string SignWith { get; set; }
+ public string TokenType { get; set; }
+ public UseKey UseKey { get; set; }
}
}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AudienceRestriction.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AudienceRestriction.cs
new file mode 100644
index 0000000000..94dcef0fc6
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AudienceRestriction.cs
@@ -0,0 +1,51 @@
+//
+// AudienceRestriction.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+
+namespace System.IdentityModel.Tokens
+{
+ public class AudienceRestriction
+ {
+ public Collection AllowedAudienceUris { get; private set; }
+ public AudienceUriMode AudienceMode { get; set; }
+
+ public AudienceRestriction () {
+ AllowedAudienceUris = new Collection();
+ }
+
+ public AudienceRestriction (AudienceUriMode audienceMode)
+ : this ()
+ {
+ AudienceMode = audienceMode;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationContext.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationContext.cs
new file mode 100644
index 0000000000..22bb5501bf
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationContext.cs
@@ -0,0 +1,46 @@
+//
+// AuthenticationContext.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.ObjectModel;
+
+namespace System.IdentityModel.Tokens
+{
+ public class AuthenticationContext
+ {
+ public Collection Authorities { get; private set; }
+ public string ContextClass { get; set; }
+ public string ContextDeclaration { get; set; }
+
+ public AuthenticationContext () {
+ Authorities = new Collection ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationInformation.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationInformation.cs
new file mode 100644
index 0000000000..b5aa22e805
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/AuthenticationInformation.cs
@@ -0,0 +1,47 @@
+//
+// AuthenticationInformation.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Tokens;
+
+namespace System.Security.Claims
+{
+ public class AuthenticationInformation
+ {
+ private Collection authorizationContexts = new Collection ();
+
+ public String Address { get; set; }
+ public Collection AuthorizationContexts { get { return authorizationContexts; } }
+ public String DnsName { get; set; }
+ public Nullable NotOnOrAfter { get; set; }
+ public String Session { get; set; }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/EncryptingCredentials.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/EncryptingCredentials.cs
new file mode 100644
index 0000000000..c47d45ae79
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/EncryptingCredentials.cs
@@ -0,0 +1,50 @@
+//
+// EncryptingCredentials.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+
+namespace System.IdentityModel.Tokens
+{
+ public class EncryptingCredentials
+ {
+ public string Algorithm { get; set; }
+ public SecurityKey SecurityKey { get; set; }
+ public SecurityKeyIdentifier SecurityKeyIdentifier { get; set; }
+
+ public EncryptingCredentials ()
+ { }
+
+ public EncryptingCredentials (SecurityKey key, SecurityKeyIdentifier keyIdentifier, string algorithm) {
+ SecurityKey = key;
+ SecurityKeyIdentifier = keyIdentifier;
+ Algorithm = algorithm;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/IssuerNameRegistry.cs
similarity index 54%
rename from mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Tokens/IssuerNameRegistry.cs
index 8ff780aa16..ad1d2f96a5 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.jvm/OracleErrorCollection.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/IssuerNameRegistry.cs
@@ -1,12 +1,10 @@
-//
-// System.Data.OleDb.OleDbErrorCollection
+//
+// IssuerNameRegistry.cs
//
-// Authors:
-// Konstantin Triger
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -26,36 +24,32 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Data.OracleClient {
-
-
- using System.Collections;
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- public sealed class OracleErrorCollection : AbstractDbErrorCollection {
- internal OracleErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
- /**
- * Gets the error at the specified index.
- *
- * @param index of the error
- * @return Error on specified index
- */
- internal OracleError this[int index] {
- get {
- return (OracleError)GetDbItem(index);
- }
- }
-
- protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) {
- return new OracleError(e, connection);
- }
-
- }
-}
\ No newline at end of file
+//
+#if NET_4_5
+
+using System.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class IssuerNameRegistry : ICustomIdentityConfiguration
+ {
+ public abstract string GetIssuerName (SecurityToken securityToken);
+
+ [MonoTODO]
+ public virtual string GetIssuerName (SecurityToken securityToken, System.String requestedIssuerName) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual string GetWindowsIssuerName() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration(XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/ProofDescriptor.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/ProofDescriptor.cs
new file mode 100644
index 0000000000..74bcb6fa74
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/ProofDescriptor.cs
@@ -0,0 +1,41 @@
+//
+// ProofDescriptor.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System.IdentityModel.Protocols.WSTrust;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class ProofDescriptor
+ {
+ public abstract SecurityKeyIdentifier KeyIdentifier { get; }
+
+ public abstract void ApplyTo (RequestSecurityTokenResponse response);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityKeyIdentifierClause.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityKeyIdentifierClause.cs
index 5ded54d99d..1dba495463 100644
--- a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityKeyIdentifierClause.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityKeyIdentifierClause.cs
@@ -68,6 +68,8 @@ namespace System.IdentityModel.Tokens
return nonce != null ? (byte []) nonce.Clone () : null;
}
+ public string Id { get; set; }
+
public virtual SecurityKey CreateKey ()
{
throw new NotSupportedException (String.Format ("This '{0}' identifier clause does not support key creation.", GetType ()));
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenDescriptor.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenDescriptor.cs
new file mode 100644
index 0000000000..52b8681bac
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenDescriptor.cs
@@ -0,0 +1,74 @@
+//
+// SecurityTokenDescriptor.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using System.IdentityModel.Protocols.WSTrust;
+using System.Security.Claims;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenDescriptor
+ {
+ private Dictionary properties = new Dictionary ();
+
+ public string AppliesToAddress { get; set; }
+ public SecurityKeyIdentifierClause AttachedReference { get; set; }
+ public AuthenticationInformation AuthenticationInfo { get; set; }
+ public EncryptingCredentials EncryptingCredentials { get; set; }
+ public Lifetime Lifetime { get; set; }
+ public ProofDescriptor Proof { get; set; }
+ public Dictionary Properties { get { return properties; } }
+ public string ReplyToAddress { get; set; }
+ public SigningCredentials SigningCredentials { get; set; }
+ public ClaimsIdentity Subject { get; set; }
+ public SecurityToken Token { get; set; }
+ public string TokenIssuerName { get; set; }
+ public string TokenType { get; set; }
+ public SecurityKeyIdentifierClause UnattachedReference { get; set; }
+
+ [MonoTODO]
+ public void AddAuthenticationClaims (string authType) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void AddAuthenticationClaims (string authType, DateTime time) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void ApplyTo (RequestSecurityTokenResponse response) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandler.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandler.cs
new file mode 100644
index 0000000000..5dec724b94
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandler.cs
@@ -0,0 +1,123 @@
+//
+// SecurityTokenHandler.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Configuration;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class SecurityTokenHandler : ICustomIdentityConfiguration
+ {
+ public virtual bool CanValidateToken { get { return false; } }
+ public virtual bool CanWriteToken { get { return false; } }
+ public SecurityTokenHandlerConfiguration Configuration { get; set; }
+ public SecurityTokenHandlerCollection ContainingCollection { get; internal set; }
+ public abstract Type TokenType { get; }
+
+ public virtual bool CanReadKeyIdentifierClause (XmlReader reader) {
+ return false;
+ }
+
+ public virtual bool CanReadToken (string tokenString) {
+ return false;
+ }
+
+ public virtual bool CanReadToken (XmlReader reader) {
+ return false;
+ }
+
+ public virtual bool CanWriteKeyIdentifierClause (SecurityKeyIdentifierClause securityKeyIdentifierClause) {
+ return false;
+ }
+
+ public virtual SecurityKeyIdentifierClause CreateSecurityTokenReference (SecurityToken token, bool attached) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken CreateToken (SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ protected virtual void DetectReplayedToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public abstract string[] GetTokenTypeIdentifiers ();
+
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityKeyIdentifierClause ReadKeyIdentifierClause (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+
+ public virtual SecurityToken ReadToken (string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken ReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken ReadToken (XmlReader reader, SecurityTokenResolver tokenResolver) {
+ return this.ReadToken (reader);
+ }
+
+ protected void TraceTokenValidationFailure (SecurityToken token, string errorMessage) {
+ throw new NotImplementedException ();
+ }
+
+ protected void TraceTokenValidationSuccess (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual ReadOnlyCollection ValidateToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void WriteKeyIdentifierClause (XmlWriter writer, SecurityKeyIdentifierClause securityKeyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string WriteToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void WriteToken (XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerCollection.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerCollection.cs
new file mode 100644
index 0000000000..a3a3fcea8b
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerCollection.cs
@@ -0,0 +1,197 @@
+//
+// SecurityTokenHandlerCollection.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenHandlerCollection : Collection
+ {
+ private SecurityTokenHandlerConfiguration config;
+ private IEnumerable tokenTypeIdentifiers = new List ();
+ private IEnumerable tokenTypes = new List ();
+
+ public SecurityTokenHandlerConfiguration Configuration { get { return this.config; } }
+ public IEnumerable TokenTypeIdentifiers { get { return tokenTypeIdentifiers; } }
+ public IEnumerable TokenTypes { get { return tokenTypes; } }
+ public SecurityTokenHandler this[SecurityToken token] {
+ get {
+ if (token == null) { return null; }
+
+ return this[token.GetType ()];
+ }
+ }
+ [MonoTODO]
+ public SecurityTokenHandler this[string tokenTypeIdentifier] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public SecurityTokenHandler this[Type tokenType] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public SecurityTokenHandlerCollection ()
+ : this(new SecurityTokenHandlerConfiguration ())
+ { }
+
+ public SecurityTokenHandlerCollection (SecurityTokenHandlerConfiguration configuration) {
+ config = configuration;
+ }
+
+ public SecurityTokenHandlerCollection (IEnumerable handlers)
+ : this (handlers, new SecurityTokenHandlerConfiguration ())
+ { }
+
+ public SecurityTokenHandlerCollection (IEnumerable handlers, SecurityTokenHandlerConfiguration configuration) : this (configuration) {
+ foreach (var handler in handlers) {
+ Add (handler);
+ }
+ }
+
+ [MonoTODO]
+ public void AddOrReplace(SecurityTokenHandler handler) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadKeyIdentifierClause(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual bool CanReadKeyIdentifierClauseCore(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadToken(string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadToken(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanWriteToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void ClearItems() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection(SecurityTokenHandlerConfiguration configuration) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken CreateToken(SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void InsertItem(int index, SecurityTokenHandler item) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityKeyIdentifierClause ReadKeyIdentifierClause(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken ReadToken(string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken ReadToken(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void RemoveItem(int index) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void SetItem(int index, SecurityTokenHandler item) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public ReadOnlyCollection ValidateToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WriteKeyIdentifierClause(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual void WriteKeyIdentifierClauseCore(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public string WriteToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WriteToken(XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerConfiguration.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerConfiguration.cs
new file mode 100644
index 0000000000..00e967fe14
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SecurityTokenHandlerConfiguration.cs
@@ -0,0 +1,66 @@
+//
+// SecurityTokenHandlerConfiguration.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Configuration;
+using System.IdentityModel.Selectors;
+using System.Security.Cryptography.X509Certificates;
+using System.ServiceModel.Security;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenHandlerConfiguration
+ {
+ public static readonly X509CertificateValidationMode DefaultCertificateValidationMode;
+ public static readonly X509CertificateValidator DefaultCertificateValidator;
+ public static readonly bool DefaultDetectReplayedTokens;
+ public static readonly IssuerNameRegistry DefaultIssuerNameRegistry;
+ public static readonly SecurityTokenResolver DefaultIssuerTokenResolver;
+ public static readonly TimeSpan DefaultMaxClockSkew;
+ public static readonly X509RevocationMode DefaultRevocationMode;
+ public static readonly bool DefaultSaveBootstrapContext;
+ public static readonly TimeSpan DefaultTokenReplayCacheExpirationPeriod;
+ public static readonly StoreLocation DefaultTrustedStoreLocation;
+
+ public AudienceRestriction AudienceRestriction { get; set; }
+ public IdentityModelCaches Caches { get; set; }
+ public X509CertificateValidationMode CertificateValidationMode { get; set; }
+ public X509CertificateValidator CertificateValidator { get; set; }
+ public bool DetectReplayedTokens { get; set; }
+ public IssuerNameRegistry IssuerNameRegistry { get; set; }
+ public SecurityTokenResolver IssuerTokenResolver { get; set; }
+ public TimeSpan MaxClockSkew { get; set; }
+ public X509RevocationMode RevocationMode { get; set; }
+ public bool SaveBootstrapContext { get; set; }
+ public SecurityTokenResolver ServiceTokenResolver { get; set; }
+ public TimeSpan TokenReplayCacheExpirationPeriod { get; set; }
+ public StoreLocation TrustedStoreLocation { get; set; }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityToken.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityToken.cs
new file mode 100644
index 0000000000..de60b68b10
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityToken.cs
@@ -0,0 +1,109 @@
+//
+// SessionSecurityToken.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ [Serializable]
+ public class SessionSecurityToken : SecurityToken
+ {
+ private ReadOnlyCollection securityKeys;
+ private DateTime validFrom;
+ private DateTime validTo;
+
+ public ClaimsPrincipal ClaimsPrincipal { get; private set; }
+ public string Context { get; private set; }
+ public UniqueId ContextId { get; private set; }
+ public string EndpointId { get; private set; }
+ [MonoTODO]
+ public override string Id { get { throw new NotImplementedException (); } }
+ public bool IsPersistent { get; set; }
+ public bool IsReferenceMode { get; set; }
+ public DateTime KeyEffectiveTime { get; private set; }
+ public DateTime KeyExpirationTime { get; private set; }
+ public UniqueId KeyGeneration { get; private set; }
+ public Uri SecureConversationVersion { get; private set; }
+ public override ReadOnlyCollection SecurityKeys { get { return securityKeys; } }
+ public override DateTime ValidFrom { get { return validFrom; } }
+ public override DateTime ValidTo { get { return validTo; } }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal)
+ : this (claimsPrincipal, null)
+ { }
+
+ protected SessionSecurityToken (SerializationInfo info, StreamingContext context) {
+ throw new NotImplementedException ();
+ }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context)
+ : this (claimsPrincipal, context, DateTime.UtcNow, DateTime.UtcNow + SessionSecurityTokenHandler.DefaultTokenLifetime)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, TimeSpan lifetime)
+ : this (claimsPrincipal, null, DateTime.UtcNow, DateTime.UtcNow + lifetime)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context, DateTime? validFrom, DateTime? validTo)
+ : this (claimsPrincipal, new UniqueId (), context, String.Empty, validFrom, validTo, null)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context, string endpointId, DateTime? validFrom, DateTime? validTo)
+ : this(claimsPrincipal, new UniqueId (), context, endpointId, validFrom, validTo, null)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, TimeSpan lifetime, SymmetricSecurityKey key)
+ : this (claimsPrincipal, contextId, context, endpointId, DateTime.UtcNow, lifetime, key)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, DateTime validFrom, TimeSpan lifetime, SymmetricSecurityKey key)
+ : this (claimsPrincipal, contextId, context, endpointId, validFrom, validFrom + lifetime, key)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, DateTime? validFrom, DateTime? validTo, SymmetricSecurityKey key) {
+ ClaimsPrincipal = claimsPrincipal;
+ ContextId = contextId;
+ Context = context;
+ EndpointId = endpointId;
+ validFrom = (validFrom.HasValue) ? validFrom.Value.ToUniversalTime () : DateTime.UtcNow;
+ validTo = (validTo.HasValue) ? validTo.Value.ToUniversalTime () : ValidFrom + SessionSecurityTokenHandler.DefaultTokenLifetime;
+ securityKeys = new ReadOnlyCollection (new SecurityKey[] { new InMemorySymmetricSecurityKey ((key == null) ? null : key.GetSymmetricKey ()) });
+ }
+
+ [MonoTODO]
+ public virtual void GetObjectData (SerializationInfo info, StreamingContext context) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.jvm.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCache.cs
similarity index 52%
rename from mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.jvm.cs
rename to mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCache.cs
index 8e93ca8cfd..c3c8739bcd 100644
--- a/mcs/class/System.Drawing/System.Drawing.Text/InstalledFontCollection.jvm.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCache.cs
@@ -1,10 +1,10 @@
+//
+// SessionSecurityTokenCache.cs
//
-// System.Drawing.InstalledFontCollection.cs
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.com)
-//
-
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -24,34 +24,28 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using awt = java.awt;
-
-namespace System.Drawing.Text
-{
- ///
- /// Summary description for InstalledFontCollection.
- ///
- public sealed class InstalledFontCollection : FontCollection
- {
- static readonly Hashtable _installedFonts;
-
- static InstalledFontCollection()
- {
- _installedFonts = CollectionsUtil.CreateCaseInsensitiveHashtable( new Hashtable() );
- java.awt.Font [] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
- for (int i = 0; i < fonts.Length; i++) {
- string fontFamilyName = fonts[i].getFamily();
- if (!_installedFonts.ContainsKey( fontFamilyName ))
- _installedFonts.Add(fontFamilyName, fonts[i]);
- }
- }
-
- public InstalledFontCollection() : base( _installedFonts ) {
- }
- }
-}
+//
+#if NET_4_5
+
+using System;
+using System.Collections.Generic;
+using System.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class SessionSecurityTokenCache : ICustomIdentityConfiguration
+ {
+ public abstract void AddOrUpdate (SessionSecurityTokenCacheKey key, SessionSecurityToken value, DateTime expiryTime);
+ public abstract SessionSecurityToken Get (SessionSecurityTokenCacheKey key);
+ public abstract IEnumerable GetAll (string endpointId, UniqueId contextId);
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+ public abstract void Remove (SessionSecurityTokenCacheKey key);
+ public abstract void RemoveAll (string endpointId);
+ public abstract void RemoveAll (string endpointId, UniqueId contextId);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCacheKey.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCacheKey.cs
new file mode 100644
index 0000000000..943c75bcb9
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenCacheKey.cs
@@ -0,0 +1,74 @@
+//
+// SessionSecurityTokenCacheKey.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SessionSecurityTokenCacheKey
+ {
+ [MonoTODO]
+ public static bool operator !=(SessionSecurityTokenCacheKey first, SessionSecurityTokenCacheKey second) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool operator ==(SessionSecurityTokenCacheKey first, SessionSecurityTokenCacheKey second) {
+ throw new NotImplementedException ();
+ }
+
+ public UniqueId ContextId { get; private set; }
+ public string EndpointId { get; private set; }
+ public bool IgnoreKeyGeneration { get; set; }
+ public UniqueId KeyGeneration { get; private set; }
+
+ public SessionSecurityTokenCacheKey (string endpointId, UniqueId contextId, UniqueId keyGeneration) {
+ EndpointId = endpointId;
+ ContextId = contextId;
+ KeyGeneration = keyGeneration;
+ }
+
+ [MonoTODO]
+ public override bool Equals (System.Object obj) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override int GetHashCode () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override string ToString () {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenHandler.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenHandler.cs
new file mode 100644
index 0000000000..58f18fa2b7
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/SessionSecurityTokenHandler.cs
@@ -0,0 +1,148 @@
+//
+// SessionSecurityTokenHandler.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SessionSecurityTokenHandler : SecurityTokenHandler
+ {
+ public static readonly ReadOnlyCollection DefaultCookieTransforms;
+ public static readonly TimeSpan DefaultLifetime = TimeSpan.FromHours (10);
+
+ private bool canValidateToken;
+ private bool canWriteToken;
+ private string cookieElementName;
+ private string cookieNamespace;
+ private Type tokenType;
+
+ public override bool CanValidateToken { get { return canValidateToken; } }
+ public override bool CanWriteToken { get { return canWriteToken; } }
+ public virtual string CookieElementName { get { return cookieElementName; } }
+ public virtual string CookieNamespace { get { return cookieNamespace; } }
+ public static TimeSpan DefaultTokenLifetime { get { return SessionSecurityTokenHandler.DefaultLifetime; } }
+ public virtual TimeSpan TokenLifetime { get; set; }
+ public override Type TokenType { get { return tokenType; } }
+ public ReadOnlyCollection Transforms { get; private set; }
+
+ public SessionSecurityTokenHandler ()
+ : this (SessionSecurityTokenHandler.DefaultCookieTransforms)
+ { }
+
+ public SessionSecurityTokenHandler (ReadOnlyCollection transforms)
+ : this (transforms, SessionSecurityTokenHandler.DefaultLifetime)
+ { }
+
+ public SessionSecurityTokenHandler (ReadOnlyCollection transforms, TimeSpan tokenLifetime) {
+ Transforms = transforms;
+ TokenLifetime = tokenLifetime;
+ }
+
+ [MonoTODO]
+ protected virtual byte[] ApplyTransforms (byte[] cookie, bool outbound) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override bool CanReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual SessionSecurityToken CreateSessionSecurityToken (ClaimsPrincipal principal, string context, string endpointId, DateTime validFrom, DateTime validTo) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken CreateToken (SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override string[] GetTokenTypeIdentifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void LoadCustomConfiguration (XmlNodeList customConfigElements) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken ReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual SecurityToken ReadToken (byte[] token, SecurityTokenResolver tokenResolver) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected void SetTransforms (IEnumerable transforms) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual void ValidateSession (SessionSecurityToken securityToken) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override ReadOnlyCollection ValidateToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual ReadOnlyCollection ValidateToken (SessionSecurityToken token, string endpointId) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual byte[] WriteToken (SessionSecurityToken sessionToken) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void WriteToken (XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/TokenReplayCache.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/TokenReplayCache.cs
new file mode 100644
index 0000000000..9f6d435998
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/TokenReplayCache.cs
@@ -0,0 +1,52 @@
+//
+// TokenReplayCache.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class TokenReplayCache : ICustomIdentityConfiguration
+ {
+ public abstract void AddOrUpdate (string key, SecurityToken securityToken, DateTime expirationTime);
+
+ public abstract bool Contains (string key);
+
+ public abstract SecurityToken Get (string key);
+
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+
+ public abstract void Remove (string key);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs
index 4963c7a878..7221e34d1e 100644
--- a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs
@@ -84,24 +84,62 @@ namespace System.IdentityModel.Tokens
switch (algorithm) {
//case SignedXml.XmlDsigDSAUrl: // it is documented as supported, but it isn't in reality and it wouldn't be possible.
case SignedXml.XmlDsigRSASHA1Url:
- return new HMACSHA1 ();
+ return new SHA1Managed ();
case SecurityAlgorithms.RsaSha256Signature:
- return new HMACSHA256 ();
+ return new SHA256Managed ();
default:
throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
}
}
- [MonoTODO]
public override AsymmetricSignatureDeformatter GetSignatureDeformatter (string algorithm)
{
- throw new NotImplementedException ();
+ switch (algorithm) {
+ //case SignedXml.XmlDsigDSAUrl:
+ // DSA dsa = (cert.PublicKey.Key as DSA);
+ // if (dsa == null) {
+ // throw new NotSupportedException (String.Format ("The certificate does not contain DSA public key while '{0}' requires it.", algorithm));
+ // }
+ // else {
+ // return new DSASignatureDeformatter(dsa);
+ // }
+ case SignedXml.XmlDsigRSASHA1Url:
+ case SecurityAlgorithms.RsaSha256Signature:
+ RSA rsa = (cert.PublicKey.Key as RSA);
+ if (rsa == null) {
+ throw new NotSupportedException (String.Format ("The certificate does not contain RSA public key while '{0}' requires it.", algorithm));
+ }
+ else {
+ return new RSAPKCS1SignatureDeformatter (rsa);
+ }
+ default:
+ throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
+ }
}
- [MonoTODO]
public override AsymmetricSignatureFormatter GetSignatureFormatter (string algorithm)
{
- throw new NotImplementedException ();
+ switch (algorithm) {
+ //case SignedXml.XmlDsigDSAUrl:
+ // DSA dsa = (cert.PrivateKey as DSA);
+ // if (dsa == null) {
+ // throw new NotSupportedException (String.Format ("The certificate does not contain DSA private key while '{0}' requires it.", algorithm));
+ // }
+ // else {
+ // return new DSASignatureFormatter(dsa);
+ // }
+ case SignedXml.XmlDsigRSASHA1Url:
+ case SecurityAlgorithms.RsaSha256Signature:
+ RSA rsa = (cert.PrivateKey as RSA);
+ if (rsa == null) {
+ throw new NotSupportedException (String.Format ("The certificate does not contain RSA private key while '{0}' requires it.", algorithm));
+ }
+ else {
+ return new RSAPKCS1SignatureFormatter (rsa);
+ }
+ default:
+ throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
+ }
}
public override bool HasPrivateKey ()
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509SigningCredentials.cs b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509SigningCredentials.cs
new file mode 100644
index 0000000000..eeabc38551
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/X509SigningCredentials.cs
@@ -0,0 +1,62 @@
+//
+// X509SigningCredentials.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.IdentityModel.Tokens
+{
+ public class X509SigningCredentials : SigningCredentials
+ {
+ public X509Certificate2 Certificate { get; private set; }
+
+ public X509SigningCredentials (X509Certificate2 certificate)
+ : this (certificate, X509SigningCredentials.GetSecurityKeyIdentifier (certificate), SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, SecurityKeyIdentifier ski)
+ : this (certificate, ski, SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, string signatureAlgorithm, string digestAlgorithm)
+ : this (certificate, X509SigningCredentials.GetSecurityKeyIdentifier (certificate), signatureAlgorithm, digestAlgorithm)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, SecurityKeyIdentifier ski, string signatureAlgorithm, string digestAlgorithm)
+ : base (new X509SecurityToken (certificate).SecurityKeys[0], signatureAlgorithm, digestAlgorithm, ski)
+ {
+ Certificate = certificate;
+ }
+
+ private static SecurityKeyIdentifier GetSecurityKeyIdentifier (X509Certificate2 certificate) {
+ return new SecurityKeyIdentifier (new X509SecurityToken (certificate).CreateKeyIdentifierClause ());
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel.dll.sources b/mcs/class/System.IdentityModel/System.IdentityModel.dll.sources
index 5ee6bcd63f..32942efdb5 100755
--- a/mcs/class/System.IdentityModel/System.IdentityModel.dll.sources
+++ b/mcs/class/System.IdentityModel/System.IdentityModel.dll.sources
@@ -1,6 +1,8 @@
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
Assembly/AssemblyInfo.cs
+System.IdentityModel/CookieTransform.cs
+System.IdentityModel/OpenObject.cs
System.IdentityModel.Claims/Claim.cs
System.IdentityModel.Claims/ClaimSet.cs
System.IdentityModel.Claims/ClaimTypes.cs
@@ -8,10 +10,23 @@ System.IdentityModel.Claims/DefaultClaimSet.cs
System.IdentityModel.Claims/Rights.cs
System.IdentityModel.Claims/WindowsClaimSet.cs
System.IdentityModel.Claims/X509CertificateClaimSet.cs
+System.IdentityModel.Configuration/ICustomIdentityConfiguration.cs
+System.IdentityModel.Configuration/IdentityModelCaches.cs
System.IdentityModel.Policy/AuthorizationContext.cs
System.IdentityModel.Policy/EvaluationContext.cs
System.IdentityModel.Policy/IAuthorizationComponent.cs
System.IdentityModel.Policy/IAuthorizationPolicy.cs
+System.IdentityModel.Protocols/WSTrust/BinaryExchange.cs
+System.IdentityModel.Protocols/WSTrust/EndpointReference.cs
+System.IdentityModel.Protocols/WSTrust/Entropy.cs
+System.IdentityModel.Protocols/WSTrust/Lifetime.cs
+System.IdentityModel.Protocols/WSTrust/ProtectedKey.cs
+System.IdentityModel.Protocols/WSTrust/RequestSecurityTokenResponse.cs
+System.IdentityModel.Protocols/WSTrust/RequestedProofToken.cs
+System.IdentityModel.Protocols/WSTrust/RequestedSecurityToken.cs
+System.IdentityModel.Protocols/WSTrust/Status.cs
+System.IdentityModel.Protocols/WSTrust/UseKey.cs
+System.IdentityModel.Protocols/WSTrust/WSTrustMessage.cs
System.IdentityModel.Selectors/AudienceUriMode.cs
System.IdentityModel.Selectors/CustomUserNameSecurityTokenAuthenticator.cs
System.IdentityModel.Selectors/KerberosSecurityTokenAuthenticator.cs
@@ -35,13 +50,19 @@ System.IdentityModel.Selectors/X509CertificateValidator.cs
System.IdentityModel.Selectors/X509SecurityTokenAuthenticator.cs
System.IdentityModel.Selectors/X509SecurityTokenProvider.cs
System.IdentityModel.Tokens/AsymmetricSecurityKey.cs
+System.IdentityModel.Tokens/AudienceRestriction.cs
+System.IdentityModel.Tokens/AuthenticationContext.cs
+System.IdentityModel.Tokens/AuthenticationInformation.cs
System.IdentityModel.Tokens/BinaryKeyIdentifierClause.cs
System.IdentityModel.Tokens/EncryptedKeyIdentifierClause.cs
+System.IdentityModel.Tokens/EncryptingCredentials.cs
System.IdentityModel.Tokens/GenericXmlSecurityToken.cs
System.IdentityModel.Tokens/InMemorySymmetricSecurityKey.cs
+System.IdentityModel.Tokens/IssuerNameRegistry.cs
System.IdentityModel.Tokens/KerberosReceiverSecurityToken.cs
System.IdentityModel.Tokens/KerberosRequestorSecurityToken.cs
System.IdentityModel.Tokens/LocalIdKeyIdentifierClause.cs
+System.IdentityModel.Tokens/ProofDescriptor.cs
System.IdentityModel.Tokens/RsaKeyIdentifierClause.cs
System.IdentityModel.Tokens/RsaSecurityKey.cs
System.IdentityModel.Tokens/RsaSecurityToken.cs
@@ -76,19 +97,30 @@ System.IdentityModel.Tokens/SecurityKeyIdentifierClause.cs
System.IdentityModel.Tokens/SecurityKeyType.cs
System.IdentityModel.Tokens/SecurityKeyUsage.cs
System.IdentityModel.Tokens/SecurityToken.cs
+System.IdentityModel.Tokens/SecurityTokenDescriptor.cs
System.IdentityModel.Tokens/SecurityTokenException.cs
+System.IdentityModel.Tokens/SecurityTokenHandler.cs
+System.IdentityModel.Tokens/SecurityTokenHandlerCollection.cs
+System.IdentityModel.Tokens/SecurityTokenHandlerConfiguration.cs
System.IdentityModel.Tokens/SecurityTokenTypes.cs
System.IdentityModel.Tokens/SecurityTokenValidationException.cs
+System.IdentityModel.Tokens/SessionSecurityToken.cs
+System.IdentityModel.Tokens/SessionSecurityTokenCache.cs
+System.IdentityModel.Tokens/SessionSecurityTokenCacheKey.cs
+System.IdentityModel.Tokens/SessionSecurityTokenHandler.cs
System.IdentityModel.Tokens/SigningCredentials.cs
System.IdentityModel.Tokens/SymmetricSecurityKey.cs
System.IdentityModel.Tokens/TlsHMAC.cs
+System.IdentityModel.Tokens/TokenReplayCache.cs
System.IdentityModel.Tokens/UserNameSecurityToken.cs
System.IdentityModel.Tokens/WindowsSecurityToken.cs
System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs
System.IdentityModel.Tokens/X509IssuerSerialKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509RawDataKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509SecurityToken.cs
+System.IdentityModel.Tokens/X509SigningCredentials.cs
System.IdentityModel.Tokens/X509SubjectKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509ThumbprintKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509WindowsSecurityToken.cs
-System.Security.Claims/AuthenticationTypes.cs
\ No newline at end of file
+System.Security.Claims/AuthenticationTypes.cs
+System.ServiceModel.Security/X509CertificateValidationMode.cs
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel/CookieTransform.cs b/mcs/class/System.IdentityModel/System.IdentityModel/CookieTransform.cs
new file mode 100644
index 0000000000..2bd59e7f29
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel/CookieTransform.cs
@@ -0,0 +1,39 @@
+//
+// CookieTransform.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+
+namespace System.IdentityModel
+{
+ public abstract class CookieTransform
+ {
+ public abstract byte[] Encode (byte[] value);
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.IdentityModel/OpenObject.cs b/mcs/class/System.IdentityModel/System.IdentityModel/OpenObject.cs
new file mode 100644
index 0000000000..e6c00bf0b5
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.IdentityModel/OpenObject.cs
@@ -0,0 +1,42 @@
+//
+// OpenObject.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+using System;
+using System.Collections.Generic;
+
+namespace System.IdentityModel
+{
+ public abstract class OpenObject
+ {
+ private Dictionary properties = new Dictionary ();
+
+ public Dictionary Properties { get { return properties; } }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.IdentityModel/System.ServiceModel.Security/X509CertificateValidationMode.cs b/mcs/class/System.IdentityModel/System.ServiceModel.Security/X509CertificateValidationMode.cs
new file mode 100644
index 0000000000..832e2a43c1
--- /dev/null
+++ b/mcs/class/System.IdentityModel/System.ServiceModel.Security/X509CertificateValidationMode.cs
@@ -0,0 +1,41 @@
+//
+// X509CertificateValidationMode.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+
+namespace System.ServiceModel.Security
+{
+ public enum X509CertificateValidationMode
+ {
+ None,
+ PeerTrust,
+ ChainTrust,
+ PeerOrChainTrust,
+ Custom
+ }
+}
+#endif
diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
index 7f74497c60..865a8062b7 100644
--- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
+++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs
@@ -306,6 +306,8 @@ namespace System.Net.Http
item_headers.TryAddWithoutValidation (key, value);
}
+ requestMessage.RequestUri = wr.ResponseUri;
+
return response;
}
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs
index 800ab30251..b9c8a7796e 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs
@@ -56,7 +56,7 @@ namespace MonoTests.System.Net.Http.Headers
[Test]
/*
- * This fails on Windows with the .NET runtime:
+ * .NET BUG
*
* Test Case Failures:
* 1) MonoTests.System.Net.Http.Headers.ContentDispositionHeaderValueTest.Equals : System.NullReferenceException : Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
@@ -64,7 +64,7 @@ namespace MonoTests.System.Net.Http.Headers
* bei MonoTests.System.Net.Http.Headers.ContentDispositionHeaderValueTest.Equals()
*
*/
- [Category ("NotWorking")]
+ [Category ("NotDotNet")]
public void Equals ()
{
var value = new ContentDispositionHeaderValue ("x");
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
index d2871f6087..4b07313aaf 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
@@ -800,6 +800,30 @@ namespace MonoTests.System.Net.Http
}
}
+ [Test]
+ public void RequestUriAfterRedirect ()
+ {
+ var listener = CreateListener (l => {
+ var request = l.Request;
+ var response = l.Response;
+
+ response.StatusCode = (int)HttpStatusCode.Moved;
+ response.RedirectLocation = "http://xamarin.com/";
+ });
+
+ try {
+ var chandler = new HttpClientHandler ();
+ chandler.AllowAutoRedirect = true;
+ var client = new HttpClient (chandler);
+
+ var resp = client.GetAsync (LocalServer).Result;
+ Assert.AreEqual ("http://xamarin.com/", resp.RequestMessage.RequestUri.AbsoluteUri, "#1");
+ } finally {
+ listener.Abort ();
+ listener.Close ();
+ }
+ }
+
[Test]
/*
* Properties may only be modified before sending the first request.
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs
index c19e88ccba..be0c47c5cc 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http/StreamContentTest.cs
@@ -160,7 +160,7 @@ namespace MonoTests.System.Net.Http
* The .NET runtime hits the "#9" assertion.
* The test succeeds with Mono.
*/
- [Category ("NotWorking")]
+ [Category ("NotDotNet")]
public void CopyToAsync ()
{
var ms = new MemoryStream ();
diff --git a/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs
index bd93a4debb..fd9d08db64 100644
--- a/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Runtime.Remoting/Assembly/AssemblyInfo.cs
@@ -56,10 +56,8 @@ using System.Runtime.InteropServices;
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CLSCompliant (false)]
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs
deleted file mode 100644
index 9833d53e0a..0000000000
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory
-//
-// Authors:
-// Martin Willemoes Hansen (mwh@sysrq.dk)
-// Lluis Sanchez Gual (lluis@ximian.com)
-//
-// (C) 2003 Martin Willemoes Hansen
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Web;
-using System.IO;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-
-namespace System.Runtime.Remoting.Channels.Http
-{
- public class HttpRemotingHandlerFactory : IHttpHandlerFactory
- {
- public HttpRemotingHandlerFactory ()
- {
- }
-
- private static HttpRemotingHandlerFactoryData CurrentHttpRemotingHandlerFactoryData
- {
- get
- {
- HttpRemotingHandlerFactoryData res = (HttpRemotingHandlerFactoryData)AppDomain.CurrentDomain.GetData("HttpRemotingHandlerFactory");
- if (res == null)
- {
- res = new HttpRemotingHandlerFactoryData();
- AppDomain.CurrentDomain.SetData("HttpRemotingHandlerFactory", res);
- }
- return res;
- }
- }
-
- public IHttpHandler GetHandler (HttpContext context,
- string verb,
- string url,
- string filePath)
- {
- if (!CurrentHttpRemotingHandlerFactoryData.webConfigLoaded)
- ConfigureHttpChannel (context);
-
- return new HttpRemotingHandler (CurrentHttpRemotingHandlerFactoryData.transportSink);
- }
-
- void ConfigureHttpChannel (HttpContext context)
- {
- lock (GetType())
- {
- if (CurrentHttpRemotingHandlerFactoryData.webConfigLoaded) return;
-
- // Look for a channel that wants to receive http request
- IChannelReceiverHook chook = null;
- foreach (IChannel channel in ChannelServices.RegisteredChannels)
- {
- chook = channel as IChannelReceiverHook;
- if (chook == null) continue;
-
- if (chook.ChannelScheme != "http")
- throw new RemotingException ("Only http channels are allowed when hosting remoting objects in a web server");
-
- if (!chook.WantsToListen)
- {
- chook = null;
- continue;
- }
-
- //found chook
- break;
- }
-
- if (chook == null)
- {
- HttpChannel chan = new HttpChannel();
- ChannelServices.RegisterChannel(chan);
- chook = chan;
- }
-
- // Register the uri for the channel. The channel uri includes the scheme, the
- // host and the application path
-
- string channelUrl = context.Request.Url.GetLeftPart(UriPartial.Authority);
- channelUrl += context.Request.ApplicationPath;
- chook.AddHookChannelUri (channelUrl);
-
- CurrentHttpRemotingHandlerFactoryData.transportSink = new HttpServerTransportSink (chook.ChannelSinkChain, null);
-
- CurrentHttpRemotingHandlerFactoryData.webConfigLoaded = true;
- }
- }
-
- public void ReleaseHandler (IHttpHandler handler)
- {
- }
- }
-
- internal class HttpRemotingHandlerFactoryData
- {
-
- internal bool webConfigLoaded = false;
- internal HttpServerTransportSink transportSink = null;
-
- }
-}
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
index 0e7efffeed..f5a8ce2592 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpConnectionPool.cs
@@ -65,10 +65,8 @@ namespace System.Runtime.Remoting.Channels.Tcp
public static void Shutdown ()
{
-#if !TARGET_JVM
if (_poolThread != null)
_poolThread.Abort();
-#endif
}
public static int MaxOpenConnections
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs
index 9ca8bba321..cab5d34208 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels.Tcp/TcpServerChannel.cs
@@ -56,9 +56,6 @@ namespace System.Runtime.Remoting.Channels.Tcp
RemotingThreadPool threadPool;
-#if TARGET_JVM
- private volatile bool stopped = false;
-#endif
void Init (IServerChannelSinkProvider serverSinkProvider)
{
@@ -207,11 +204,7 @@ namespace System.Runtime.Remoting.Channels.Tcp
{
try
{
-#if !TARGET_JVM
while(true)
-#else
- while(!stopped)
-#endif
{
Socket socket = listener.AcceptSocket ();
ClientConnection reader = new ClientConnection (this, socket, sink);
@@ -236,9 +229,6 @@ namespace System.Runtime.Remoting.Channels.Tcp
public void StartListening (object data)
{
-#if TARGET_JVM
- stopped = false;
-#endif
listener = new TcpListener (bindAddress, port);
if (server_thread == null)
{
@@ -261,16 +251,9 @@ namespace System.Runtime.Remoting.Channels.Tcp
public void StopListening (object data)
{
-#if TARGET_JVM
- stopped = true;
-#endif
if (server_thread == null) return;
-#if !TARGET_JVM
server_thread.Abort ();
-#else
- server_thread.Interrupt ();
-#endif
listener.Stop ();
threadPool.Free ();
server_thread.Join ();
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
index 7da3a54c3c..400fabd8fa 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/BinaryCore.cs
@@ -98,13 +98,8 @@ namespace System.Runtime.Remoting.Channels
RemotingSurrogateSelector surrogateSelector = new RemotingSurrogateSelector ();
StreamingContext context = new StreamingContext (StreamingContextStates.Remoting, null);
-#if !TARGET_JVM
_serializationFormatter = new BinaryFormatter (surrogateSelector, context);
_deserializationFormatter = new BinaryFormatter (null, context);
-#else
- _serializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (surrogateSelector, context, false);
- _deserializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (null, context, false);
-#endif
_serializationFormatter.FilterLevel = _filterLevel;
_deserializationFormatter.FilterLevel = _filterLevel;
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
index aa99a65548..123cbaf860 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/RemotingThreadPool.cs
@@ -46,9 +46,6 @@ namespace System.Runtime.Remoting.Channels
AutoResetEvent threadDone = new AutoResetEvent (false);
ArrayList runningThreads = new ArrayList ();
-#if TARGET_JVM
- volatile
-#endif
bool stopped = false;
static object globalLock = new object ();
@@ -75,11 +72,7 @@ namespace System.Runtime.Remoting.Channels
threadDone.Set ();
workItems.Clear ();
foreach (Thread t in runningThreads)
-#if !TARGET_JVM
t.Abort ();
-#else
- t.Interrupt();
-#endif
runningThreads.Clear ();
}
if (this == sharedPool)
@@ -138,12 +131,7 @@ namespace System.Runtime.Remoting.Channels
void PoolThread ()
{
-#if !TARGET_JVM
while (true) {
-#else
- while (!stopped)
- {
-#endif
ThreadStart work = null;
do {
lock (workItems) {
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
index 85c71a1c02..055824f950 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapMessageFormatter.cs
@@ -74,34 +74,6 @@ namespace System.Runtime.Remoting.Channels {
if (sf != null) {
if(_serverFaultExceptionField != null)
e = (Exception) _serverFaultExceptionField.GetValue(sf);
-#if TARGET_JVM
- if (e == null && sf.ExceptionType != null)
- {
- try
- {
- Type te = Type.GetType(sf.ExceptionType);
- if (te != null)
- {
- ConstructorInfo ce = te.GetConstructor(
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance,
- null, new Type[] {typeof(string)}, null);
-
- if (ce != null)
- {
- e = (Exception) ce.Invoke(new object[] {sf.ExceptionMessage});
- }
- else
- {
- e = (Exception) Activator.CreateInstance(te);
- }
- }
- }
- catch
- {
- e = null;
- }
- }
-#endif
}
if (e == null)
e = new RemotingException (fault.FaultString);
@@ -431,12 +403,6 @@ namespace System.Runtime.Remoting.Channels {
object GetNullValue (Type paramType)
{
-#if TARGET_JVM
- if (paramType.IsEnum)
- {
- return Activator.CreateInstance(paramType);
- }
-#endif
switch (Type.GetTypeCode (paramType))
{
case TypeCode.Boolean: return false;
@@ -453,12 +419,6 @@ namespace System.Runtime.Remoting.Channels {
case TypeCode.UInt32: return (uint)0;
case TypeCode.UInt64: return (ulong)0;
default:
-#if TARGET_JVM
- if (paramType.IsValueType)
- {
- return Activator.CreateInstance(paramType);
- }
-#endif
return null;
}
}
diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.MetadataServices/MetaData.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.MetadataServices/MetaData.cs
index f8dcf058f6..703b97fd82 100644
--- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.MetadataServices/MetaData.cs
+++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.MetadataServices/MetaData.cs
@@ -35,10 +35,8 @@ using System.Text;
using System.Xml;
using System.Reflection;
using System.Net;
-#if !TARGET_JVM
using System.CodeDom.Compiler;
using Microsoft.CSharp;
-#endif
namespace System.Runtime.Remoting.MetadataServices
{
@@ -56,7 +54,6 @@ namespace System.Runtime.Remoting.MetadataServices
{
}
-#if !TARGET_JVM
[MonoTODO ("strong name")]
public static void ConvertCodeSourceFileToAssemblyFile (
string codePath,
@@ -133,7 +130,6 @@ namespace System.Runtime.Remoting.MetadataServices
memStream.Position = 0;
cg.GenerateCode (clientProxy, outputDirectory, memStream, outCodeStreamList, proxyUrl, proxyNamespace);
}
-#endif
public static void ConvertTypesToSchemaToFile (ServiceType [] types, SdlType sdlType, string path)
{
diff --git a/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.exclude.sources b/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.exclude.sources
deleted file mode 100644
index 347b530c15..0000000000
--- a/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.exclude.sources
+++ /dev/null
@@ -1,4 +0,0 @@
-System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.cs
-System.Runtime.Remoting.Channels.Ipc/*.cs
-System.Runtime.Remoting.Channels.Ipc.Unix/*.cs
-System.Runtime.Remoting.Channels.Ipc.Win32/*.cs
diff --git a/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.sources b/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.sources
deleted file mode 100644
index c30dad473c..0000000000
--- a/mcs/class/System.Runtime.Remoting/net_1_1_java_System.Runtime.Remoting.dll.sources
+++ /dev/null
@@ -1,3 +0,0 @@
-#include System.Runtime.Remoting.dll.sources
-
-System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs
index cf07f16e8c..645e25adde 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Assembly/AssemblyInfo.cs
@@ -53,11 +53,9 @@ using System.Runtime.InteropServices;
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComVisible (true)]
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
index d2a076e4b8..e55f763132 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
@@ -499,7 +499,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
object objReturn =
FormatterServices.GetUninitializedObject(type);
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
objMgr.RaiseOnDeserializingEvent (objReturn);
#endif
if(objReturn is ISerializable)
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
index 1bc703e216..ceb67d53c1 100644
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
+++ b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
@@ -84,7 +84,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
private FormatterAssemblyStyle _assemblyFormat = FormatterAssemblyStyle.Full;
private FormatterTypeStyle _typeFormat = FormatterTypeStyle.TypesWhenNeeded;
private static string defaultMessageNamespace;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
SerializationObjectManager _manager;
#endif
@@ -106,7 +106,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
_xmlWriter.Formatting = Formatting.Indented;
_surrogateSelector = selector;
_context = context;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
_manager = new SerializationObjectManager (_context);
#endif
}
@@ -207,7 +207,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
Thread.CurrentThread.CurrentCulture = savedCi;
}
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
_manager.RaiseOnSerializedEvent ();
#endif
}
@@ -373,7 +373,7 @@ namespace System.Runtime.Serialization.Formatters.Soap {
}
if(currentObject is ISerializable || surrogate != null) needsSerializationInfo = true;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
_manager.RegisterObject (currentObject);
#endif
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/net_1_1_java_System.Runtime.Serialization.Formatters.Soap.dll.sources b/mcs/class/System.Runtime.Serialization.Formatters.Soap/net_1_1_java_System.Runtime.Serialization.Formatters.Soap.dll.sources
deleted file mode 100644
index c1233ccf29..0000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/net_1_1_java_System.Runtime.Serialization.Formatters.Soap.dll.sources
+++ /dev/null
@@ -1 +0,0 @@
-#include System.Runtime.Serialization.Formatters.Soap.dll.sources
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/AllEnums.cs b/mcs/class/System.ServiceModel/System.ServiceModel/AllEnums.cs
index e4d1f452fe..777573fc1f 100644
--- a/mcs/class/System.ServiceModel/System.ServiceModel/AllEnums.cs
+++ b/mcs/class/System.ServiceModel/System.ServiceModel/AllEnums.cs
@@ -411,6 +411,8 @@ namespace System.ServiceModel.Security
Custom,
}
+#if !NET_4_5
+
public enum X509CertificateValidationMode
{
None,
@@ -419,6 +421,7 @@ namespace System.ServiceModel.Security
PeerOrChainTrust,
Custom,
}
+#endif
}
namespace System.ServiceModel.Security.Tokens
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs b/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
index 909e0bcb24..6d073e3d57 100644
--- a/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
+++ b/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs
@@ -449,21 +449,27 @@ namespace System.ServiceModel.MonoInternal
throw new InvalidOperationException ("another operation is in progress");
context = OperationContext.Current;
- return _processDelegate.BeginInvoke (method, operationName, parameters, callback, asyncState);
+ try {
+ return _processDelegate.BeginInvoke (method, operationName, parameters, callback, asyncState);
+ } catch {
+ context = null;
+ throw;
+ }
}
public object EndProcess (MethodBase method, string operationName, object [] parameters, IAsyncResult result)
{
-
- if (result == null)
- throw new ArgumentNullException ("result");
- if (parameters == null)
- throw new ArgumentNullException ("parameters");
- // FIXME: the method arguments should be verified to be
- // identical to the arguments in the corresponding begin method.
- object asyncResult = _processDelegate.EndInvoke (result);
- context = null;
- return asyncResult;
+ try {
+ if (result == null)
+ throw new ArgumentNullException ("result");
+ if (parameters == null)
+ throw new ArgumentNullException ("parameters");
+ // FIXME: the method arguments should be verified to be
+ // identical to the arguments in the corresponding begin method.
+ return _processDelegate.EndInvoke (result);
+ } finally {
+ context = null;
+ }
}
public object Process (MethodBase method, string operationName, object [] parameters)
diff --git a/mcs/class/System.Transactions/Assembly/AssemblyInfo.cs b/mcs/class/System.Transactions/Assembly/AssemblyInfo.cs
index 6f48fbc392..dc036a32be 100644
--- a/mcs/class/System.Transactions/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Transactions/Assembly/AssemblyInfo.cs
@@ -55,11 +55,9 @@ using System.Security.Permissions;
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: BestFitMapping (false)]
diff --git a/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs b/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs
index 9c9648c0f7..d996b78570 100644
--- a/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs
+++ b/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs
@@ -62,7 +62,6 @@ namespace System.Transactions
{
}
- [MonoTODO ("No TimeoutException is thrown")]
public TransactionScope (TransactionScopeOption option,
TimeSpan timeout)
{
@@ -92,6 +91,10 @@ namespace System.Transactions
completed = false;
isRoot = false;
nested = 0;
+
+ if (timeout < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("timeout");
+
this.timeout = timeout;
oldTransaction = Transaction.CurrentInternal;
diff --git a/mcs/class/System.Transactions/Test/TransactionScopeTest.cs b/mcs/class/System.Transactions/Test/TransactionScopeTest.cs
index 80925e27f5..1dbda6e1d2 100644
--- a/mcs/class/System.Transactions/Test/TransactionScopeTest.cs
+++ b/mcs/class/System.Transactions/Test/TransactionScopeTest.cs
@@ -18,6 +18,24 @@ namespace MonoTests.System.Transactions
public class TransactionScopeTest
{
+ [Test]
+ public void TransactionScopeWithInvalidTimeSpanThrows ()
+ {
+ try {
+ TransactionScope scope = new TransactionScope (TransactionScopeOption.Required, TimeSpan.FromSeconds (-1));
+ Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
+ } catch (ArgumentOutOfRangeException ex) {
+ Assert.AreEqual (ex.ParamName, "timeout");
+ }
+
+ try {
+ TransactionScope scope = new TransactionScope (null, TimeSpan.FromSeconds (-1));
+ Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
+ } catch (ArgumentOutOfRangeException ex) {
+ Assert.AreEqual (ex.ParamName, "timeout");
+ }
+ }
+
[Test]
public void TransactionScopeCommit ()
{
diff --git a/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs b/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs
index b412d40fef..ac4763edfb 100644
--- a/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Web.Extensions.Design/Assembly/AssemblyInfo.cs
@@ -57,7 +57,7 @@ using System.Security;
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
diff --git a/mcs/class/System.Web.Extensions/Assembly/AssemblyInfo.cs b/mcs/class/System.Web.Extensions/Assembly/AssemblyInfo.cs
index 53bce36c63..905c63c4e7 100644
--- a/mcs/class/System.Web.Extensions/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Web.Extensions/Assembly/AssemblyInfo.cs
@@ -59,7 +59,7 @@ using System.Security.Permissions;
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
diff --git a/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptResourceHandler.cs b/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptResourceHandler.cs
index 3ec1c00cc9..3961c95284 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptResourceHandler.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptResourceHandler.cs
@@ -211,18 +211,12 @@ namespace System.Web.Handlers
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);
}
catch (MissingManifestResourceException) {
-#if TARGET_JVM // GetResourceSet does not throw MissingManifestResourceException if ressource is not exists
- }
- if (rset == null) {
-#endif
if (scriptResourceName.EndsWith (".resources", RuntimeHelpers.StringComparison)) {
scriptResourceName = scriptResourceName.Substring (0, scriptResourceName.Length - 10);
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);
}
-#if !TARGET_JVM
else
throw;
-#endif
}
if (rset == null)
break;
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
index 70e6fc9beb..14a03b2f0d 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
@@ -203,6 +203,10 @@ namespace System.Web.Script.Serialization
return ConvertToType (DeserializeObjectInternal(input));
}
+ public object Deserialize (string input, Type targetType) {
+ return DeserializeObjectInternal (input);
+ }
+
static object Evaluate (object value) {
return Evaluate (value, false);
}
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs b/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
index 9836cca920..76e841fc5a 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs
@@ -55,9 +55,7 @@ namespace System.Web.Script.Services
if (url.EndsWith (AuthenticationService.DefaultWebServicePath, StringComparison.Ordinal))
handlerType = typeof(AuthenticationService);
else {
-#if !TARGET_JVM
handlerType = BuildManager.GetCompiledType (url);
-#endif
if (handlerType == null)
handlerType = WebServiceParser.GetCompiledType (url, context);
}
diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptBehaviorDescriptorTest.cs b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptBehaviorDescriptorTest.cs
index 69d065ec5f..f4a7861216 100644
--- a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptBehaviorDescriptorTest.cs
+++ b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptBehaviorDescriptorTest.cs
@@ -90,11 +90,7 @@ namespace Tests.System.Web.UI
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -105,11 +101,7 @@ namespace Tests.System.Web.UI
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -120,11 +112,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -135,11 +123,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -150,11 +134,7 @@ namespace Tests.System.Web.UI
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -165,11 +145,7 @@ namespace Tests.System.Web.UI
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptComponentDescriptorTest.cs b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptComponentDescriptorTest.cs
index cbf47d716e..0e4fb3abba 100644
--- a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptComponentDescriptorTest.cs
+++ b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptComponentDescriptorTest.cs
@@ -84,11 +84,7 @@ namespace Tests.System.Web.UI
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"});", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"});", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -99,11 +95,7 @@ namespace Tests.System.Web.UI
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -114,11 +106,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -129,11 +117,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -144,11 +128,7 @@ namespace Tests.System.Web.UI
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -159,11 +139,7 @@ namespace Tests.System.Web.UI
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null);", script);
-#endif
}
[Test]
diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptControlDescriptorTest.cs b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptControlDescriptorTest.cs
index 8df2646880..98c155b7e0 100644
--- a/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptControlDescriptorTest.cs
+++ b/mcs/class/System.Web.Extensions/Test/System.Web.UI/ScriptControlDescriptorTest.cs
@@ -80,11 +80,7 @@ namespace Tests.System.Web.UI
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -95,11 +91,7 @@ namespace Tests.System.Web.UI
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -110,11 +102,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -125,11 +113,7 @@ namespace Tests.System.Web.UI
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -140,11 +124,7 @@ namespace Tests.System.Web.UI
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
@@ -155,11 +135,7 @@ namespace Tests.System.Web.UI
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
diff --git a/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs b/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs
index b9b695d022..a405786406 100644
--- a/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Web.Services/Assembly/AssemblyInfo.cs
@@ -54,11 +54,9 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs b/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs
index e642a6202d..c4936a4bb3 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Configuration/WebServicesConfigurationSectionHandler.cs
@@ -50,19 +50,7 @@ namespace System.Web.Services.Configuration
class WSConfig
{
-#if !TARGET_JVM
volatile static WSConfig instance;
-#else
- static WSConfig instance {
- get {
- return (WSConfig)AppDomain.CurrentDomain.GetData("WSConfig.instance");
- }
- set {
- AppDomain.CurrentDomain.SetData("WSConfig.instance", value);
- }
- }
-
-#endif
WSProtocol protocols;
string wsdlHelpPage;
string filePath;
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs
index 0d321e7725..ede0ad15ec 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionCollection.cs
@@ -35,9 +35,7 @@ using System.Xml;
namespace System.Web.Services.Description {
public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {
-#if !TARGET_JVM //code generation is not supported
ServiceDescriptionImporter importer;
-#endif
#region Constructors
@@ -69,12 +67,10 @@ namespace System.Web.Services.Description {
#endregion // Properties
#region Methods
-#if !TARGET_JVM //code generation is not supported
internal void SetImporter (ServiceDescriptionImporter i)
{
importer = i;
}
-#endif
public int Add (ServiceDescription serviceDescription)
{
Insert (Count, serviceDescription);
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs
index 69e87d037a..9a1832792f 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs
@@ -2479,7 +2479,6 @@ namespace System.Web.Services.Description
}
}
- #if !TARGET_JVM
internal class XmlSerializerContract : System.Xml.Serialization.XmlSerializerImplementation
{
System.Collections.Hashtable readMethods = null;
@@ -2550,7 +2549,6 @@ namespace System.Web.Services.Description
}
}
- #endif
}
#endif
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/SoapTransportImporter.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/SoapTransportImporter.cs
index a73d6d235b..f13e0cf127 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Description/SoapTransportImporter.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Description/SoapTransportImporter.cs
@@ -35,18 +35,7 @@ namespace System.Web.Services.Description {
public abstract class SoapTransportImporter {
#region Fields
-#if !TARGET_JVM
static ArrayList transportImporters;
-#else
- static ArrayList transportImporters {
- get {
- return (ArrayList)AppDomain.CurrentDomain.GetData("SoapTransportImporter.transportImporters");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapTransportImporter.transportImporters", value);
- }
- }
-#endif
SoapProtocolImporter importContext;
#endregion // Fields
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
index 178161b1c9..66d88ee943 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs
@@ -100,10 +100,8 @@ namespace System.Web.Services.Protocols
string physPath = Path.Combine (path, help);
-#if !TARGET_JVM
if (!File.Exists (physPath))
throw new InvalidOperationException ("Documentation page '" + physPath + "' not found");
-#endif
_pageHandler = PageParser.GetCompiledPageInstance (vpath, physPath, context);
}
@@ -137,11 +135,7 @@ namespace System.Web.Services.Protocols
if (key == "wsdl") GenerateWsdlDocument (context, req.QueryString ["wsdl"]);
else if (key == "schema") GenerateSchema (context, req.QueryString ["schema"]);
-#if !TARGET_JVM //code generation is not supported
else if (key == "code") GenerateCode (context, req.QueryString ["code"]);
-#else
- else if (key == "code") throw new Exception("Code generation is not supported.");
-#endif
else if (key == "disco") GenerateDiscoDocument (context);
else throw new Exception ("This should never happen");
}
@@ -212,7 +206,6 @@ namespace System.Web.Services.Protocols
GetSchemas() [di].Write (xtw);
}
-#if !TARGET_JVM
void GenerateCode (HttpContext context, string langId)
{
context.Response.ContentType = "text/plain; charset=utf-8";
@@ -256,7 +249,6 @@ namespace System.Web.Services.Protocols
return provider;
}
-#endif
internal ServiceDescriptionCollection GetDescriptions ()
{
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtension.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtension.cs
index 854cc1a4dc..66359e7994 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtension.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapExtension.cs
@@ -62,18 +62,7 @@ namespace System.Web.Services.Protocols {
public abstract void ProcessMessage (SoapMessage message);
-#if !TARGET_JVM
static ArrayList[] globalExtensions;
-#else
- static ArrayList[] globalExtensions {
- get {
- return (ArrayList[])AppDomain.CurrentDomain.GetData("SoapExtension.globalExtensions");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapExtension.globalExtensions", value);
- }
- }
-#endif
internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs)
{
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
index 28d03f04f9..5ea34917e8 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
@@ -280,28 +280,7 @@ namespace System.Web.Services.Protocols {
//
internal class TypeStubManager
{
-#if !TARGET_JVM
static Hashtable type_to_manager;
-#else
- const string type_to_manager_key = "TypeStubManager.type_to_manager";
- static Hashtable type_to_manager {
- get {
- Hashtable hash = (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
-
- if (hash != null)
- return hash;
-
- lock(type_to_manager_key) {
- AppDomain.CurrentDomain.SetData(type_to_manager_key, new Hashtable());
- }
-
- return (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
- }
- set {
- //do nothing: we manage our type_to_manager per domain
- }
- }
-#endif
static TypeStubManager ()
{
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs
index a5c1253888..59bb8bfbd5 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebClientProtocol.cs
@@ -59,18 +59,7 @@ namespace System.Web.Services.Protocols {
//
WebRequest current_request;
-#if !TARGET_JVM
static HybridDictionary cache;
-#else
- static HybridDictionary cache {
- get {
- return (HybridDictionary)AppDomain.CurrentDomain.GetData("WebClientProtocol.cache");
- }
- set {
- AppDomain.CurrentDomain.SetData("WebClientProtocol.cache", value);
- }
- }
-#endif
#endregion
#region Constructors
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
index fd10eac857..37dc32ba65 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
@@ -106,7 +106,7 @@ namespace System.Web.Services.Protocols
#endif
Type type;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
type = BuildManager.GetCompiledType (url);
#else
type = WebServiceParser.GetCompiledType (fp, context);
diff --git a/mcs/class/System.Web/Assembly/AssemblyInfo.cs b/mcs/class/System.Web/Assembly/AssemblyInfo.cs
index 7baf1314ac..0b133b0419 100644
--- a/mcs/class/System.Web/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Web/Assembly/AssemblyInfo.cs
@@ -55,11 +55,7 @@ using System.Web.UI;
#if !NET_4_0
[assembly: AssemblyTrademark("")]
#endif
-#if TARGET_JVM
-[assembly: CLSCompliant(false)]
-#else
[assembly: CLSCompliant(true)]
-#endif
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("System.Web.dll")]
[assembly: AssemblyInformationalVersion("0.0.0.1")]
@@ -67,7 +63,7 @@ using System.Web.UI;
[assembly: AllowPartiallyTrustedCallers()]
[assembly: TagPrefix("System.Web.UI.WebControls", "asp")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/CompilationSection.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/CompilationSection.cs
index bd0fc291f3..ee74b4ea64 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/CompilationSection.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/CompilationSection.cs
@@ -67,11 +67,9 @@ namespace System.Web.Configuration
ConfigurationPropertyOptions.None);
assemblyPostProcessorTypeProp = new ConfigurationProperty ("assemblyPostProcessorType", typeof (string), "");
batchProp = new ConfigurationProperty ("batch", typeof (bool), true);
-#if !TARGET_JVM
buildProvidersProp = new ConfigurationProperty ("buildProviders", typeof (BuildProviderCollection), null,
null, PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
-#endif
batchTimeoutProp = new ConfigurationProperty ("batchTimeout", typeof (TimeSpan), new TimeSpan (0, 15, 0),
PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
PropertyHelper.PositiveTimeSpanValidator,
@@ -109,9 +107,7 @@ namespace System.Web.Configuration
properties.Add (assembliesProp);
properties.Add (assemblyPostProcessorTypeProp);
properties.Add (batchProp);
-#if !TARGET_JVM
properties.Add (buildProvidersProp);
-#endif
properties.Add (batchTimeoutProp);
properties.Add (codeSubDirectoriesProp);
properties.Add (compilersProp);
@@ -171,12 +167,10 @@ namespace System.Web.Configuration
set { base [batchTimeoutProp] = value; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("buildProviders")]
public BuildProviderCollection BuildProviders {
get { return (BuildProviderCollection) base [buildProvidersProp]; }
}
-#endif
[ConfigurationProperty ("codeSubDirectories")]
public CodeSubDirectoriesCollection CodeSubDirectories {
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebSectionGroup.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebSectionGroup.cs
index 959e2ce691..5d1ff36f88 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebSectionGroup.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebSectionGroup.cs
@@ -65,12 +65,10 @@ namespace System.Web.Configuration
get { return (ClientTargetSection)Sections ["clientTarget"]; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("compilation")]
public CompilationSection Compilation {
get { return (CompilationSection)Sections ["compilation"]; }
}
-#endif
[ConfigurationProperty ("customErrors")]
public CustomErrorsSection CustomErrors {
diff --git a/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs b/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
index be1814d62a..4efb0e0b92 100644
--- a/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
+++ b/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
@@ -314,16 +314,12 @@ namespace System.Web.Handlers
extra = QueryParamSeparator + "n=" + (notifyScriptLoaded ? "t" : "f");
#endif
-#if TARGET_JVM
- atime = QueryParamSeparator + "t=" + assemblyName.GetHashCode ();
-#else
if (includeTimeStamp) {
if (!String.IsNullOrEmpty (assemblyPath) && File.Exists (assemblyPath))
atime = QueryParamSeparator + "t=" + File.GetLastWriteTimeUtc (assemblyPath).Ticks;
else
atime = QueryParamSeparator + "t=" + DateTime.UtcNow.Ticks;
}
-#endif
string d = HttpUtility.UrlEncode (assemblyNameHash + "_" + resourceNameHash + (debug ? "_t" : "_f"));
string href = HandlerFileName + "?d=" + d + atime + extra;
HttpContext ctx = HttpContext.Current;
diff --git a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
index 7fc71250f0..539056db3e 100644
--- a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
+++ b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
@@ -126,9 +126,6 @@ namespace System.Web.Hosting {
//
// http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp
//
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static object CreateApplicationHost (Type hostType, string virtualDir, string physicalDir)
{
diff --git a/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs b/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs
index adbcf92aa5..ad72d9f44e 100644
--- a/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs
+++ b/mcs/class/System.Web/System.Web.Mail/SmtpClient.cs
@@ -68,11 +68,6 @@ namespace System.Web.Mail {
void ChangeToSSLSocket ()
{
-#if TARGET_JVM
- java.lang.Class c = vmw.common.TypeUtils.ToClass (smtp.Stream);
- java.lang.reflect.Method m = c.getMethod ("ChangeToSSLSocket", null);
- m.invoke (smtp.Stream, new object[]{});
-#else
// Load Mono.Security.dll
Assembly a;
try {
@@ -94,7 +89,6 @@ namespace System.Web.Mail {
if (objSslClientStream != null)
smtp = new SmtpStream ((Stream)objSslClientStream);
-#endif
}
void ReadFields (MailMessageWrapper msg)
diff --git a/mcs/class/System.Web/System.Web.Security/AnonymousIdentificationModule.cs b/mcs/class/System.Web/System.Web.Security/AnonymousIdentificationModule.cs
index b8e7bfa11a..55d223b705 100644
--- a/mcs/class/System.Web/System.Web.Security/AnonymousIdentificationModule.cs
+++ b/mcs/class/System.Web/System.Web.Security/AnonymousIdentificationModule.cs
@@ -114,26 +114,7 @@ namespace System.Web.Security {
}
}
-#if TARGET_JVM
- static AnonymousIdentificationSection Config
- {
- get
- {
- AnonymousIdentificationSection config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null) {
- lock (typeof (AnonymousIdentificationModule)) {
- config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null)
- config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
- AppDomain.CurrentDomain.SetData ("Anonymous.Config", config);
- }
- }
- return config;
- }
- }
-#else
static AnonymousIdentificationSection Config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
-#endif
}
}
#endif
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Content.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Content.cs
index a1b8f553a2..e57513c761 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Content.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Content.cs
@@ -35,9 +35,7 @@ namespace System.Web.UI.WebControls
{
[ToolboxItem (false)]
[DesignerAttribute ("System.Web.UI.Design.WebControls.ContentDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#if !TARGET_JVM
[ControlBuilder(typeof(ContentBuilderInternal))]
-#endif
public class Content: Control, INamingContainer, INonBindingContainer
{
[ThemeableAttribute (false)]
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
index 7f71951ba0..56bb47679f 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
@@ -504,12 +504,7 @@ namespace System.Web.UI.WebControls
public void ToggleExpandState ()
{
-#if TARGET_JVM //No support for Nullable.GetValueOrDefault() yet
- bool? value = Expanded;
- Expanded = value.HasValue ? !value.Value : true;
-#else
Expanded = !Expanded.GetValueOrDefault(false);
-#endif
}
void IStateManager.LoadViewState (object savedState)
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
index 4cc18bd3a3..45ce22e46e 100644
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
+++ b/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
@@ -133,10 +133,6 @@ namespace System.Web.UI {
protected virtual void AddAttribute (string name, string value, HtmlTextWriterAttribute key)
{
NextAttrStack ();
-#if TARGET_JVM
- if (attrs [attrs_pos] == null)
- attrs [attrs_pos] = new AddedAttr ();
-#endif
attrs [attrs_pos].name = name;
attrs [attrs_pos].value = value;
attrs [attrs_pos].key = key;
@@ -146,10 +142,6 @@ namespace System.Web.UI {
protected virtual void AddStyleAttribute (string name, string value, HtmlTextWriterStyle key)
{
NextStyleStack ();
-#if TARGET_JVM
- if (styles [styles_pos] == null)
- styles [styles_pos] = new AddedStyle ();
-#endif
styles [styles_pos].name = name;
value = HttpUtility.HtmlAttributeEncode (value);
styles [styles_pos].value = value;
@@ -765,10 +757,6 @@ namespace System.Web.UI {
return tagstack [tagstack_pos].key;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].key = value;
tagstack [tagstack_pos].name = GetTagName (value);
}
@@ -782,10 +770,6 @@ namespace System.Web.UI {
return tagstack [tagstack_pos].name;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].name = value;
tagstack [tagstack_pos].key = GetTagKey (value);
if (tagstack [tagstack_pos].key != HtmlTextWriterTag.Unknown)
@@ -828,33 +812,21 @@ namespace System.Web.UI {
int styles_pos = -1, attrs_pos = -1, tagstack_pos = -1;
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedTag {
public string name;
public HtmlTextWriterTag key;
public bool ignore;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedStyle {
public string name;
public HtmlTextWriterStyle key;
public string value;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedAttr {
public string name;
public HtmlTextWriterAttribute key;
diff --git a/mcs/class/System.Web/System.Web.UI/IScriptManager.cs b/mcs/class/System.Web/System.Web.UI/IScriptManager.cs
index 842c1ff880..de727f794a 100644
--- a/mcs/class/System.Web/System.Web.UI/IScriptManager.cs
+++ b/mcs/class/System.Web/System.Web.UI/IScriptManager.cs
@@ -34,7 +34,7 @@ using System.Text;
namespace System.Web.UI
{
-#if (TARGET_JVM || TARGET_DOTNET)
+#if (TARGET_DOTNET)
public
#endif
interface IScriptManager
diff --git a/mcs/class/System.Web/System.Web.UI/MasterPage.cs b/mcs/class/System.Web/System.Web.UI/MasterPage.cs
index d68be86780..2a08d70957 100644
--- a/mcs/class/System.Web/System.Web.UI/MasterPage.cs
+++ b/mcs/class/System.Web/System.Web.UI/MasterPage.cs
@@ -115,13 +115,7 @@ namespace System.Web.UI
var req = context.Request;
if (req != null)
masterPageFile = HostingEnvironment.VirtualPathProvider.CombineVirtualPaths (req.CurrentExecutionFilePath, masterPageFile);
-#if TARGET_JVM
- MasterPage masterPage = MasterPageParser.GetCompiledMasterInstance (masterPageFile,
- owner.Page.MapPath (masterPageFile),
- context);
-#else
MasterPage masterPage = BuildManager.CreateInstanceFromVirtualPath (masterPageFile, typeof (MasterPage)) as MasterPage;
-#endif
if (masterPage == null)
throw new HttpException ("Failed to create MasterPage instance for '" + masterPageFile + "'.");
diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs
index e6c79483a0..95919aba33 100644
--- a/mcs/class/System.Web/System.Web.UI/Page.cs
+++ b/mcs/class/System.Web/System.Web.UI/Page.cs
@@ -544,15 +544,11 @@ public partial class Page : TemplateControl, IHttpHandler
if (ps != null)
_styleSheetTheme = ps.StyleSheetTheme;
}
-#if TARGET_JVM
- if (_styleSheetTheme != null && _styleSheetTheme != "")
- _styleSheetPageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_styleSheetTheme, Context);
-#else
+
if (!String.IsNullOrEmpty (_styleSheetTheme)) {
string virtualPath = "~/App_Themes/" + _styleSheetTheme;
_styleSheetPageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
}
-#endif
}
void InitializeTheme ()
@@ -562,19 +558,13 @@ public partial class Page : TemplateControl, IHttpHandler
if (ps != null)
_theme = ps.Theme;
}
-#if TARGET_JVM
- if (_theme != null && _theme != "") {
- _pageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_theme, Context);
- _pageTheme.SetPage (this);
- }
-#else
+
if (!String.IsNullOrEmpty (_theme)) {
string virtualPath = "~/App_Themes/" + _theme;
_pageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
if (_pageTheme != null)
_pageTheme.SetPage (this);
}
-#endif
}
#if NET_4_0
public Control AutoPostBackControl {
@@ -1298,11 +1288,7 @@ public partial class Page : TemplateControl, IHttpHandler
OnError (EventArgs.Empty);
if (_context.HasError (e)) {
_context.ClearError (e);
-#if TARGET_JVM
- vmw.common.TypeUtils.Throw (e);
-#else
throw new HttpUnhandledException (null, e);
-#endif
}
}
@@ -2277,26 +2263,6 @@ public partial class Page : TemplateControl, IHttpHandler
}
if (asyncResults.Count > 0) {
-#if TARGET_JVM
- TimeSpan timeout = AsyncTimeout;
- long t1 = DateTime.Now.Ticks;
- bool signalled = true;
- for (int i = 0; i < asyncResults.Count; i++) {
- if (asyncResults [i].IsCompleted)
- continue;
-
- if (signalled)
- signalled = asyncResults [i].AsyncWaitHandle.WaitOne (timeout, false);
-
- if (signalled) {
- long t2 = DateTime.Now.Ticks;
- timeout = AsyncTimeout - TimeSpan.FromTicks (t2 - t1);
- if (timeout.Ticks <= 0)
- signalled = false;
- } else
- localParallelTasks [i].TimeoutHandler (asyncResults [i]);
- }
-#else
WaitHandle [] waitArray = new WaitHandle [asyncResults.Count];
int i = 0;
for (i = 0; i < asyncResults.Count; i++) {
@@ -2311,7 +2277,6 @@ public partial class Page : TemplateControl, IHttpHandler
}
}
}
-#endif
}
DateTime endWait = DateTime.Now;
TimeSpan elapsed = endWait - startExecution;
diff --git a/mcs/class/System.Web/System.Web/BaseParamsCollection.cs b/mcs/class/System.Web/System.Web/BaseParamsCollection.cs
index 6777340947..fa99694254 100644
--- a/mcs/class/System.Web/System.Web/BaseParamsCollection.cs
+++ b/mcs/class/System.Web/System.Web/BaseParamsCollection.cs
@@ -69,15 +69,11 @@ namespace System.Web
public override string Get (string name)
{
if (!_loaded) {
-#if TARGET_JVM
- return InternalGet (name);
-#else
string s = InternalGet (name);
if (s != null && s.Length > 0)
return s;
LoadInfo ();
-#endif
}
return base.Get (name);
diff --git a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
index 46ef73cda8..d44c0878a2 100644
--- a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
+++ b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
@@ -51,11 +51,7 @@ namespace System.Web
BrowserData parent;
string text;
string pattern;
-#if TARGET_JVM
- java.util.regex.Pattern regex;
-#else
Regex regex;
-#endif
ListDictionary data;
public BrowserData (string pattern)
@@ -153,17 +149,9 @@ namespace System.Web
lock (this_lock) {
if (regex == null)
-#if TARGET_JVM
- regex = java.util.regex.Pattern.compile (pattern);
-#else
regex = new Regex (pattern);
-#endif
}
-#if TARGET_JVM
- return regex.matcher ((java.lang.CharSequence) (object) expression).matches ();
-#else
return regex.Match (expression).Success;
-#endif
}
}
@@ -173,46 +161,9 @@ namespace System.Web
static Hashtable defaultCaps;
static readonly object lockobj = new object ();
-#if TARGET_JVM
- static bool loaded {
- get {
- return alldata != null;
- }
- set {
- if (alldata == null)
- alldata = new ArrayList ();
- }
- }
-
- const string alldataKey = "System.Web.CapabilitiesLoader.alldata";
- static ICollection alldata {
- get {
- return (ICollection) AppDomain.CurrentDomain.GetData (alldataKey);
- }
- set {
- AppDomain.CurrentDomain.SetData (alldataKey, value);
- }
- }
-
- const string userAgentsCacheKey = "System.Web.CapabilitiesLoader.userAgentsCache";
- static Hashtable userAgentsCache {
- get {
- lock (typeof (CapabilitiesLoader)) {
- Hashtable agentsCache = (Hashtable) AppDomain.CurrentDomain.GetData (userAgentsCacheKey);
- if (agentsCache == null) {
- agentsCache = Hashtable.Synchronized (new Hashtable (userAgentsCacheSize + 10));
- AppDomain.CurrentDomain.SetData (userAgentsCacheKey, agentsCache);
- }
-
- return agentsCache;
- }
- }
- }
-#else
static volatile bool loaded;
static ICollection alldata;
static Hashtable userAgentsCache = Hashtable.Synchronized(new Hashtable(userAgentsCacheSize+10));
-#endif
CapabilitiesLoader () {}
diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs
index 4797916762..efa4432011 100644
--- a/mcs/class/System.Web/System.Web/HttpApplication.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplication.cs
@@ -1277,10 +1277,6 @@ namespace System.Web
context.Handler = handler;
context.PushHandler (handler);
} catch (FileNotFoundException fnf){
-#if TARGET_JVM
- Console.WriteLine ("$$$$$$$$$$:Sys.Web Pipeline");
- Console.WriteLine (fnf.ToString ());
-#endif
if (context.Request.IsLocal)
ProcessError (HttpException.NewWithCode (404,
String.Format ("File not found {0}", fnf.FileName),
@@ -1510,9 +1506,7 @@ namespace System.Web
th.CurrentUICulture = new_app_culture;
}
-#if !TARGET_JVM
prev_user = Thread.CurrentPrincipal;
-#endif
}
void PostDone ()
@@ -1523,10 +1517,8 @@ namespace System.Web
}
Thread th = Thread.CurrentThread;
-#if !TARGET_JVM
if (Thread.CurrentPrincipal != prev_user)
Thread.CurrentPrincipal = prev_user;
-#endif
if (prev_appui_culture != null && prev_appui_culture != th.CurrentUICulture)
th.CurrentUICulture = prev_appui_culture;
if (prev_app_culture != null && prev_app_culture != th.CurrentCulture)
@@ -1672,11 +1664,7 @@ namespace System.Web
cultures [0] = Thread.CurrentThread.CurrentCulture;
cultures [1] = Thread.CurrentThread.CurrentUICulture;
-#if TARGET_JVM
- if (true)
-#else
if (Thread.CurrentThread.IsThreadPoolThread)
-#endif
Start (null);
else
ThreadPool.QueueUserWorkItem (x => {
@@ -1816,7 +1804,6 @@ namespace System.Web
if (type != null)
return type;
-#if !TARGET_JVM
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
foreach (Assembly ass in assemblies) {
type = ass.GetType (typeName, false);
@@ -1845,7 +1832,6 @@ namespace System.Web
if (type != null)
return type;
-#endif
if (throwOnMissing)
throw new TypeLoadException (String.Format ("Type '{0}' cannot be found", typeName), loadException);
diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs
index 7876e8e7a3..9b3a291640 100644
--- a/mcs/class/System.Web/System.Web/HttpContext.cs
+++ b/mcs/class/System.Web/System.Web/HttpContext.cs
@@ -85,15 +85,7 @@ namespace System.Web
[ThreadStatic]
static Dictionary resource_providers;
-#if TARGET_JVM
- const string app_global_res_key = "HttpContext.app_global_res_key";
- internal static Assembly AppGlobalResourcesAssembly {
- get { return (Assembly) AppDomain.CurrentDomain.GetData (app_global_res_key); }
- set { AppDomain.CurrentDomain.SetData (app_global_res_key, value); }
- }
-#else
internal static Assembly AppGlobalResourcesAssembly;
-#endif
ProfileBase profile = null;
LinkedList handlers;
@@ -178,7 +170,6 @@ namespace System.Web
// The "Current" property is set just after we have constructed it with
// the 'HttpContext (HttpWorkerRequest)' constructor.
//
-#if !TARGET_JVM // No remoting CallContext support in Grasshopper
public static HttpContext Current {
get {
return (HttpContext) CallContext.GetData ("c");
@@ -188,7 +179,6 @@ namespace System.Web
CallContext.SetData ("c", value);
}
}
-#endif
public Exception Error {
get {
@@ -228,11 +218,9 @@ namespace System.Web
return (cfg.Mode == CustomErrorMode.RemoteOnly) && !Request.IsLocal;
}
}
-#if !TARGET_JVM
public bool IsDebuggingEnabled {
get { return RuntimeHelpers.DebuggingEnabled; }
}
-#endif
public IDictionary Items {
get {
if (items == null)
diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs
index de51fc897a..a2dd750eff 100755
--- a/mcs/class/System.Web/System.Web/HttpRequest.cs
+++ b/mcs/class/System.Web/System.Web/HttpRequest.cs
@@ -289,11 +289,9 @@ namespace System.Web
}
}
-#if !TARGET_JVM
public WindowsIdentity LogonUserIdentity {
get { throw new NotImplementedException (); }
}
-#endif
string anonymous_id;
public string AnonymousID {
@@ -580,10 +578,8 @@ namespace System.Web
// GetSubStream returns a 'copy' of the InputStream with Position set to 0.
static Stream GetSubStream (Stream stream)
{
-#if !TARGET_JVM
if (stream is IntPtrStream)
return new IntPtrStream (stream);
-#endif
if (stream is MemoryStream) {
MemoryStream other = (MemoryStream) stream;
@@ -797,7 +793,6 @@ namespace System.Web
input_stream = new MemoryStream (ms.GetBuffer (), 0, (int) ms.Length, false, true);
}
-#if !TARGET_JVM
const int INPUT_BUFFER_SIZE = 32*1024;
TempFileStream GetTempStream ()
@@ -951,7 +946,6 @@ namespace System.Web
if (total < content_length)
throw HttpException.NewWithCode (411, "The request body is incomplete.", WebEventCodes.WebErrorOtherError);
}
-#endif
internal void ReleaseResources ()
{
@@ -1563,14 +1557,10 @@ namespace System.Web
if (!isAppVirtualPath && !virtualPath.StartsWith (appVirtualPath, RuntimeHelpers.StringComparison))
throw new InvalidOperationException (String.Format ("Failed to map path '{0}'", virtualPath));
-#if TARGET_JVM
- return worker_request.MapPath (virtualPath);
-#else
string path = worker_request.MapPath (virtualPath);
if (virtualPath [virtualPath.Length - 1] != '/' && path [path.Length - 1] == System.IO.Path.DirectorySeparatorChar)
path = path.TrimEnd (System.IO.Path.DirectorySeparatorChar);
return path;
-#endif
}
public void SaveAs (string filename, bool includeHeaders)
diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs
index 2491c9035d..65718e5cd9 100644
--- a/mcs/class/System.Web/System.Web/HttpResponse.cs
+++ b/mcs/class/System.Web/System.Web/HttpResponse.cs
@@ -1157,11 +1157,6 @@ namespace System.Web
Flush ();
}
-#if TARGET_JVM
- public void WriteFile (IntPtr fileHandle, long offset, long size) {
- throw new PlatformNotSupportedException("IntPtr not supported");
- }
-#else
public void WriteFile (IntPtr fileHandle, long offset, long size)
{
if (offset < 0)
@@ -1182,7 +1177,6 @@ namespace System.Web
output_stream.ApplyFilter (false);
Flush ();
}
-#endif
public void WriteFile (string filename, long offset, long size)
{
diff --git a/mcs/class/System.Web/System.Web/HttpResponseStream.cs b/mcs/class/System.Web/System.Web/HttpResponseStream.cs
index a7ec533a0e..b180d341b5 100644
--- a/mcs/class/System.Web/System.Web/HttpResponseStream.cs
+++ b/mcs/class/System.Web/System.Web/HttpResponseStream.cs
@@ -75,75 +75,6 @@ namespace System.Web
filter = value;
}
}
-#if TARGET_JVM
-
- class BlockManager {
- const int PreferredLength = 16 * 1024;
- static readonly byte[] EmptyBuffer = new byte[0];
-
- byte[] buffer = EmptyBuffer;
- int position;
-
- public BlockManager () {
- }
-
- public int Position {
- get { return position; }
- }
-
- void EnsureCapacity (int capacity) {
- if (buffer.Length >= capacity)
- return;
-
- capacity += PreferredLength;
- capacity = (capacity / PreferredLength) * PreferredLength;
- byte[] temp = new byte[capacity];
- Array.Copy(buffer, 0, temp, 0, buffer.Length);
- buffer = temp;
- }
-
- public void Write (byte [] buffer, int offset, int count) {
- if (count == 0)
- return;
-
- EnsureCapacity (position + count);
- Array.Copy(buffer, offset, this.buffer, position, count);
- position += count;
- }
-
- public void Send (HttpWorkerRequest wr, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- if (start > 0) {
- byte[] temp = new byte[length];
- Array.Copy(buffer, start, temp, 0, length);
- buffer = temp;
- }
- wr.SendResponseFromMemory(buffer, length);
- }
-
- public void Send (Stream stream, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- stream.Write(buffer, start, length);
- }
-
- public void Dispose () {
- buffer = null;
- }
- }
-
-#else // TARGET_JVM
unsafe sealed class BlockManager {
const int PreferredLength = 128 * 1024;
byte *data;
@@ -234,7 +165,6 @@ namespace System.Web
}
}
-#endif
abstract class Bucket {
public Bucket Next;
@@ -247,9 +177,7 @@ namespace System.Web
public abstract int Length { get; }
}
-#if !TARGET_JVM
unsafe
-#endif
class ByteBucket : Bucket {
int start;
int length;
@@ -559,24 +487,12 @@ namespace System.Web
}
}
-#if TARGET_JVM
- void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
- {
- if (count <= 0)
- return;
-
- byte[] copy = new byte[count];
- Array.Copy(buffer, offset, copy, 0, count);
- wr.SendResponseFromMemory (copy, count);
- }
-#else
unsafe void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
{
fixed (byte *ptr = buffer) {
wr.SendResponseFromMemory ((IntPtr) (ptr + offset), count);
}
}
-#endif
void AppendBuffer (byte [] buffer, int offset, int count)
{
if (!(cur_bucket is ByteBucket))
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
index 2f234ef4ed..709c57dc08 100644
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs
@@ -601,13 +601,6 @@ namespace System.Web
}
#endif
-#if TARGET_JVM
- [MonoNotSupported ("UnloadAppDomain is not supported")]
- public static void UnloadAppDomain ()
- {
- throw new NotImplementedException ("UnloadAppDomain is not supported");
- }
-#else
//
// Called when we are shutting down or we need to reload an application
// that has been modified (touch global.asax)
@@ -628,7 +621,6 @@ namespace System.Web
}
});
}
-#endif
//
// Shuts down the AppDomain
//
diff --git a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs b/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
index 95980123ae..0c91350483 100755
--- a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
+++ b/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
@@ -317,7 +317,6 @@ namespace System.Web
// apparently does nothing in MS.NET
}
-#if !TARGET_JVM
public virtual void SendResponseFromMemory (IntPtr data, int length)
{
if (data != IntPtr.Zero) {
@@ -326,7 +325,6 @@ namespace System.Web
SendResponseFromMemory (copy, length);
}
}
-#endif
public virtual void SetEndOfSendNotification (HttpWorkerRequest.EndOfSendNotification callback, object extraData)
{
diff --git a/mcs/class/System.Web/System.Web/HttpWriter.cs b/mcs/class/System.Web/System.Web/HttpWriter.cs
index b33e6707e9..de5d13ab1b 100644
--- a/mcs/class/System.Web/System.Web/HttpWriter.cs
+++ b/mcs/class/System.Web/System.Web/HttpWriter.cs
@@ -143,14 +143,10 @@ namespace System.Web
{
if (buffer == null || index < 0 || count < 0 || (buffer.Length - index) < count)
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (buffer, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (buffer, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
@@ -171,14 +167,10 @@ namespace System.Web
if (index < 0 || count < 0 || ((index + count > s.Length)))
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (s, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (s, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
diff --git a/mcs/class/System.Web/System.Web/SiteMap.cs b/mcs/class/System.Web/System.Web/SiteMap.cs
index 245ff6b2f8..e64d6c21c7 100644
--- a/mcs/class/System.Web/System.Web/SiteMap.cs
+++ b/mcs/class/System.Web/System.Web/SiteMap.cs
@@ -93,23 +93,8 @@ namespace System.Web
}
}
-#if TARGET_JVM
- const string SiteMap_provider = "SiteMap_provider";
- const string SiteMap_providers = "SiteMap_providers";
- static SiteMapProvider provider
- {
- get { return (SiteMapProvider) AppDomain.CurrentDomain.GetData (SiteMap_provider); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_provider, value); }
- }
- static SiteMapProviderCollection providers
- {
- get { return (SiteMapProviderCollection) AppDomain.CurrentDomain.GetData (SiteMap_providers); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_providers, value); }
- }
-#else
static SiteMapProvider provider;
static SiteMapProviderCollection providers;
-#endif
static object locker = new object ();
}
}
diff --git a/mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs b/mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs
index 12ffbce0e5..84a92091ce 100644
--- a/mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs
+++ b/mcs/class/System.Web/System.Web/SiteMapNodeCollection.cs
@@ -41,16 +41,7 @@ namespace System.Web
public class SiteMapNodeCollection : IList, IHierarchicalEnumerable
{
ArrayList list;
-#if TARGET_JVM
- const string _siteMapNodeCollection_EmptyList = "SiteMapNodeCollection.EmptyList";
- internal static SiteMapNodeCollection EmptyList
- {
- get { return (SiteMapNodeCollection) AppDomain.CurrentDomain.GetData (_siteMapNodeCollection_EmptyList); }
- set { AppDomain.CurrentDomain.SetData (_siteMapNodeCollection_EmptyList, value); }
- }
-#else
internal static SiteMapNodeCollection EmptyList;
-#endif
static SiteMapNodeCollection ()
{
diff --git a/mcs/class/System.Web/System.Web/StaticFileHandler.cs b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
index 76b6e1087c..810f24c564 100644
--- a/mcs/class/System.Web/System.Web/StaticFileHandler.cs
+++ b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
@@ -86,24 +86,7 @@ namespace System.Web
if (strHeader != null) {
DateTime dtIfModifiedSince = DateTime.ParseExact (strHeader, "r", null);
DateTime ftime;
-#if TARGET_JVM
- try
- {
- ftime = fi.LastWriteTime.ToUniversalTime ();
- }
- catch (NotSupportedException)
- {
- // The file is in a WAR, it might be modified with last redeploy.
- try {
- ftime = (DateTime) AppDomain.CurrentDomain.GetData (".appStartTime");
- }
- catch {
- ftime = DateTime.MaxValue;
- }
- }
-#else
ftime = fi.LastWriteTime.ToUniversalTime ();
-#endif
if (ftime <= dtIfModifiedSince) {
response.ContentType = MimeTypes.GetMimeType (fileName);
response.StatusCode = 304;
diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
index 9d2f2f7741..9adcf76587 100644
--- a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
@@ -88,9 +88,7 @@ namespace MonoTests.System.Web.Compilation {
[Test]
[NUnit.Framework.Category ("NunitWeb")]
-#if !TARGET_JVM
[NUnit.Framework.Category ("NotWorking")]
-#endif
public void ReadOnlyPropertyBindTest ()
{
new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
diff --git a/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs b/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs
index d2b3a8f863..b7f4d5138d 100644
--- a/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.Hosting/ApplicationHostTest.cs
@@ -115,9 +115,6 @@ namespace MonoTests.System.Web.Hosting {
[Test]
[ExpectedException(typeof(SerializationException))]
-#if TARGET_JVM //System.Security.Policy.Evidence not implemented
- [Category ("NotWorking")]
-#endif
public void Constructor_PlainType ()
{
ApplicationHost.CreateApplicationHost (typeof (ApplicationHostTest), "/app", Environment.CurrentDirectory);
diff --git a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs
index 9b9293fec9..1e39670953 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs
@@ -55,7 +55,7 @@ namespace MonoTests.System.Web.UI.HtmlControls {
}
}
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public void SetContext ()
{
SetContext (Context);
@@ -201,7 +201,7 @@ namespace MonoTests.System.Web.UI.HtmlControls {
}
#if NET_2_0
-#if !TARGET_DOTNET && !TARGET_JVM
+#if !TARGET_DOTNET
[Test]
public void ActionStringWithQuery ()
{
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CreateUserWizardTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CreateUserWizardTest.cs
index 728dbe5954..ff79537899 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CreateUserWizardTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CreateUserWizardTest.cs
@@ -144,9 +144,6 @@ namespace MonoTests.System.Web.UI.WebControls
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #7024")]
-#endif
public void ActiveStepIndex () {
new WebTest (PageInvoker.CreateOnLoad (ActiveStepIndex_Load)).Run ();
}
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlTest.cs
index b401838112..67cf6946ee 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataBoundControlTest.cs
@@ -205,9 +205,6 @@ namespace MonoTests.System.Web.UI.WebControls
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #6665")]
-#endif
public void DataBoundControl_DataBindFlow2 () {
new WebTest (PageInvoker.CreateOnLoad (DataBoundControl_DataBindFlow2_Load)).Run ();
}
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id
index 3157a2f708..65036be5c5 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id
@@ -1 +1 @@
-d1a26186f43fcc001526389f14658fb0eedf225e
\ No newline at end of file
+416a8b9a1d1948a44af1452c03bff06ca838852b
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
index eff56d1123..f79222deb0 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
@@ -135,9 +135,7 @@ namespace MonoTests.System.Web.UI.WebControls
[Test]
[Category("NunitWeb")]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void SessionParameter_Evaluate()
{
SessionParameterPoker sessionParam = new SessionParameterPoker("employee",TypeCode.String ,"id") ;
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableRowTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableRowTest.cs
index 64eeca09aa..bad00c9654 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableRowTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableRowTest.cs
@@ -38,9 +38,6 @@ using NUnit.Framework;
namespace MonoTests.System.Web.UI.WebControls {
-#if TARGET_JVM
- [vmw.common.ChangeInterfaceMethodNames]
-#endif
public interface ITableRowTest {
// testing
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs
index 11dc1a62be..3a9400f64b 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs
@@ -409,9 +409,6 @@ namespace MonoTests.System.Web.UI.WebControls
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Category ("NotWorking")] // File watcher is not supported
-#endif
public void Save ()
{
string origin = @"
diff --git a/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
index ddf3812bfa..f08db8bc34 100644
--- a/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
@@ -816,11 +816,7 @@ namespace MonoTests.System.Web.UI
public static void ResolveUrl_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control ctrl = new Control ();
p.Controls.Add (ctrl);
Assert.AreEqual (appPath + "/MyPage.aspx", ctrl.ResolveUrl ("~/MyPage.aspx"), "ResolveClientUrl Failed");
@@ -866,11 +862,7 @@ namespace MonoTests.System.Web.UI
public static void ResolveUrl2_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control uc = p.FindControl ("WebUserControl1");
Control ctrl = uc.FindControl ("Label");
diff --git a/mcs/class/System.Web/Test/System.Web.UI/PageTest.cs b/mcs/class/System.Web/Test/System.Web.UI/PageTest.cs
index a09c17f6cd..59a23595bc 100644
--- a/mcs/class/System.Web/Test/System.Web.UI/PageTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI/PageTest.cs
@@ -784,9 +784,7 @@ namespace MonoTests.System.Web.UI {
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
public void AddOnPreRenderCompleteAsync ()
{
WebTest t = new WebTest ("AsyncPage.aspx");
@@ -801,9 +799,7 @@ namespace MonoTests.System.Web.UI {
}
[Test]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[Category ("NunitWeb")]
public void ExecuteRegisteredAsyncTasks ()
{
@@ -820,9 +816,7 @@ namespace MonoTests.System.Web.UI {
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncBeginThrows ()
{
@@ -833,9 +827,7 @@ namespace MonoTests.System.Web.UI {
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncEndThrows ()
{
diff --git a/mcs/class/System.Web/Test/System.Web.UI/TemplateControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI/TemplateControlTest.cs
index 2fc169593f..0c7f0fa196 100644
--- a/mcs/class/System.Web/Test/System.Web.UI/TemplateControlTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI/TemplateControlTest.cs
@@ -115,14 +115,6 @@ namespace MonoTests.System.Web.UI.WebControls
Assert.AreEqual (true, t.DoSupportAutoEvents, "SupportAutoEvents");
}
-#if TARGET_JVM
- [Test]
- public void TemplateControl_DefaultPropertyNotWorking ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- Assert.AreEqual (null, t.AppRelativeVirtualPath, "AppRelativeVirtualPath");
- }
-#endif
[Test]
[Category ("NunitWeb")]
@@ -343,23 +335,6 @@ namespace MonoTests.System.Web.UI.WebControls
}
-#if TARGET_JVM
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TemplateControl_AppRelativeVirtualPathException1 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = null;
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentException))]
- public void TemplateControl_AppRelativeVirtualPathException2 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = "fake";
- }
-#endif
[TestFixtureTearDown]
public void TearDown ()
{
@@ -367,4 +342,4 @@ namespace MonoTests.System.Web.UI.WebControls
}
}
}
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs
index 839b260e71..bb4c3c779a 100644
--- a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs
+++ b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs
@@ -263,9 +263,6 @@ namespace MonoTests.System.Web {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void Test_Response ()
{
FakeHttpWorkerRequest2 f;
@@ -287,9 +284,6 @@ namespace MonoTests.System.Web {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void TestResponse_Chunked ()
{
FakeHttpWorkerRequest2 f;
diff --git a/mcs/class/System.Web/Test/System.Web/HttpServerUtilityTest.cs b/mcs/class/System.Web/Test/System.Web/HttpServerUtilityTest.cs
index a6a4801125..47bfa8e1ce 100644
--- a/mcs/class/System.Web/Test/System.Web/HttpServerUtilityTest.cs
+++ b/mcs/class/System.Web/Test/System.Web/HttpServerUtilityTest.cs
@@ -65,9 +65,6 @@ namespace MonoTests.System.Web {
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike