/*
 * Copyright (c) 2015 Pantheon Technologies s.r.o. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.yangtools.yang.model.ri.type;

import static java.util.Objects.requireNonNull;

import com.google.common.annotations.Beta;
import com.google.common.collect.RangeSet;

@Beta
public class InvalidRangeConstraintException extends IllegalArgumentException {
    private static final long serialVersionUID = 1L;

    private final RangeSet<?> offendingRangeConstraint;

    protected InvalidRangeConstraintException(final RangeSet<?> offendingConstraint, final String message) {
        super(message);
        this.offendingRangeConstraint = requireNonNull(offendingConstraint);
    }

    public InvalidRangeConstraintException(final RangeSet<?> offendingConstraint, final String format,
            final Object... args) {
        this(offendingConstraint, String.format(format, args));
    }

    public RangeSet<?> getOffendingRanges() {
        return offendingRangeConstraint;
    }
}

@@ -377,49 +377,43 @@
 ort 
-static java.util.Objects.requireNonNull;%0A
+com.google.common.annotations.Beta;
 %0Aimp
@@ -434,32 +434,41 @@
 .common.
-annotations.B
+collect.ImmutableRangeS
 et
-a
 ;%0Aimport
@@ -659,24 +659,33 @@
 ivate final 
+Immutable
 RangeSet%3C?%3E 
@@ -888,22 +888,32 @@
 t = 
-requireNonNull
+ImmutableRangeSet.copyOf
 (off
@@ -1140,32 +1140,32 @@
  args));%0A    %7D%0A%0A
-
     public Range
@@ -1159,16 +1159,22 @@
  public 
+final 
 RangeSet

Fix InvalidRangeConstraintException serializability