more strict AFP properties;
authorwenzelm
Mon Mar 25 17:21:26 2019 +0100 (3 weeks ago)
changeset 699813dced198b9ec
parent 69980 f2e3adfd916f
child 69982 f150253cb201
more strict AFP properties;
src/Pure/Admin/afp.scala
     1.1 --- a/src/Pure/Admin/afp.scala	Mon Mar 25 16:45:08 2019 +0100
     1.2 +++ b/src/Pure/Admin/afp.scala	Mon Mar 25 17:21:26 2019 +0100
     1.3 @@ -43,12 +43,13 @@
     1.4  
     1.5      def title: String = get_string("title")
     1.6      def authors: List[String] = get_strings("author")
     1.7 -    def date: Option[Date] = get("date").map(parse_date(_))
     1.8 +    def date: Date =
     1.9 +      parse_date(get("date").getOrElse(error("Missing date for entry " + quote(name))))
    1.10      def topics: List[String] = get_strings("topic")
    1.11 -    def `abstract`: String = get_string("abstract")
    1.12 +    def `abstract`: String = get_string("abstract").trim
    1.13      def maintainers: List[String] = get_strings("notify")
    1.14      def contributors: List[String] = get_strings("contributors")
    1.15 -    def license: Option[String] = get("license")
    1.16 +    def license: String = get("license").getOrElse("BSD")
    1.17    }
    1.18  }
    1.19