{"commit":"3661d8fc36c37a6b97ee4754dc19e0534291d46d","subject":"Force little endian order for filetypes module.","message":"Force little endian order for filetypes module.","repos":"166MMX\/redhorizon,166MMX\/redhorizon,166MMX\/redhorizon,ultraq\/redhorizon,166MMX\/redhorizon","old_file":"Projects\/Red Horizon - Filetypes\/Java\/redhorizon\/utilities\/ByteBufferOrdering.aj","new_file":"Projects\/Red Horizon - Filetypes\/Java\/redhorizon\/utilities\/ByteBufferOrdering.aj","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"AspectJ"} {"commit":"67366d5a8ad56f68e873744408768fe4fe7d22e0","subject":"remove field masking issues","message":"remove field masking issues\n","repos":"mebigfatguy\/hashshmash","old_file":"aj\/com\/mebigfatguy\/hashshmash\/HashCollector.aj","new_file":"aj\/com\/mebigfatguy\/hashshmash\/HashCollector.aj","new_contents":"\/*\n * hashshmash - An aspect to record HashMap\/Set allocations\n * Copyright 2013 MeBigFatGuy.com\n * Copyright 2013 Dave Brosius\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and limitations\n * under the License.\n *\/\npackage com.mebigfatguy.hashshmash;\n\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.PrintWriter;\nimport java.lang.reflect.Field;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedHashMap;\nimport java.util.LinkedHashSet;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Set;\nimport java.util.concurrent.ConcurrentHashMap;\n\npublic aspect HashCollector {\n \n private static final Journaller journaller = new Journaller();\n\n after() returning (Map m): call(HashMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new HashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Map m): call(LinkedHashMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new LinkedHashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Map m): call(ConcurrentHashMapMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new ConcurrentHashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Set s): call(HashSet.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashSetDetails details = new HashSetDetails(s, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Set s): call(LinkedHashSet.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashSetDetails details = new LinkedHashSetDetails(s, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n before(): execution(public static void *.main(String[])) {\n Class c = HashCollector.class;\n }\n}\n\nfinal class Journaller implements Runnable {\n \n private static final int SLEEP_TIME = 5 * 1000;\n \n private Field tableField;\n private ConcurrentHashMap hDetails = new ConcurrentHashMap();\n private PrintWriter writer;\n private boolean operational = false;\n\n public Journaller() {\n try {\n System.out.println(\"*************************\");\n System.out.println(\"HASHSHMASH ASPECT ENABLED\");\n System.out.println(\"*************************\");\n \n tableField = HashMap.class.getDeclaredField(\"table\");\n tableField.setAccessible(true);\n \n File dir = new File(System.getProperty(\"user.home\"), \".hashshmash\");\n dir.mkdirs(); \n \n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, new Date().toString() + \".txt\")))));\n \n Thread t = new Thread(this);\n t.setDaemon(true);\n operational = true;\n t.start();\n } catch (Exception e) {\n }\n }\n \n public void add(HashDetails details) {\n if (operational)\n hDetails.put(details, details);\n }\n \n public void run() {\n try {\n while (!Thread.interrupted()) {\n Thread.sleep(SLEEP_TIME);\n \n for (HashDetails details : hDetails.keySet()) {\n try {\n Map map = details.getMap();\n if (map != null) {\n int newSize = details.getMap().size();\n if (newSize == details.size) {\n Entry[] table = (Entry[])tableField.get(map);\n details.totalSlots = table.length;\n for (Entry e : table) {\n if (e != null) {\n details.usedSlots++;\n }\n }\n writer.println(details);\n hDetails.remove(details);\n } else\n details.size = newSize;\n } else {\n hDetails.remove(details);\n }\n } catch (Exception e) {\n \/\/might get ConcurrentModificationException or such, just ignore\n }\n }\n writer.flush();\n }\n } catch (InterruptedException ie) { \n }\n }\n}\n\nabstract class HashDetails {\n private static SimpleDateFormat FORMATTER = new SimpleDateFormat(\"MM\/dd\/yyyy HH:mm:ss-SSS\");\n \n public Date allocTime;\n public String caller;\n public int size;\n public int usedSlots;\n public int totalSlots;\n \n public abstract Map getMap();\n \n public abstract String getDetailType();\n \n public String toString() {\n return getDetailType() + \"\\t\" + FORMATTER.format(allocTime) + \"\\t\" + caller + \"\\t\" + getMap().size() + \"\\t\" + totalSlots + \"\\t\" + usedSlots;\n }\n}\n\nclass HashMapDetails extends HashDetails {\n public Map map;\n\n public HashMapDetails(Map m, Date d, String c) {\n map = m;\n allocTime = d;\n caller = c;\n size = map.size();\n }\n \n public Map getMap() {\n return map;\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass LinkedHashMapDetails extends HashMapDetails {\n\n public LinkedHashMapDetails(Map m, Date d, String c) {\n super(m, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass ConcurrentHashMapDetails extends HashMapDetails {\n \n public ConcurrentHashMapDetails(Map m, Date d, String c) {\n super(m, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass HashSetDetails extends HashDetails {\n private static Field MAP_FIELD;\n static {\n try {\n MAP_FIELD = HashSet.class.getDeclaredField(\"map\");\n MAP_FIELD.setAccessible(true);\n } catch (Exception e) {\n MAP_FIELD = null;\n }\n }\n \n public Set set;\n\n public HashSetDetails(Set s, Date d, String c) {\n set = s;\n allocTime = d;\n caller = c;\n size = set.size();\n }\n \n public Map getMap() {\n try {\n if (MAP_FIELD == null)\n return null;\n \n return (Map) MAP_FIELD.get(set);\n } catch (Exception e) {\n return null;\n }\n }\n \n public String getDetailType() {\n return set.getClass().getSimpleName();\n }\n}\n\nclass LinkedHashSetDetails extends HashSetDetails {\n public Map map;\n\n public LinkedHashSetDetails(Set s, Date d, String c) {\n super(s, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n","old_contents":"\/*\n * hashshmash - An aspect to record HashMap\/Set allocations\n * Copyright 2013 MeBigFatGuy.com\n * Copyright 2013 Dave Brosius\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and limitations\n * under the License.\n *\/\npackage com.mebigfatguy.hashshmash;\n\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.OutputStreamWriter;\nimport java.io.PrintWriter;\nimport java.lang.reflect.Field;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedHashMap;\nimport java.util.LinkedHashSet;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.Set;\nimport java.util.concurrent.ConcurrentHashMap;\n\npublic aspect HashCollector {\n \n private static final Journaller journaller = new Journaller();\n\n after() returning (Map m): call(HashMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new HashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Map m): call(LinkedHashMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new LinkedHashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Map m): call(ConcurrentHashMapMap.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashMapDetails details = new ConcurrentHashMapDetails(m, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Set s): call(HashSet.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashSetDetails details = new HashSetDetails(s, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n after() returning (Set s): call(LinkedHashSet.new(..)) {\n String fileName = thisJoinPointStaticPart.getSourceLocation().getFileName();\n int line = thisJoinPointStaticPart.getSourceLocation().getLine();\n \n HashSetDetails details = new LinkedHashSetDetails(s, new Date(), fileName + \":\" + line);\n journaller.add(details);\n }\n \n before(): execution(public static void *.main(String[])) {\n Class c = HashCollector.class;\n }\n}\n\nfinal class Journaller implements Runnable {\n \n private static final int SLEEP_TIME = 5 * 1000;\n \n private Field tableField;\n private ConcurrentHashMap hDetails = new ConcurrentHashMap();\n private PrintWriter writer;\n private boolean operational = false;\n\n public Journaller() {\n try {\n System.out.println(\"*************************\");\n System.out.println(\"HASHSHMASH ASPECT ENABLED\");\n System.out.println(\"*************************\");\n \n tableField = HashMap.class.getDeclaredField(\"table\");\n tableField.setAccessible(true);\n \n File dir = new File(System.getProperty(\"user.home\"), \".hashshmash\");\n dir.mkdirs(); \n \n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, new Date().toString() + \".txt\")))));\n \n Thread t = new Thread(this);\n t.setDaemon(true);\n operational = true;\n t.start();\n } catch (Exception e) {\n }\n }\n \n public void add(HashDetails details) {\n if (operational)\n hDetails.put(details, details);\n }\n \n public void run() {\n try {\n while (!Thread.interrupted()) {\n Thread.sleep(SLEEP_TIME);\n \n for (HashDetails details : hDetails.keySet()) {\n try {\n Map map = details.getMap();\n if (map != null) {\n int newSize = details.getMap().size();\n if (newSize == details.size) {\n Entry[] table = (Entry[])tableField.get(map);\n details.totalSlots = table.length;\n for (Entry e : table) {\n if (e != null) {\n details.usedSlots++;\n }\n }\n writer.println(details);\n hDetails.remove(details);\n } else\n details.size = newSize;\n } else {\n hDetails.remove(details);\n }\n } catch (Exception e) {\n \/\/might get ConcurrentModificationException or such, just ignore\n }\n }\n writer.flush();\n }\n } catch (InterruptedException ie) { \n }\n }\n}\n\nabstract class HashDetails {\n private static SimpleDateFormat FORMATTER = new SimpleDateFormat(\"MM\/dd\/yyyy HH:mm:ss-SSS\");\n \n public Date allocTime;\n public String caller;\n public int size;\n public int usedSlots;\n public int totalSlots;\n \n public abstract Map getMap();\n \n public abstract String getDetailType();\n \n public String toString() {\n return getDetailType() + \"\\t\" + FORMATTER.format(allocTime) + \"\\t\" + caller + \"\\t\" + getMap().size() + \"\\t\" + totalSlots + \"\\t\" + usedSlots;\n }\n}\n\nclass HashMapDetails extends HashDetails {\n public Map map;\n\n public HashMapDetails(Map m, Date d, String c) {\n map = m;\n allocTime = d;\n caller = c;\n size = map.size();\n }\n \n public Map getMap() {\n return map;\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass LinkedHashMapDetails extends HashMapDetails {\n public Map map;\n\n public LinkedHashMapDetails(Map m, Date d, String c) {\n super(m, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass ConcurrentHashMapDetails extends HashMapDetails {\n public Map map;\n \n public ConcurrentHashMapDetails(Map m, Date d, String c) {\n super(m, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n\nclass HashSetDetails extends HashDetails {\n private static Field MAP_FIELD;\n static {\n try {\n MAP_FIELD = HashSet.class.getDeclaredField(\"map\");\n MAP_FIELD.setAccessible(true);\n } catch (Exception e) {\n MAP_FIELD = null;\n }\n }\n \n public Set set;\n\n public HashSetDetails(Set s, Date d, String c) {\n set = s;\n allocTime = d;\n caller = c;\n size = set.size();\n }\n \n public Map getMap() {\n try {\n if (MAP_FIELD == null)\n return null;\n \n return (Map) MAP_FIELD.get(set);\n } catch (Exception e) {\n return null;\n }\n }\n \n public String getDetailType() {\n return set.getClass().getSimpleName();\n }\n}\n\nclass LinkedHashSetDetails extends HashSetDetails {\n public Map map;\n\n public LinkedHashSetDetails(Set s, Date d, String c) {\n super(s, d, c);\n }\n \n public String getDetailType() {\n return map.getClass().getSimpleName();\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"AspectJ"} {"commit":"be1a59a9c7d8790beac785fb2a343feb0a379ab5","subject":"First version of the statistics export to pdf","message":"First version of the statistics export to pdf\n","repos":"stieglma\/Schafkopfauswerter","old_file":"src\/StatisticsExport.aj","new_file":"src\/StatisticsExport.aj","new_contents":"import java.io.IOException;\n\nimport org.apache.pdfbox.pdmodel.PDDocument;\nimport org.apache.pdfbox.pdmodel.PDPage;\nimport org.apache.pdfbox.pdmodel.edit.PDPageContentStream;\nimport org.apache.pdfbox.pdmodel.font.PDType1Font;\n\nimport view.GUI;\n\npublic privileged aspect StatisticsExport {\n\t\n\tprivate GUI gui;\n\n \/**\n * catch constructor call, so that we have the correct gui, to refer to everywhere\n *\/\n after() returning(GUI gui): call(GUI.new(*)) {\n this.gui = gui;\n }\n \n \/**\n * Catch the call on {@link PDFReportListener.drawTable(PDDocument)} to get the pdf\n * creator object.\n * \n * @param document\n * @throws IOException\n *\/\n\tvoid around(PDDocument document) throws IOException\n\t\t: execution (* PDFReportListener.drawTable(PDDocument))\n\t\t&& args(document) {\n\t\tPDPage page = new PDPage();\n\t\tdocument.addPage(page);\n\t\tPDPageContentStream contentStream = new PDPageContentStream(document, page);\n\t\tcontentStream.setFont(PDType1Font.HELVETICA_BOLD, 10);\n\t\tcontentStream.beginText();\n\t\tcreateContent(contentStream);\n\t\tcontentStream.endText();\n\t\tcontentStream.close();\n\t}\n\t\n\t\/**\n\t * Write statistics to given contentStream<\/code> of a pdf page.\n\t * \n\t * @param contentStream The contentStream<\/code> of the pdf page to write on.\n\t * @throws IOException\n\t *\/\n\tprivate void createContent(PDPageContentStream contentStream) throws IOException {\n\t\tOverallStatistics data = gui.model.gameDB.getOverallStatistics();\n\t\t\n\t\tint anzahlSpieleGesamt = data.getAnzahlSpieleGesamt();\n int anzahlSpieleGesamtGewonnen = data.getAnzahlSpieleGesamtGewonnen();\n int teuerstesRufspiel = data.getTeuerstesRufspiel();\n int teuerstesSolo = data.getTeuerstesSolo();\n int teuerstesSoloTout = data.getTeuerstesSoloTout();\n int teuerstesSoloSie = data.getTeuerstesSoloSie();\n int anzahlRufspiele = data.getAnzahlRufspiele();\n int anzahlSoli = data.getAnzahlSoli();\n int anzahlSoliTout = data.getAnzahlSoliTout();\n int anzahlSoliSie = data.getAnzahlSoliSie();\n int anzahlSoliGesamt = data.getAnzahlSoliGesamt();\n int anzahlGewonneneSoliGesamt = data.getAnzahlGewonneneSoliGesamt();\n int anzahlGewonneneRufspiele = data.getAnzahlGewonneneRufspiele();\n int anzahlGewonneneSoli = data.getAnzahlGewonneneSoli();\n int anzahlGewonneneSoliTout = data.getAnzahlGewonneneSoliTout();\n int anzahlGewonneneSoliSie = data.getAnzahlGewonneneSoliSie();\n int anzahlWeiter = data.getAnzahlWeiter();\n\n double sologesamtwin = (anzahlSoliGesamt) > 0 ? ((double) (anzahlGewonneneSoliGesamt) \/ (anzahlSoliGesamt))\n : 0;\n \n contentStream.moveTextPositionByAmount(50, 650);\n contentStream.drawString(\"#Spiele (ohne weiter): \"\n + anzahlSpieleGesamt\n + \" (gewonnen: \"\n + String.format(\"%.2f\",\n (anzahlSpieleGesamt > 0 ? anzahlSpieleGesamtGewonnen\n \/ ((double) anzahlSpieleGesamt) : 0) * 100)\n + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Rufspiele: \"\n + anzahlRufspiele\n + \" (gewonnen: \"\n + String.format(\"%.2f\",\n (anzahlRufspiele > 0 ? anzahlGewonneneRufspiele\n \/ ((double) anzahlRufspiele) : 0) * 100)\n + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\" -> teuerstes Rufspiel: \"\n + teuerstesRufspiel);\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Soli gesamt: \"\n + (anzahlSoli + anzahlSoliTout + anzahlSoliSie)\n + \" (gewonnen: \"\n + String.format(\"%.2f\", sologesamtwin * 100)\n + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Soli normal: \"\n + anzahlSoli\n + \" (gewonnen: \"\n + String.format(\"%.2f\", (anzahlSoli > 0 ? anzahlGewonneneSoli\n \/ ((double) anzahlSoli) : 0) * 100)\n + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\" -> teuerstes Solo: \"\n + teuerstesSolo);\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Solo Tout: \"\n + anzahlSoliTout\n + \" (gewonnen: \"\n + String.format(\"%.2f\",\n (anzahlSoliTout > 0 ? anzahlGewonneneSoliTout\n \/ ((double) anzahlSoliTout) : 0) * 100)\n + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\" -> teuerstes Solo Tout: \"\n + teuerstesSoloTout);\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Solo Sie: \"\n + anzahlSoliSie\n + \" (gewonnen: \"\n + String.format(\"%.2f\",\n (anzahlSoliSie > 0 ? anzahlGewonneneSoliSie\n \/ ((double) anzahlSoliSie) : 0) * 100) + \"%)\");\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\" -> teuerstes Solo Sie: \" + teuerstesSoloSie);\n \n contentStream.moveTextPositionByAmount(0, -20);\n contentStream.drawString(\"#Weiter: \" + anzahlWeiter);\n\t}\n}\n","old_contents":"\n\npublic aspect StatisticsExport {\n\t\/\/ TODO Auto-generated aspect\n}\n","returncode":0,"stderr":"","license":"mit","lang":"AspectJ"} {"commit":"c622b56101847d13a738bf029b7205a6f83ec724","subject":"remove debug output","message":"remove debug output\n","repos":"stieglma\/Schafkopfauswerter","old_file":"src\/StatPlayerWiseTxt.aj","new_file":"src\/StatPlayerWiseTxt.aj","new_contents":"import java.awt.GridLayout;\nimport java.util.Iterator;\n\nimport javax.swing.JPanel;\nimport javax.swing.JTabbedPane;\nimport javax.swing.JTextArea;\n\nimport view.GUI;\nimport view.UIUpdater;\nimport model.db.GameData;\nimport model.SystemValues.Games;\nimport model.SystemValues.Players;\nimport model.SystemValues.WIN;\nimport model.db.DataObject;\n\npublic privileged aspect StatPlayerWiseTxt {\n declare precedence : StatPlayerWiseTxt, StatOverallGraph, StatOverallTxt;\n\n private static GUI gui;\n private static JPanel panel = new JPanel();\n private static JTextArea statText = new JTextArea();\n\n after() returning(GUI gui): call(GUI.new(*)) {\n StatPlayerWiseTxt.gui = gui;\n }\n\n after(JTabbedPane tabbedPane): \n execution(public static void StatisticsHelper.StatisticsPaneCreated(JTabbedPane))\n && args(tabbedPane) {\n statText.setEditable(false);\n panel.setLayout(new GridLayout(0, 1));\n panel.add(statText);\n ((JTabbedPane) tabbedPane).addTab(\"PlayerWiseText\", panel);\n }\n\n after() : execution(* UIUpdater.run()) {\n statText.setText(gui.model.getGameData()\n .getPlayerWiseStatisticsString());\n }\n\n public String GameData.getPlayerWiseStatisticsString() {\n StringBuilder result = new StringBuilder();\n\n for (Players player : Players.values()) {\n result.append(player);\n result.append(\":\" + System.lineSeparator() + System.lineSeparator());\n\n int gamesPlayedTot = 0;\n int gamesWonTot = 0;\n int highestAcc = 0;\n int lowestAcc = 0;\n int highestWin = 0;\n int highestLoss = 0;\n\n int[] gamesPlayedPerType = new int[Games.values().length];\n int[] gamesWonPerType = new int[Games.values().length];\n\n Iterator it = data.iterator();\n DataObject lastObj = it.next();\n\n while (it.hasNext()) {\n DataObject dataObj = it.next();\n\n if (dataObj.getPlayer().equals(player.toString())) {\n gamesPlayedTot++;\n gamesPlayedPerType[dataObj.getGameKind().ordinal()]++;\n if (dataObj.getGameWon() == WIN.PLAYER) {\n gamesWonTot++;\n gamesWonPerType[dataObj.getGameKind().ordinal()]++;\n }\n }\n int gameVal = dataObj.getPlayerVal(player) - lastObj.getPlayerVal(player);\n if (gameVal > highestWin) {\n highestWin = gameVal;\n } else if (gameVal < highestLoss) {\n highestLoss = gameVal;\n }\n\n int accVal = dataObj.getPlayerVal(player);\n if (accVal > highestAcc) {\n highestAcc = accVal;\n } else if (accVal < lowestAcc) {\n lowestAcc = accVal;\n }\n \n lastObj = dataObj;\n }\n\n double gamesWonPerc = ((gamesPlayedTot + gamesWonTot) > 0 ? (double) gamesWonTot\n \/ gamesPlayedTot\n : 0.0) * 100;\n\n double gamesWonPerTypePerc[] = new double[Games.values().length];\n for (Games game : Games.values()) {\n int i = game.ordinal();\n gamesWonPerTypePerc[i] = ((gamesPlayedPerType[i] + gamesWonPerType[i]) > 0 ? (double) gamesWonPerType[i]\n \/ gamesPlayedPerType[i]\n : 0.0) * 100;\n }\n\n result.append(\n \"Gespielte Spiele:\" + System.lineSeparator() + \"\\t\"\n + \"- Gesamt: \" + gamesPlayedTot)\n .append(\", davon gewonnen: \" + gamesWonTot)\n .append(\" (\" + String.format(\"%.2f\", gamesWonPerc) + \"%)\"\n + System.lineSeparator());\n\n for (Games game : Games.values()) {\n if (game != Games.WEITER) {\n int i = game.ordinal();\n result.append(\n \"\\t- \" + game.toString() + \": \"\n + gamesPlayedPerType[i])\n .append(\", davon gewonnen: \" + gamesWonPerType[i])\n .append(\" (\"\n + String.format(\"%.2f\",\n gamesWonPerTypePerc[i]) + \"%)\"\n + System.lineSeparator());\n }\n }\n\n result.append(\"H\u00f6chster Kontostand: \" + highestAcc\n + System.lineSeparator() + \"Niedrigster Kontostand: \"\n + lowestAcc + System.lineSeparator());\n\n result.append(\"Gr\u00f6\u00dfter Gewinn: \" + highestWin\n + System.lineSeparator());\n result.append(\"Gr\u00f6\u00dfter Verlust: \" + highestLoss\n + System.lineSeparator());\n\n result.append(System.lineSeparator());\n }\n return result.toString();\n }\n}","old_contents":"import java.awt.GridLayout;\nimport java.util.Iterator;\n\nimport javax.swing.JPanel;\nimport javax.swing.JTabbedPane;\nimport javax.swing.JTextArea;\n\nimport view.GUI;\nimport view.UIUpdater;\nimport model.db.GameData;\nimport model.SystemValues.Games;\nimport model.SystemValues.Players;\nimport model.SystemValues.WIN;\nimport model.db.DataObject;\n\npublic privileged aspect StatPlayerWiseTxt {\n declare precedence : StatPlayerWiseTxt, StatOverallGraph, StatOverallTxt;\n\n private static GUI gui;\n private static JPanel panel = new JPanel();\n private static JTextArea statText = new JTextArea();\n\n after() returning(GUI gui): call(GUI.new(*)) {\n StatPlayerWiseTxt.gui = gui;\n }\n\n after(JTabbedPane tabbedPane): \n execution(public static void StatisticsHelper.StatisticsPaneCreated(JTabbedPane))\n && args(tabbedPane) {\n statText.setEditable(false);\n panel.setLayout(new GridLayout(0, 1));\n panel.add(statText);\n ((JTabbedPane) tabbedPane).addTab(\"PlayerWiseText\", panel);\n }\n\n after() : execution(* UIUpdater.run()) {\n statText.setText(gui.model.getGameData()\n .getPlayerWiseStatisticsString());\n }\n\n public String GameData.getPlayerWiseStatisticsString() {\n StringBuilder result = new StringBuilder();\n\n for (Players player : Players.values()) {\n result.append(player);\n result.append(\":\" + System.lineSeparator() + System.lineSeparator());\n\n int gamesPlayedTot = 0;\n int gamesWonTot = 0;\n int highestAcc = 0;\n int lowestAcc = 0;\n int highestWin = 0;\n int highestLoss = 0;\n\n int[] gamesPlayedPerType = new int[Games.values().length];\n int[] gamesWonPerType = new int[Games.values().length];\n\n Iterator it = data.iterator();\n DataObject lastObj = it.next();\n\n while (it.hasNext()) {\n DataObject dataObj = it.next();\n\n if (dataObj.getPlayer().equals(player.toString())) {\n gamesPlayedTot++;\n gamesPlayedPerType[dataObj.getGameKind().ordinal()]++;\n if (dataObj.getGameWon() == WIN.PLAYER) {\n gamesWonTot++;\n gamesWonPerType[dataObj.getGameKind().ordinal()]++;\n }\n }\n int gameVal = dataObj.getPlayerVal(player) - lastObj.getPlayerVal(player);\n if (gameVal > highestWin) {\n highestWin = gameVal;\n } else if (gameVal < highestLoss) {\n highestLoss = gameVal;\n }\n\n int accVal = dataObj.getPlayerVal(player);\n System.out.println(player + \": \" + accVal);\n if (accVal > highestAcc) {\n highestAcc = accVal;\n } else if (accVal < lowestAcc) {\n lowestAcc = accVal;\n }\n \n lastObj = dataObj;\n }\n\n double gamesWonPerc = ((gamesPlayedTot + gamesWonTot) > 0 ? (double) gamesWonTot\n \/ gamesPlayedTot\n : 0.0) * 100;\n\n double gamesWonPerTypePerc[] = new double[Games.values().length];\n for (Games game : Games.values()) {\n int i = game.ordinal();\n gamesWonPerTypePerc[i] = ((gamesPlayedPerType[i] + gamesWonPerType[i]) > 0 ? (double) gamesWonPerType[i]\n \/ gamesPlayedPerType[i]\n : 0.0) * 100;\n }\n\n result.append(\n \"Gespielte Spiele:\" + System.lineSeparator() + \"\\t\"\n + \"- Gesamt: \" + gamesPlayedTot)\n .append(\", davon gewonnen: \" + gamesWonTot)\n .append(\" (\" + String.format(\"%.2f\", gamesWonPerc) + \"%)\"\n + System.lineSeparator());\n\n for (Games game : Games.values()) {\n if (game != Games.WEITER) {\n int i = game.ordinal();\n result.append(\n \"\\t- \" + game.toString() + \": \"\n + gamesPlayedPerType[i])\n .append(\", davon gewonnen: \" + gamesWonPerType[i])\n .append(\" (\"\n + String.format(\"%.2f\",\n gamesWonPerTypePerc[i]) + \"%)\"\n + System.lineSeparator());\n }\n }\n\n result.append(\"H\u00f6chster Kontostand: \" + highestAcc\n + System.lineSeparator() + \"Niedrigster Kontostand: \"\n + lowestAcc + System.lineSeparator());\n\n result.append(\"Gr\u00f6\u00dfter Gewinn: \" + highestWin\n + System.lineSeparator());\n result.append(\"Gr\u00f6\u00dfter Verlust: \" + highestLoss\n + System.lineSeparator());\n\n result.append(System.lineSeparator());\n }\n return result.toString();\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"AspectJ"} {"commit":"dc90fdeefccb9401f69157eca47d816e8efac071","subject":"Add the ProcessHelper in the Quart JobDataMap.","message":"Add the ProcessHelper in the Quart JobDataMap.\n","repos":"awltech\/org.parallelj,christophe-w\/parallelj.runtime","old_file":"parallelj-launching\/src\/main\/java\/org\/parallelj\/launching\/quartz\/ProgramJobsAdapter.aj","new_file":"parallelj-launching\/src\/main\/java\/org\/parallelj\/launching\/quartz\/ProgramJobsAdapter.aj","new_contents":"\/*\n * ParallelJ, framework for parallel computing\n *\n * Copyright (C) 2010, 2011, 2012 Atos Worldline or third-party contributors as\n * indicated by the @author tags or express copyright attribution\n * statements applied by the authors.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\/\npackage org.parallelj.launching.quartz;\n\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\nimport org.parallelj.Programs;\nimport org.parallelj.Programs.ProcessHelper;\nimport org.parallelj.internal.kernel.KProgram;\nimport org.parallelj.internal.reflect.ProgramAdapter.Adapter;\nimport org.parallelj.launching.LaunchingMessageKind;\nimport org.parallelj.launching.ProgramReturnCodes;\nimport org.parallelj.launching.internal.LaunchingObservable;\nimport org.parallelj.mirror.ProgramType;\nimport org.quartz.Job;\nimport org.quartz.JobDataMap;\nimport org.quartz.JobExecutionContext;\nimport org.quartz.JobExecutionException;\n\n\/**\n * Implements the Job.execute(..) method\n * \n * \n *\/\nprivileged public aspect ProgramJobsAdapter {\n\n\t\/*\n\t * The Aspect JobsAdapter must be passed before this.\n\t *\/\n\tdeclare precedence :\n\t\torg.parallelj.internal.kernel.Identifiers,\n\t\torg.parallelj.internal.reflect.ProgramAdapter,\n\t\torg.parallelj.internal.util.sm.impl.KStateMachines,\n\t\torg.parallelj.internal.util.sm.impl.KStateMachines.PerMachine,\n\t\torg.parallelj.Executables$PerExecutable,\n\t\torg.parallelj.internal.reflect.ProgramAdapter.PerProgram,\n\t\torg.parallelj.internal.log.Logs,\n\t\torg.parallelj.launching.quartz.JobsAdapter;\n\n\t\/**\n\t * Launch a Program and initialize the Result as a JobDataMap.\n\t * \n\t * @param self\n\t * @param context\n\t * @throws JobExecutionException\n\t *\/\n\tvoid around(Job self, JobExecutionContext context)\n\t\t\tthrows JobExecutionException : \n\t\texecution( public void Job+.execute(..) throws JobExecutionException) \n\t\t\t&& (within(@org.parallelj.Program *) || within(JobsAdapter)) \n\t\t\t\t&& args(context) && this(self) {\n\t\tJobDataMap jobDataMap = context.getJobDetail().getJobDataMap();\n\t\tcontext.setResult(jobDataMap);\n\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.SUCCESS);\n\n\t\tproceed(self, context);\n\n\t\ttry {\n\t\t\t\/\/ Initialize an ExecutorService with the Capacity of the Program\n\t\t\tProcessHelper processHelper = Programs.as((Adapter) self);\n\t\t\tif (processHelper == null) {\n\t\t\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.NOTSTARTED);\n\t\t\t\tthrow new JobExecutionException(LaunchingMessageKind.ELAUNCH0003.getFormatedMessage(self));\n\t\t\t}\n\t\t\tProgramType programType = processHelper.getProcess().getProgram();\n\n\t\t\tLaunchingObservable observable = new LaunchingObservable();\n\t\t\tobservable.prepareLaunching((Adapter) self, processHelper, context);\n\t\t\t\n\t\t\t\/*\n\t\t\t * ExecutorService\n\t\t\t * \n\t\t\t * If an executorService was specified, we use it\n\t\t\t *\/\n\t\t\tExecutorService service = null;\n\t\t\tif (context.getJobDetail().getJobDataMap().get(Launch.DEFAULT_EXECUTOR_KEY) != null) {\n\t\t\t\tservice = (ExecutorService)context.getJobDetail().getJobDataMap().get(Launch.DEFAULT_EXECUTOR_KEY);\n\t\t\t} else \n\t\t\tif (programType instanceof KProgram) {\n\t\t\t\t\/\/ Initialize an ExecutorService with the Program Capacity\n\t\t\t\tshort programCapacity = ((KProgram) programType)\n\t\t\t\t\t\t.getCapacity();\n\t\t\t\tservice = (programCapacity == Short.MAX_VALUE) ? Executors\n\t\t\t\t\t\t.newCachedThreadPool() : Executors\n\t\t\t\t\t\t.newFixedThreadPool(programCapacity);\n\t\t\t} else {\n\t\t\t\tservice = Executors\n\t\t\t\t\t\t.newCachedThreadPool();\n\t\t\t}\n\t\t\t\n\t\t\t\/*\n\t\t\t * Launch the program with the initialized ExecutorService\n\t\t\t *\/\n\t\t\tprocessHelper.execute(service).join();\n\t\t\tjobDataMap.put(QuartzUtils.CONTEXT, processHelper);\n\t\t\t\n\t\t\tobservable.finalizeLaunching((Adapter) self, processHelper, context);\n\t\t\tservice.shutdown();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.FAILURE);\n\t\t\tthrow new JobExecutionException(e);\n\t\t}\n\t}\n\t\n}\n","old_contents":"\/*\n * ParallelJ, framework for parallel computing\n *\n * Copyright (C) 2010, 2011, 2012 Atos Worldline or third-party contributors as\n * indicated by the @author tags or express copyright attribution\n * statements applied by the authors.\n *\n * This library is free software; you can redistribute it and\/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\/\npackage org.parallelj.launching.quartz;\n\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\nimport org.parallelj.Programs;\nimport org.parallelj.Programs.ProcessHelper;\nimport org.parallelj.internal.kernel.KProgram;\nimport org.parallelj.internal.reflect.ProgramAdapter.Adapter;\nimport org.parallelj.launching.LaunchingMessageKind;\nimport org.parallelj.launching.ProgramReturnCodes;\nimport org.parallelj.launching.internal.LaunchingObservable;\nimport org.parallelj.mirror.ProgramType;\nimport org.quartz.Job;\nimport org.quartz.JobDataMap;\nimport org.quartz.JobExecutionContext;\nimport org.quartz.JobExecutionException;\n\n\/**\n * Implements the Job.execute(..) method\n * \n * \n *\/\nprivileged public aspect ProgramJobsAdapter {\n\n\t\/*\n\t * The Aspect JobsAdapter must be passed before this.\n\t *\/\n\tdeclare precedence :\n\t\torg.parallelj.internal.kernel.Identifiers,\n\t\torg.parallelj.internal.reflect.ProgramAdapter,\n\t\torg.parallelj.internal.util.sm.impl.KStateMachines,\n\t\torg.parallelj.internal.util.sm.impl.KStateMachines.PerMachine,\n\t\torg.parallelj.Executables$PerExecutable,\n\t\torg.parallelj.internal.reflect.ProgramAdapter.PerProgram,\n\t\torg.parallelj.internal.log.Logs,\n\t\torg.parallelj.launching.quartz.JobsAdapter;\n\n\t\/**\n\t * Launch a Program and initialize the Result as a JobDataMap.\n\t * \n\t * @param self\n\t * @param context\n\t * @throws JobExecutionException\n\t *\/\n\tvoid around(Job self, JobExecutionContext context)\n\t\t\tthrows JobExecutionException : \n\t\texecution( public void Job+.execute(..) throws JobExecutionException) \n\t\t\t&& (within(@org.parallelj.Program *) || within(JobsAdapter)) \n\t\t\t\t&& args(context) && this(self) {\n\t\tJobDataMap jobDataMap = context.getJobDetail().getJobDataMap();\n\t\tcontext.setResult(jobDataMap);\n\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.SUCCESS);\n\n\t\tproceed(self, context);\n\n\t\ttry {\n\t\t\t\/\/ Initialize an ExecutorService with the Capacity of the Program\n\t\t\tProcessHelper processHelper = Programs.as((Adapter) self);\n\t\t\tif (processHelper == null) {\n\t\t\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.NOTSTARTED);\n\t\t\t\tthrow new JobExecutionException(LaunchingMessageKind.ELAUNCH0003.getFormatedMessage(self));\n\t\t\t}\n\t\t\tProgramType programType = processHelper.getProcess().getProgram();\n\n\t\t\tLaunchingObservable observable = new LaunchingObservable();\n\t\t\tobservable.prepareLaunching((Adapter) self, processHelper, context);\n\t\t\t\n\t\t\t\/*\n\t\t\t * ExecutorService\n\t\t\t * \n\t\t\t * If an executorService was specified, we use it\n\t\t\t *\/\n\t\t\tExecutorService service = null;\n\t\t\tif (context.getJobDetail().getJobDataMap().get(Launch.DEFAULT_EXECUTOR_KEY) != null) {\n\t\t\t\tservice = (ExecutorService)context.getJobDetail().getJobDataMap().get(Launch.DEFAULT_EXECUTOR_KEY);\n\t\t\t} else \n\t\t\tif (programType instanceof KProgram) {\n\t\t\t\t\/\/ Initialize an ExecutorService with the Program Capacity\n\t\t\t\tshort programCapacity = ((KProgram) programType)\n\t\t\t\t\t\t.getCapacity();\n\t\t\t\tservice = (programCapacity == Short.MAX_VALUE) ? Executors\n\t\t\t\t\t\t.newCachedThreadPool() : Executors\n\t\t\t\t\t\t.newFixedThreadPool(programCapacity);\n\t\t\t} else {\n\t\t\t\tservice = Executors\n\t\t\t\t\t\t.newCachedThreadPool();\n\t\t\t}\n\t\t\t\n\t\t\t\/*\n\t\t\t * Launch the program with the initialized ExecutorService\n\t\t\t *\/\n\t\t\tprocessHelper.execute(service).join();\n\t\t\tjobDataMap.put(QuartzUtils.CONTEXT, self);\n\t\t\t\n\t\t\tobservable.finalizeLaunching((Adapter) self, processHelper, context);\n\n\t\t\tservice.shutdown();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tjobDataMap.put(QuartzUtils.RETURN_CODE, ProgramReturnCodes.FAILURE);\n\t\t\tthrow new JobExecutionException(e);\n\t\t}\n\t}\n\t\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"AspectJ"} {"commit":"89552deb7f2764e6ffd75b61f6714bed10f3bfc6","subject":"[Misc] Moved unused code to legacy: added @Deprecated annotation","message":"[Misc] Moved unused code to legacy: added @Deprecated annotation\n","repos":"pbondoer\/xwiki-platform,xwiki\/xwiki-platform,xwiki\/xwiki-platform,pbondoer\/xwiki-platform,xwiki\/xwiki-platform,pbondoer\/xwiki-platform,xwiki\/xwiki-platform,pbondoer\/xwiki-platform,xwiki\/xwiki-platform,pbondoer\/xwiki-platform","old_file":"xwiki-platform-core\/xwiki-platform-legacy\/xwiki-platform-legacy-oldcore\/src\/main\/aspect\/com\/xpn\/xwiki\/XWikiCompatibilityAspect.aj","new_file":"xwiki-platform-core\/xwiki-platform-legacy\/xwiki-platform-legacy-oldcore\/src\/main\/aspect\/com\/xpn\/xwiki\/XWikiCompatibilityAspect.aj","new_contents":"\/*\n * See the NOTICE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and\/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http:\/\/www.fsf.org.\n *\/\npackage com.xpn.xwiki;\n\nimport java.io.UnsupportedEncodingException;\nimport java.io.File;\nimport java.lang.reflect.Type;\nimport java.net.URL;\nimport java.net.URLEncoder;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport org.apache.commons.lang3.StringUtils;\nimport org.xwiki.cache.CacheException;\nimport org.xwiki.cache.CacheFactory;\nimport org.xwiki.cache.CacheManager;\nimport org.xwiki.cache.config.CacheConfiguration;\nimport org.xwiki.cache.eviction.LRUEvictionConfiguration;\nimport org.xwiki.component.manager.ComponentLookupException;\nimport org.xwiki.context.Execution;\nimport org.xwiki.context.ExecutionContext;\nimport org.xwiki.environment.Environment;\nimport org.xwiki.rendering.syntax.Syntax;\nimport org.xwiki.xml.XMLUtils;\nimport org.xwiki.model.reference.EntityReference;\nimport org.xwiki.model.reference.EntityReferenceResolver;\nimport org.xwiki.model.reference.DocumentReference;\nimport org.xwiki.model.reference.EntityReferenceSerializer;\nimport org.xwiki.model.reference.WikiReference;\nimport org.xwiki.model.EntityType;\nimport org.xwiki.url.XWikiEntityURL;\nimport org.apache.velocity.VelocityContext;\n\nimport com.xpn.xwiki.cache.api.XWikiCache;\nimport com.xpn.xwiki.cache.api.XWikiCacheService;\nimport com.xpn.xwiki.cache.api.internal.XWikiCacheServiceStub;\nimport com.xpn.xwiki.cache.api.internal.XWikiCacheStub;\nimport com.xpn.xwiki.doc.XWikiDocument;\nimport com.xpn.xwiki.notify.XWikiNotificationManager;\nimport com.xpn.xwiki.objects.BaseObject;\nimport com.xpn.xwiki.objects.classes.BaseClass;\nimport com.xpn.xwiki.objects.classes.PropertyClass;\nimport com.xpn.xwiki.plugin.query.QueryPlugin;\nimport com.xpn.xwiki.plugin.query.XWikiCriteria;\nimport com.xpn.xwiki.plugin.query.XWikiQuery;\nimport com.xpn.xwiki.util.Util;\nimport com.xpn.xwiki.web.Utils;\nimport com.xpn.xwiki.web.XWikiMessageTool;\nimport com.xpn.xwiki.web.XWikiRequest;\n\n\/**\n * Add a backward compatibility layer to the {@link com.xpn.xwiki.XWiki} class.\n * \n * @version $Id$\n *\/\npublic privileged aspect XWikiCompatibilityAspect\n{\n private static Map XWiki.threadMap = new HashMap();\n\n private XWikiNotificationManager XWiki.notificationManager;\n\n private EntityReferenceResolver XWiki.defaultReferenceEntityReferenceResolver = Utils.getComponent(\n EntityReferenceResolver.TYPE_REFERENCE);\n\n private EntityReferenceSerializer XWiki.localStringEntityReferenceSerializer = Utils.getComponent(\n EntityReferenceSerializer.TYPE_STRING, \"local\");\n\n \n \/**\n * Used to get the temporary and permanent directory.\n *\/\n private Environment XWiki.environment = Utils.getComponent((Type) Environment.class);\n\n \/** Is the wiki running in test mode? Deprecated, was used when running Cactus tests. *\/\n private boolean XWiki.test = false;\n\n \/**\n * Transform a text in a URL compatible text\n *\n * @param content text to transform\n * @return encoded result\n * @deprecated replaced by Util#encodeURI since 1.3M2\n *\/\n @Deprecated\n public String XWiki.getURLEncoded(String content)\n {\n try {\n return URLEncoder.encode(content, this.getEncoding());\n } catch (UnsupportedEncodingException e) {\n return content;\n }\n }\n\n \/**\n * @return true for multi-wiki\/false for mono-wiki\n * @deprecated replaced by {@link XWiki#isVirtualMode()} since 1.4M1.\n *\/\n @Deprecated\n public boolean XWiki.isVirtual()\n {\n return isVirtualMode();\n }\n\n \/**\n * @deprecated Virtual mode is on by default, starting with XWiki 5.0M2. Use\n * {@link #getVirtualWikisDatabaseNames(XWikiContext)} to get the list of wikis if needed.\n * @return true for multi-wiki\/false for mono-wiki\n *\/\n @Deprecated\n public boolean XWiki.isVirtualMode()\n {\n return true;\n }\n\n \/**\n * @deprecated Removed since it isn't used; since 1.5M1.\n *\/\n @Deprecated\n public static Map XWiki.getThreadMap()\n {\n return XWiki.threadMap;\n }\n\n \/**\n * @deprecated Removed since it isn't used; since 1.5M1.\n *\/\n @Deprecated\n public static void XWiki.setThreadMap(Map threadMap)\n {\n XWiki.threadMap = threadMap;\n }\n\n \/**\n * @return the cache service.\n * @deprecated replaced by {@link XWiki#getCacheFactory(XWikiContext)} or\n * {@link XWiki#getLocalCacheFactory(XWikiContext)} since 1.5M2.\n *\/\n @Deprecated\n public XWikiCacheService XWiki.getCacheService()\n {\n return new XWikiCacheServiceStub(getCacheFactory(), getLocalCacheFactory());\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getVirtualWikiCache(XWikiContext)} since 1.5M2.\n *\/\n @Deprecated\n public XWikiCache XWiki.getVirtualWikiMap()\n {\n return new XWikiCacheStub(this.virtualWikiMap);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpaceCopyright(XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public String XWiki.getWebCopyright(XWikiContext context)\n {\n return this.getSpaceCopyright(context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreference(String, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public String XWiki.getWebPreference(String preference, XWikiContext context)\n {\n return this.getSpacePreference(preference, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreference(String, String, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public String XWiki.getWebPreference(String preference, String defaultValue, XWikiContext context)\n {\n return this.getSpacePreference(preference, defaultValue, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreference(String, String, String, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public String XWiki.getWebPreference(String preference, String space, String defaultValue, XWikiContext context)\n {\n return this.getSpacePreference(preference, space, defaultValue, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreferenceAsLong(String, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public long XWiki.getWebPreferenceAsLong(String preference, XWikiContext context)\n {\n return this.getSpacePreferenceAsLong(preference, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreferenceAsLong(String, long, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public long XWiki.getWebPreferenceAsLong(String preference, long defaultValue, XWikiContext context)\n {\n return this.getSpacePreferenceAsLong(preference, defaultValue, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreferenceAsInt(String, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public int XWiki.getWebPreferenceAsInt(String preference, XWikiContext context)\n {\n return this.getSpacePreferenceAsInt(preference, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getSpacePreferenceAsInt(String, int, XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public int XWiki.getWebPreferenceAsInt(String preference, int defaultValue, XWikiContext context)\n {\n return this.getSpacePreferenceAsInt(preference, defaultValue, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#copySpaceBetweenWikis(String, String, String, String, XWikiContext)} since\n * 2.3M1\n *\/\n @Deprecated\n public int XWiki.copyWikiWeb(String space, String sourceWiki, String targetWiki, String language, XWikiContext context)\n throws XWikiException\n {\n return this.copySpaceBetweenWikis(space, sourceWiki, targetWiki, language, context);\n }\n\n \/**\n * @deprecated replaced by\n * {@link XWiki#copySpaceBetweenWikis(String, String, String, String, boolean, XWikiContext)} since\n * 2.3M1\n *\/\n @Deprecated\n public int XWiki.copyWikiWeb(String space, String sourceWiki, String targetWiki, String language, boolean clean,\n XWikiContext context) throws XWikiException\n {\n return this.copySpaceBetweenWikis(space, sourceWiki, targetWiki, language, clean, context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#getDefaultSpace(XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public String XWiki.getDefaultWeb(XWikiContext context)\n {\n return this.getDefaultSpace(context);\n }\n\n \/**\n * @deprecated replaced by {@link XWiki#skipDefaultSpaceInURLs(XWikiContext)} since 2.3M1\n *\/\n @Deprecated\n public boolean XWiki.useDefaultWeb(XWikiContext context)\n {\n return this.skipDefaultSpaceInURLs(context);\n }\n\n \/**\n * @deprecated use {@link XWikiMessageTool#get(String, List)} instead. You can access message tool using\n * {@link XWikiContext#getMessageTool()}.\n *\/\n @Deprecated\n public String XWiki.getMessage(String item, XWikiContext context)\n {\n XWikiMessageTool msg = context.getMessageTool();\n if (msg == null) {\n return item;\n } else {\n return msg.get(item);\n }\n }\n\n \/**\n * @deprecated Removed since it isn't used; since 3.1M2.\n *\/\n @Deprecated\n public String XWiki.getHTMLArea(String content, XWikiContext context)\n {\n StringBuilder result = new StringBuilder();\n\n String scontent = XMLUtils.escape(content);\n scontent = scontent.replaceAll(\"\\r?+\\n\", \"
\");\n\n result.append(\"