Question: I have been making a little holiday website and I have been modifying an existing word press theme. However, the website looks fine in Chrome but when I went to check it in Firefox, ouch! I have no idea what happened.

<http://rita.adsa.co.uk/>

Could someone please point me in the right direction? It's baffling my mind!

Best wishes!

Answer: 
1. Make a backport of AutoCloseable
2. Make a 2nd Version of your library using the backport instead of the real thing
3. Either make the user choose which library to use by actually publishing it as two artifacts, or build a common facade which loads the correct version using reflection.

For backporting:

AutoClosable can be reused as is. 

For each implementation, you'll need an Adapter to that interface. 

The try with resources Statement could look somewhat like

```
abstract public class Try {
    private List<AutoClosable> closables = new ArrayList<>();

    public void register(AutoClosable closable){
        closables.add(closable); 
    }

    abstract void execute();

    public void do(){
        try{
            execute()
        } finally {
            for (AutoClosable c : closables)
                c.close() // there are tons of exceptionhandling missing here, and the order might need to get reversed ....
        }
    }
}

```

Usage would look somewhat like:

```
new Try(){
    File f = new File();
    {
        register(closable(f)) // closabe would return an Adapter from File to AutoClosable
    }

    void execute(){
        f.doSomeFunStuff()
    }
}.do();

```
You need two versions of your lib, but if you want to have only one source code, take a look at AspectJ , which modifies the byte code after compilation. 
Thatcway you could get two libs using one sozrce code, but two build targets with different AspectJ options.