avinash-k / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

make private constants in MagicWord protected or public #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
constants such as
private static final String MAGIC_CURRENT_DAY = "CURRENTDAY";
are declared private

For better extensibility of the MagicWord class, these should (at least) be 
protected. Extending classes then only need to use them instead of re-declaring 
the names. They could probably be set to public in order to allow access from 
e.g. WikiModel classes.

Original issue reported on code.google.com by nico.kru...@googlemail.com on 9 May 2012 at 10:08

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 9 May 2012 at 4:59

GoogleCodeExporter commented 8 years ago

Original comment by axelclk@gmail.com on 9 May 2012 at 4:59

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r4997.

Original comment by axelclk@gmail.com on 9 May 2012 at 5:00

GoogleCodeExporter commented 8 years ago
Fixed with r4997

Original comment by axelclk@gmail.com on 9 May 2012 at 5:01

GoogleCodeExporter commented 8 years ago
thanks - the following patch also removes the ":R" variants which are not 
needed any more (R should always be passed as a parameter):

From f36ca1d3e56effd41b01e8531b258c738e0d6cde Mon Sep 17 00:00:00 2001
From: Nico Kruber <kruber@zib.de>
Date: Thu, 10 May 2012 10:41:05 +0200
Subject: [PATCH] removed "<MAGICWORD>:R" from the magic words ("R" is passed
 as a parameter if present)

---
 .../java/info/bliki/wiki/filter/MagicWord.java     |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/bliki-core/src/main/java/info/bliki/wiki/filter/MagicWord.java 
b/bliki-core/src/main/java/info/bliki/wiki/filter/MagicWord.java
index 65331be..d2b2228 100644
--- a/bliki-core/src/main/java/info/bliki/wiki/filter/MagicWord.java
+++ b/bliki-core/src/main/java/info/bliki/wiki/filter/MagicWord.java
@@ -87,24 +87,14 @@ public class MagicWord {

    public static final String MAGIC_NUMBER_ARTICLES = "NUMBEROFARTICLES";

-   public static final String MAGIC_NUMBER_ARTICLES_R = "NUMBEROFARTICLES:R";
-
    public static final String MAGIC_NUMBER_PAGES = "NUMBEROFPAGES";

-   public static final String MAGIC_NUMBER_PAGES_R = "NUMBEROFPAGES:R";
-
    public static final String MAGIC_NUMBER_FILES = "NUMBEROFFILES";

-   public static final String MAGIC_NUMBER_FILES_R = "NUMBEROFFILES:R";
-
    public static final String MAGIC_NUMBER_USERS = "NUMBEROFUSERS";

-   public static final String MAGIC_NUMBER_USERS_R = "NUMBEROFUSERS:R";
-
    public static final String MAGIC_NUMBER_ADMINS = "NUMBEROFADMINS";

-   public static final String MAGIC_NUMBER_ADMINS_R = "NUMBEROFADMINS:R";
-
    public static final String MAGIC_PAGES_IN_NAMESPACE = "PAGESINNAMESPACE";

    // page values
@@ -206,18 +196,12 @@ public class MagicWord {
        // statistics
        MAGIC_WORDS.add(MAGIC_CURRENT_VERSION);
        MAGIC_WORDS.add(MAGIC_NUMBER_ARTICLES);
-       MAGIC_WORDS.add(MAGIC_NUMBER_ARTICLES_R);
        MAGIC_WORDS.add(MAGIC_NUMBER_PAGES);
-       MAGIC_WORDS.add(MAGIC_NUMBER_PAGES_R);
        MAGIC_WORDS.add(MAGIC_NUMBER_FILES);
-       MAGIC_WORDS.add(MAGIC_NUMBER_FILES_R);
        MAGIC_WORDS.add(MAGIC_NUMBER_USERS);
-       MAGIC_WORDS.add(MAGIC_NUMBER_USERS_R);
        MAGIC_WORDS.add(MAGIC_NUMBER_ADMINS);
-       MAGIC_WORDS.add(MAGIC_NUMBER_ADMINS_R);
        MAGIC_WORDS.add(MAGIC_PAGES_IN_NAMESPACE);
        // MAGIC_WORDS.add(MAGIC_PAGES_IN_NAMESPACE_NS);
-       // MAGIC_WORDS.add(MAGIC_PAGES_IN_NAMESPACE_NS_R);
        // page values
        MAGIC_WORDS.add(MAGIC_PAGE_NAME);
        MAGIC_WORDS.add(MAGIC_PAGE_NAME_E);
-- 
1.7.7

Original comment by nico.kru...@googlemail.com on 10 May 2012 at 8:52

GoogleCodeExporter commented 8 years ago
attached the patch, for better usability

Original comment by nico.kru...@googlemail.com on 10 May 2012 at 9:03

Attachments:

GoogleCodeExporter commented 8 years ago
Added path with r5106

Original comment by axelclk@gmail.com on 10 May 2012 at 4:34