![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
From: "Dan Schullman" <newsuser (AT) westerville (DOT) ohmy Subject: limit on number of exceptions in 'throws' clause?!!! Date: Thu, 27 May 2004 00:19:46 -0400 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: <uguYaH6QEHA.3988 (AT) tk2msftngp13 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: 209-150-43-227.c3-0.frm-ubr1.sbo-frm.ma.cable.rcn.com 209.150.43.227 Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13 |
|
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6089 X-Tomcat-NG: microsoft.public.dotnet.vjsharp I've just spent eight hours tracking down what appears to be a limit on the number of exceptions in a 'throws' clause when the offending method is in a .NET library. GRRR!!!! I was getting an error like: ThrowLimit1.jsl(11,6): error VJS1161: Cannot find class '' At a minimum, a much better error message would have helped immensely! Further, the error wasn't reported for the offending method but rather for the method that referenced it. And is this restriction documented anywhere? --Dan S. -------------------- ThrowLimit1.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class ThrowLimit1 { public static void main(String[] args) { try { new ThrowLimit2().nine(); new ThrowLimit2().ten(); } catch ( System.Exception e ) { System.out.println( "EXCEPTION: " + e ); } } } -------------------- ThrowLimit2.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class Ex01 extends System.Exception {public Ex01(String x){super(x);}} public class Ex02 extends System.Exception {public Ex02(String x){super(x);}} public class Ex03 extends System.Exception {public Ex03(String x){super(x);}} public class Ex04 extends System.Exception {public Ex04(String x){super(x);}} public class Ex05 extends System.Exception {public Ex05(String x){super(x);}} public class Ex06 extends System.Exception {public Ex06(String x){super(x);}} public class Ex07 extends System.Exception {public Ex07(String x){super(x);}} public class Ex08 extends System.Exception {public Ex08(String x){super(x);}} public class Ex09 extends System.Exception {public Ex09(String x){super(x);}} public class Ex10 extends System.Exception {public Ex10(String x){super(x);}} public class ThrowLimit2 { public void nine() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09 {} public void ten() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09, Ex10 {} } -------------------- compile the above with -------------------- $ vjc /t:library ThrowLimit2.jsl $ vjc ThrowLimit1.jsl /r:ThrowLimit2.dll |
#3
| |||
| |||
|
|
Hi, This is not a valid restriction and is a bug in the compiler when we are reading in the metadata. We will look at fixing it in the next release. The error scenario happens when 1) The 'throws' clause has more than 9 exceptions 2) The error causing method is compiled into a dll and then referred. If you can compile both the sources together, it will work. However, I understand that this is not possible if the method were in a third party library. Can I also please try to understand the scenario where you require more than 10 exceptions in the 'throws' clause in a referenced dll? Thanks for your feedback. Sadagopan Rajaram Microsoft Visual J# .NET Product Team. This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm -------------------- From: "Dan Schullman" <newsuser (AT) westerville (DOT) ohmy Subject: limit on number of exceptions in 'throws' clause?!!! Date: Thu, 27 May 2004 00:19:46 -0400 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: <uguYaH6QEHA.3988 (AT) tk2msftngp13 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: 209-150-43-227.c3-0.frm-ubr1.sbo-frm.ma.cable.rcn.com 209.150.43.227 Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13 phx.gbl Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6089 X-Tomcat-NG: microsoft.public.dotnet.vjsharp I've just spent eight hours tracking down what appears to be a limit on the number of exceptions in a 'throws' clause when the offending method is in a .NET library. GRRR!!!! I was getting an error like: ThrowLimit1.jsl(11,6): error VJS1161: Cannot find class '' At a minimum, a much better error message would have helped immensely! Further, the error wasn't reported for the offending method but rather for the method that referenced it. And is this restriction documented anywhere? --Dan S. -------------------- ThrowLimit1.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class ThrowLimit1 { public static void main(String[] args) { try { new ThrowLimit2().nine(); new ThrowLimit2().ten(); } catch ( System.Exception e ) { System.out.println( "EXCEPTION: " + e ); } } } -------------------- ThrowLimit2.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class Ex01 extends System.Exception {public Ex01(String x){super(x);}} public class Ex02 extends System.Exception {public Ex02(String x){super(x);}} public class Ex03 extends System.Exception {public Ex03(String x){super(x);}} public class Ex04 extends System.Exception {public Ex04(String x){super(x);}} public class Ex05 extends System.Exception {public Ex05(String x){super(x);}} public class Ex06 extends System.Exception {public Ex06(String x){super(x);}} public class Ex07 extends System.Exception {public Ex07(String x){super(x);}} public class Ex08 extends System.Exception {public Ex08(String x){super(x);}} public class Ex09 extends System.Exception {public Ex09(String x){super(x);}} public class Ex10 extends System.Exception {public Ex10(String x){super(x);}} public class ThrowLimit2 { public void nine() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09 {} public void ten() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09, Ex10 {} } -------------------- compile the above with -------------------- $ vjc /t:library ThrowLimit2.jsl $ vjc ThrowLimit1.jsl /r:ThrowLimit2.dll |
#4
| |||
| |||
|
|
From: "Dan Schullman" <newsuser (AT) westerville (DOT) ohmy References: <uguYaH6QEHA.3988 (AT) tk2msftngp13 (DOT) phx.gbl yz8aIZyYEHA.3748 (AT) cpmsftngxa06 (DOT) phx.gbl Subject: Re: limit on number of exceptions in 'throws' clause?!!! Date: Fri, 9 Jul 2004 20:05:43 -0400 Lines: 142 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: <ekK2yGhZEHA.1000 (AT) TK2MSFTNGP12 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: wuzzyms.starbak.net 68.162.199.90 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFT NGXA05.phx.gbl!TK2MSFTNGP0 |
|
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.vjsharp:6183 X-Tomcat-NG: microsoft.public.dotnet.vjsharp I happened to have more than 9 exceptions because we have a fair amount of granularity with them. In a calling tree, the lowest-level guys may not throw many but as their exceptions get rolled up by ever-increasing levels among them, those upper levels could throw many exceptions (if they don't attempt to base-class them or rethrow something else). Don't get me wrong... more than nine (9) is most of the time sufficient. *HOWEVER*, whatever the limit, I would strongly urge that it be an OBVIOUS compiler error to throw more than the max. Unfortunately the error message I got (see below) was NOT in the module that had the problem and referenced an invalid class name. Hence it was rather difficult to track down. --Dan S. "Sadagopan Rajaram" <sadar.vjcr (AT) online (DOT) microsoft.com> wrote in message news:yz8aIZyYEHA.3748 (AT) cpmsftngxa06 (DOT) phx.gbl... Hi, This is not a valid restriction and is a bug in the compiler when we are reading in the metadata. We will look at fixing it in the next release. The error scenario happens when 1) The 'throws' clause has more than 9 exceptions 2) The error causing method is compiled into a dll and then referred. If you can compile both the sources together, it will work. However, I understand that this is not possible if the method were in a third party library. Can I also please try to understand the scenario where you require more than 10 exceptions in the 'throws' clause in a referenced dll? Thanks for your feedback. Sadagopan Rajaram Microsoft Visual J# .NET Product Team. This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm -------------------- From: "Dan Schullman" <newsuser (AT) westerville (DOT) ohmy Subject: limit on number of exceptions in 'throws' clause?!!! Date: Thu, 27 May 2004 00:19:46 -0400 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: <uguYaH6QEHA.3988 (AT) tk2msftngp13 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: 209-150-43-227.c3-0.frm-ubr1.sbo-frm.ma.cable.rcn.com 209.150.43.227 Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp1 3 phx.gbl Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:6089 X-Tomcat-NG: microsoft.public.dotnet.vjsharp I've just spent eight hours tracking down what appears to be a limit on the number of exceptions in a 'throws' clause when the offending method is in a .NET library. GRRR!!!! I was getting an error like: ThrowLimit1.jsl(11,6): error VJS1161: Cannot find class '' At a minimum, a much better error message would have helped immensely! Further, the error wasn't reported for the offending method but rather for the method that referenced it. And is this restriction documented anywhere? --Dan S. -------------------- ThrowLimit1.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class ThrowLimit1 { public static void main(String[] args) { try { new ThrowLimit2().nine(); new ThrowLimit2().ten(); } catch ( System.Exception e ) { System.out.println( "EXCEPTION: " + e ); } } } -------------------- ThrowLimit2.jsl -------------------- // Experiment with limit on number of 'throws' exceptions package ThrowLimit; public class Ex01 extends System.Exception {public Ex01(String x){super(x);}} public class Ex02 extends System.Exception {public Ex02(String x){super(x);}} public class Ex03 extends System.Exception {public Ex03(String x){super(x);}} public class Ex04 extends System.Exception {public Ex04(String x){super(x);}} public class Ex05 extends System.Exception {public Ex05(String x){super(x);}} public class Ex06 extends System.Exception {public Ex06(String x){super(x);}} public class Ex07 extends System.Exception {public Ex07(String x){super(x);}} public class Ex08 extends System.Exception {public Ex08(String x){super(x);}} public class Ex09 extends System.Exception {public Ex09(String x){super(x);}} public class Ex10 extends System.Exception {public Ex10(String x){super(x);}} public class ThrowLimit2 { public void nine() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09 {} public void ten() throws Ex01, Ex02, Ex03, Ex04, Ex05, Ex06, Ex07, Ex08, Ex09, Ex10 {} } -------------------- compile the above with -------------------- $ vjc /t:library ThrowLimit2.jsl $ vjc ThrowLimit1.jsl /r:ThrowLimit2.dll |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |