All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.myire.annotation.Unreachable Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
/*
 * Copyright 2016 Peter Franzen. All rights reserved.
 *
 * Licensed under the Apache License v2.0: http://www.apache.org/licenses/LICENSE-2.0
 */
package org.myire.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
 * Annotation used to document a method as unreachable under normal execution. The canonical example
 * is the private constructor in utility classes (i.e. final classes with only static methods). This
 * constructor is declared to prevent instantiations of such a utility class, and is not meant to be
 * executed.
 *

* Unreachable code may still be reachable by e.g. changing the access modifier of the method * through reflection. * * @author Peter Franzen */ @Target({ElementType.CONSTRUCTOR, ElementType.METHOD}) @Retention(RetentionPolicy.CLASS) public @interface Unreachable { // No body }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy