From 5fb2c474c29c5d5bea2c2a0a3b998942f2b22b77 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Mon, 9 Oct 2023 09:02:40 +0900 Subject: [PATCH] deprecate CaseClassTooLong exception unused since https://github.com/eed3si9n/scalaxb/commit/73343d888814561745af6ca183e361e272fe93c6 --- cli/src/main/scala/scalaxb/compiler/Main.scala | 2 -- cli/src/main/scala/scalaxb/compiler/Module.scala | 1 + cli/src/main/scala/scalaxb/compiler/SbtApp.scala | 3 --- cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala | 2 +- mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java | 3 --- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cli/src/main/scala/scalaxb/compiler/Main.scala b/cli/src/main/scala/scalaxb/compiler/Main.scala index 72f89d47d..43794e79b 100644 --- a/cli/src/main/scala/scalaxb/compiler/Main.scala +++ b/cli/src/main/scala/scalaxb/compiler/Main.scala @@ -40,8 +40,6 @@ object Main { catch { case e: ReferenceNotFound => log.error(e.getMessage) - case e: CaseClassTooLong => - log.error(e.getMessage) case e: Exception => log.error(e.getStackTrace.mkString("", Module.NL, Module.NL)) } diff --git a/cli/src/main/scala/scalaxb/compiler/Module.scala b/cli/src/main/scala/scalaxb/compiler/Module.scala index cae561b6e..aaad544d9 100644 --- a/cli/src/main/scala/scalaxb/compiler/Module.scala +++ b/cli/src/main/scala/scalaxb/compiler/Module.scala @@ -540,6 +540,7 @@ class ReferenceNotFound(kind: String, namespace: Option[String], name: String) e "Error: Referenced " + kind + " " + (namespace map { "{" + _ + "}" } getOrElse {"(unqualified) "}) + name + " was not found.") +@deprecated(message = "will be removed") class CaseClassTooLong(fqn: String, xmlname: String) extends RuntimeException( s"""Error: A case class with > 22 parameters cannot be created for ${fqn}. Consider using --wrap-contents "${xmlname}" option.""" ) diff --git a/cli/src/main/scala/scalaxb/compiler/SbtApp.scala b/cli/src/main/scala/scalaxb/compiler/SbtApp.scala index 88224d5ce..b048a3a87 100644 --- a/cli/src/main/scala/scalaxb/compiler/SbtApp.scala +++ b/cli/src/main/scala/scalaxb/compiler/SbtApp.scala @@ -12,9 +12,6 @@ class SbtApp extends xsbti.AppMain { case e: ReferenceNotFound => logger.error(e.getMessage) Exit(1) - case e: CaseClassTooLong => - logger.error(e.getMessage) - Exit(1) case e: Exception => logger.error(e.getStackTrace.mkString("", Module.NL, Module.NL)) Exit(1) diff --git a/cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala b/cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala index e2ceb0ba5..1246bbb3c 100644 --- a/cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala +++ b/cli/src/main/scala/scalaxb/compiler/xsd/GenSource.scala @@ -22,7 +22,7 @@ package scalaxb.compiler.xsd -import scalaxb.compiler.{Config, Snippet, CaseClassTooLong, Log} +import scalaxb.compiler.{Config, Snippet, Log} import scala.collection.mutable import scala.collection.{Map} import scala.xml._ diff --git a/mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java b/mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java index c1583062c..3be0106c9 100644 --- a/mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java +++ b/mvn-scalaxb/src/main/java/org/scalaxb/maven/ScalaxbMojo.java @@ -49,7 +49,6 @@ import scala.Option; import scalaxb.compiler.Arguments; -import scalaxb.compiler.CaseClassTooLong; import scalaxb.compiler.Module; import scalaxb.compiler.ReferenceNotFound; @@ -159,8 +158,6 @@ private void invokeCompiler(Arguments args) context.refresh(getOutputDirectory()); } catch (ReferenceNotFound ex) { throw new MojoFailureException(ex.getMessage(), ex); - } catch (CaseClassTooLong ex) { - throw new MojoFailureException(ex.getMessage(), ex); } catch (Exception ex) { throw new MojoExecutionException("Error running scalaxb", ex); }