[m-rev.] For review: Fix a Java CLASSPATH-related bug

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 20 10:21:38 AEDT 2004


On 19-Feb-2004, James Goddard <goddardjames at yahoo.com> wrote:
> +++ modules.m	19 Feb 2004 10:19:47 -0000
> @@ -805,6 +805,11 @@
>  :- pred list_class_files_for_jar(module_name::in, string::in, string::out,
>  		io__state::di, io__state::uo) is det.
>  
> +	% get_env_classpath:
> +	%	Obtain the value of the environment variable CLASSPATH.
> +
> +:- pred get_env_classpath(string::out, io__state::di, io__state::uo) is det.
...
> +get_env_classpath(Classpath) -->
> +	io__get_environment_var("CLASSPATH", MaybeCP),
> +	(
> +		{ MaybeCP = yes(Classpath) }
> +	;
> +		{ MaybeCP = no },
> +		io__get_environment_var("java.class.path", MaybeJCP),
> +		{
> +			MaybeJCP = yes(Classpath)
> +		;
> +			MaybeJCP = no,
> +			Classpath = ""
> +		}
> +	).

The comment there doesn't quite match the code.

I suggest rewording the comment to make it a bit more abstract
and/or to more accurately reflect the implementation.
e.g.

	% get_env_classpath:
	%	Get the value of the Java class path from the environment.
	%	(Normally it will be obtained from the CLASSPATH environment
	%	variable, but if that isn't present then the java.class.path
	%	variable may be used instead.  This is used for the Java
	%	back-end, which doesn't support environment variables
	%	properly.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list