Skip to content
Permalink
Browse files
Merge branch 'refix-typecode' into 'ibm-trunk'
Refix typecode

See merge request !64
  • Loading branch information
ngmr committed Mar 27, 2016
2 parents be541a6 + c4cb4e4 commit 76d3b501a977250ac7862de5dde4c8a19ac5bb30
Showing 34 changed files with 636 additions and 693 deletions.
@@ -131,8 +131,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx128m</argLine>
<argLine>-Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
<argLine>-Xmx128m -Djava.endorsed.dirs=${project.build.directory}/endorsed</argLine>
<includes>
<include>**/org/apache/yoko/*Test.java</include>
</includes>
@@ -18,71 +18,67 @@

package org.apache.yoko.rmi.impl;

import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

import java.io.PrintWriter;

class AbstractObjectDescriptor extends ValueDescriptor {
protected AbstractObjectDescriptor(Class type, TypeRepository repository) {
super(type, repository);
}

@Override
protected String genRepId() {
return String.format("IDL:%s:1.0", _java_class.getName().replace('.', '/'));
return String.format("IDL:%s:1.0", type.getName().replace('.', '/'));
}

/** Read an instance of this value from a CDR stream */
public Object read(org.omg.CORBA.portable.InputStream in) {
@Override
public Object read(InputStream in) {
org.omg.CORBA_2_3.portable.InputStream _in = (org.omg.CORBA_2_3.portable.InputStream) in;

return _in.read_abstract_interface();
}

/** Write an instance of this value to a CDR stream */
public void write(org.omg.CORBA.portable.OutputStream out, Object value) {
@Override
public void write(OutputStream out, Object value) {
org.omg.CORBA_2_3.portable.OutputStream _out = (org.omg.CORBA_2_3.portable.OutputStream) out;

_out.write_abstract_interface(value);
}

/*
* public java.io.Serializable writeReplace (java.io.Serializable val) {
* return null; }
*
* public void writeValue(org.omg.CORBA.portable.OutputStream out,
* java.io.Serializable value) { // skip // }
*
* public java.io.Serializable readValue (org.omg.CORBA.portable.InputStream
* in, java.util.Map offsetMap) { return null; }
*/

org.omg.CORBA.TypeCode getTypeCode() {
if (_type_code == null) {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
_type_code = orb.create_abstract_interface_tc(getRepositoryID(),
_java_class.getName());
}

return _type_code;
@Override
protected TypeCode genTypeCode() {
ORB orb = ORB.init();
return orb.create_abstract_interface_tc(getRepositoryID(), type.getName());
}

@Override
public long computeHashCode() {
return 0L;
}

@Override
Object copyObject(Object value, CopyState state) {
throw new IllegalStateException("not serializable " + value.getClass().getName());
}

void writeMarshalValue(java.io.PrintWriter pw, String outName,
String paramName) {
@Override
void writeMarshalValue(PrintWriter pw, String outName, String paramName) {
pw.print("javax.rmi.CORBA.Util.writeAbstractObject(");
pw.print(outName);
pw.print(',');
pw.print(paramName);
pw.print(')');
}

void writeUnmarshalValue(java.io.PrintWriter pw, String inName) {
@Override
void writeUnmarshalValue(PrintWriter pw, String inName) {
pw.print(inName);
pw.print(".read_abstract_interface()");
}

}
@@ -18,48 +18,60 @@

package org.apache.yoko.rmi.impl;

import java.io.PrintWriter;

import org.omg.CORBA.ORB;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

class AnyDescriptor extends TypeDescriptor {
AnyDescriptor(Class type, TypeRepository rep) {
super(type, rep);
}

@Override
protected String genRepId() {
return String.format("IDL:%s:1.0", _java_class.getName().replace('.', '/'));
return String.format("IDL:%s:1.0", type.getName().replace('.', '/'));
}

/** Read an instance of this value from a CDR stream */
public Object read(org.omg.CORBA.portable.InputStream in) {
@Override
public Object read(InputStream in) {
return javax.rmi.CORBA.Util.readAny(in);
}

/** Write an instance of this value to a CDR stream */
public void write(org.omg.CORBA.portable.OutputStream out, Object val) {
@Override
public void write(OutputStream out, Object val) {
javax.rmi.CORBA.Util.writeAny(out, val);
}

org.omg.CORBA.TypeCode getTypeCode() {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
return orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_any);
@Override
protected TypeCode genTypeCode() {
ORB orb = ORB.init();
return orb.get_primitive_tc(TCKind.tk_any);
}

@Override
Object copyObject(Object value, CopyState state) {
throw new InternalError("cannot copy org.omg.CORBA.Any");
}

void writeMarshalValue(java.io.PrintWriter pw, String outName,
String paramName) {
@Override
void writeMarshalValue(PrintWriter pw, String outName, String paramName) {
pw.print("javax.rmi.CORBA.Util.writeAny(");
pw.print(outName);
pw.print(',');
pw.print(paramName);
pw.print(')');
}

void writeUnmarshalValue(java.io.PrintWriter pw, String inName) {
@Override
void writeUnmarshalValue(PrintWriter pw, String inName) {
pw.print("javax.rmi.CORBA.Util.readAny(");
pw.print(inName);
pw.print(")");
}

}

0 comments on commit 76d3b50

Please sign in to comment.