binary-compatibility

Changing a constructor param type breaks class in another jar

I have the following class in a common jar: public class Common { public Common(List list) { ... } } I then change the constructor parameter from a List to a Collection as follows: public class Common { public Common(Collection collection) { ... } } Rebuilding the common jar and running the system causes a...

What would I lose by abandoning the standard EventHandler pattern in .NET?

There's a standard pattern for events in .NET - they use a delegate type that takes a plain object called sender and then the actual "payload" in a second parameter, which should be derived from EventArgs. The rationale for the second parameter being derived from EventArgs seems pretty clear (see the .NET Framework Standard Library Anno...

Refactored methods and binary compatibility in Java

When refactoring methods it is easy to introduce binary incompabilities (with previous versions of the code) in Java. Consider changing a method to widen the type of its parameter to a parent interface: void doSomething(String x); // change it to void doSomething(CharSequence c); All the code that uses this method will continue...

VB6 binary compatibility - adding new Events

In a VB6 ActiveX exe project, is there any way to preserve the GUID for the events dispinterface if and when new events are added? Obviously changing existing events breaks compatibility. Adding a new one doesn't cause the VB6 IDE to issue a warning. This doesn't really surprise me, though, as it also doesn't warn when you add new metho...

How to design a C++ API for binary compatible extensibility

I am designing an API for a C++ library which will be distributed in a dll / shared object. The library contains polymorhic classes with virtual functions. I am concerned that if I expose these virtual functions on the DLL API, I cut myself from the possibility of extending the same classes with more virtual functions without breaking bi...

Does removing an interface break code calling methods on the object?

I need to do some refactoring in Java, and I need to maintain some degree of binary compatibility. In this case I want to remove some legacy interfaces, that are not used anywhere anymore and which require a rather big (and also deprecated) external dependency. I have class C that implements interface I, and I have code that calls a met...

How to identify a missing method (Binary Compatibility) in a JAR without running it?

I want to verify binary compatibility between 2 JARs. Following the suggestions in this answer I used jboss tattletale but it can find only missing classes. How can I find if there are missing methods? Is it possible at all? E.g. "Depends - on" class Foo depends on Bar (like many other middle class workers) import org.overlyusedcla...

Is it possible to share a C struct in shared memory between apps compiled with different compilers?

I realize that in general the C and C++ standards gives compiler writers a lot of latitude. But in particular it guarantees that POD types like C struct members have to be laid out in memory the same order that they're listed in the structs definition, and most compilers provide extensions letting you fix the alignment of members. So if ...

in VB6, why do I have to set version compatibility to No Compatibility from Binary Compatibility, and then back to Binary Compatibility to make things work?

My project was originally set to Binary Compatibility, but it was not building. So I first set it to No Compatibility, it built fine that way. Then I set it back to Binary Compatibility, and overwrote over the previously generated file, it worked fine. Why does this have to happen? ...

Building Boost with LSB C++ Compiler

I want to build my program with LSB C++ Compiler from the Linux Standard Base http://www.linuxfoundation.org/collaborate/workgroups/lsb. Program depends on the Boost library, built with gcc 4.4 version. Compilation fails. Is it possible to build the Boost library with LSB C++ Compiler? Alternatively, is it possible to build the Boost lib...

Java - binary compatibility of abstract class & subclasses

In Java, I define an abstract class with both concrete and abstract methods in it, and it has to be subclassed independently by third-party developers. Just to be sure: are there any changes I could make to the abstract class that are source compatible with their classes but not binary compatible? In other words: after they have compiled...

Does changing the order of class private data members breaks ABI

I have a class with number of private data members (some of them static), accessed by virtual and non-virtual member functions. There's no inline functions and no friend classes. class A { int number; string str; static const int static_const_number; bool b; public: A(); virtual ~A(); public: // got virtual a...

Java binary compatibility - RFC on proposed solution to covariant return type using invokevirtual semantics

Hi SO users, I'm trying to evolve an API. As part of this evolution I need to change the return type of a method to a subclass (specialize) in order for advanced clients to be able to access the new functionality. Example (ignore the ugly : public interface Entity { boolean a(); } public interface Intf1 { Entity entity(); } publi...

On which Linux distribution should I link for best binary compatibility?

I'm wondering which Linux distribution would be best (i.e. introduces the least dependencies) when linking a binary that should work on as many distributions as possible against shared libraries. I've done it on Ubuntu, but the list of dependencies is horrible. SDL introduces PulseAudio and whatnot. My next guess would be to use Debian ...

Retrofitting void methods to return its argument to facilitate fluency: breaking change?

"API design is like sex: make one mistake and support it for the rest of your life" (Josh Bloch on twitter) There are many design mistakes in the Java library. Stack extends Vector (discussion), and we can't fix that without causing breakage. We can try to deprecate Integer.getInteger (discussion), but it's probably going to stay ar...

GCC 4.0, 4.2 and LLVM ABI Compatibility

Are the three main compiler flavors supported by Xcode (gcc 4.0, 4.2, and llvm) binary-compatible with one another? What kind of gotchas and corner cases should I be aware of when bringing a multi-library project up to speed with the most recent Xcode tools? ...

VB6 IDE Is Locking The Loaded Project's DLL

I'm responsible for maintaining legacy VB6 code, and have encountered an annoying problem with regard to the locking of a project's COM DLL. (We'll call it MyProject and MyProject.dll) When I load MyProject into the VB6 IDE, I am able to compile the resulting binary-compatible DLL MyProject.dll. I can then run my (Classic ASP) web appli...