[m-rev.] for review: read and write bitmaps in bitmap.m

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Mar 5 21:05:22 AEDT 2022


2022-03-05 19:59 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
>>> Has this change been checked in the C# and Java grades?
>>
>> It is being bootchecked in C# right now; it is in the middle of tests/hard_coded.
>> Java is next.
>>
>>> (If not, you
>>> should do so to check that the access modifiers on the methods of the
>>> underlying file stream implementations are still appropriate when the
>>> bitmap code is in its new location
>>
>> I have no idea how to do that.
> 
> Changing them from private to public would work.  Let's see if there
> is a problem first.

In Java grade, yes, there is a problem. The stage 2 library cannot be built;
the only .err file containing anything is mer_std.err , which contains this:

bitmap.m:2039: error: cannot find symbol
    MR_BinaryInputFile mf = (MR_BinaryInputFile) Stream;
    ^
  symbol:   class MR_BinaryInputFile
  location: class bitmap
bitmap.m:2039: error: cannot find symbol
    MR_BinaryInputFile mf = (MR_BinaryInputFile) Stream;
                             ^
  symbol:   class MR_BinaryInputFile
  location: class bitmap
bitmap.m:2156: error: cannot find symbol
        ((MR_BinaryOutputFile) Stream).write(Bitmap.elements, Start, Length);
          ^
  symbol:   class MR_BinaryOutputFile
  location: class bitmap
bitmap.m:2039: error: cannot find symbol
    MR_BinaryInputFile mf = (MR_BinaryInputFile) Stream;
    ^
  symbol:   class MR_BinaryInputFile
  location: class bitmap
bitmap.m:2039: error: cannot find symbol
    MR_BinaryInputFile mf = (MR_BinaryInputFile) Stream;
                             ^
  symbol:   class MR_BinaryInputFile
  location: class bitmap
bitmap.m:2156: error: cannot find symbol
        ((MR_BinaryOutputFile) Stream).write(Bitmap.elements, Start, Length);
          ^
  symbol:   class MR_BinaryOutputFile
  location: class bitmap
bitmap.m:2156: error: cannot find symbol
        ((MR_BinaryOutputFile) Stream).write(Bitmap.elements, Start, Length);
          ^
  symbol:   class MR_BinaryOutputFile
  location: class bitmap
Note: Mercury/javas/jmercury/builtin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors

The code it complains about has a reference to MR_MercuryFileStruct
a few lines above. It finds that ok, but not MR_Binary{In,Out}putFile,
which are defined soon after MR_MercuryFileStruct in io.m. All are public classes.
I don't see why it has access to one but the other, but then, I have never
written a non-toy Java program in my life, and I have never worked
on Mercury's Java runtime. Would you care to tell me just what occurrences
of "private" you thought may need to be changed to "public"?

Zoltan.


More information about the reviews mailing list