commit 81958fbe30a6f9f71dd6f00708d2c874d4d1f96c Author: Eric Yu Date: Fri Jan 5 18:49:00 2024 -0800 init files diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c770e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# eclipse +bin +*.launch +.settings +.metadata +.classpath +.project + +# idea +out +*.ipr +*.iws +*.iml +.idea + +# gradle +build +.gradle + +# other +eclipse +run diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c5f3f6b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/CREDITS-fml.txt b/CREDITS-fml.txt new file mode 100644 index 0000000..97122f5 --- /dev/null +++ b/CREDITS-fml.txt @@ -0,0 +1,28 @@ +This is Forge Mod Loader. + +You can find the source code at all times at https://github.com/MinecraftForge/FML + +This minecraft mod is a clean open source implementation of a mod loader for minecraft servers +and minecraft clients. + +The code is authored by cpw. + +It began by partially implementing an API defined by the client side ModLoader, authored by Risugami. +http://www.minecraftforum.net/topic/75440- +This support has been dropped as of Minecraft release 1.7, as Risugami no longer maintains ModLoader. + +It also contains suggestions and hints and generous helpings of code from LexManos, author of MinecraftForge. +http://www.minecraftforge.net/ + +Additionally, it contains an implementation of topological sort based on that +published at http://keithschwarz.com/interesting/code/?dir=topological-sort + +It also contains code from the Maven project for performing versioned dependency +resolution. http://maven.apache.org/ + +It also contains a partial repackaging of the javaxdelta library from http://sourceforge.net/projects/javaxdelta/ +with credit to it's authors. + +Forge Mod Loader downloads components from the Minecraft Coder Pack +(http://mcp.ocean-labs.de/index.php/Main_Page) with kind permission from the MCP team. + diff --git a/LICENSE-new.txt b/LICENSE-new.txt new file mode 100644 index 0000000..be2c9e6 --- /dev/null +++ b/LICENSE-new.txt @@ -0,0 +1,483 @@ +Minecraft Forge is licensed under the terms of the LGPL 2.1 found +here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and copied +below. + +A note on authorship: +All source artifacts are property of their original author, with +the exclusion of the contents of the patches directory and others +copied from it from time to time. Authorship of the contents of +the patches directory is retained by the Minecraft Forge project. +This is because the patches are partially machine generated +artifacts, and are changed heavily due to the way forge works. +Individual attribution within them is impossible. + +Consent: +All contributions to Forge must consent to the release of any +patch content to the Forge project. + +A note on infectivity: +The LGPL is chosen specifically so that projects may depend on Forge +features without being infected with its license. That is the +purpose of the LGPL. Mods and others using this code via ordinary +Java mechanics for referencing libraries are specifically not bound +by Forge's license for the Mod code. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/MinecraftForge-Credits.txt b/MinecraftForge-Credits.txt new file mode 100644 index 0000000..d0de5a5 --- /dev/null +++ b/MinecraftForge-Credits.txt @@ -0,0 +1,26 @@ +* Eloraam * + +* FlowerChild * + +* Hawkye * + +* MALfunction84 * + +Submitted the sleep handler code for his mod (Somnia) and others to use. + +* Scokeev9 * + +Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it. + +ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed. + +* SpaceToad * + +* LexManos * + +* cpw * + +* Minecraft Coder Pack (MCP) * +Forge Mod Loader and Minecraft Forge have permission to distribute and automatically download components of MCP and distribute MCP data files. +This permission is not transitive and others wishing to redistribute the Minecraft Forge source independently should seek permission of MCP or +remove the MCP data files and request their users to download MCP separately. diff --git a/Paulscode IBXM Library License.txt b/Paulscode IBXM Library License.txt new file mode 100644 index 0000000..d4884b0 --- /dev/null +++ b/Paulscode IBXM Library License.txt @@ -0,0 +1,10 @@ +IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/Paulscode SoundSystem CodecIBXM License.txt b/Paulscode SoundSystem CodecIBXM License.txt new file mode 100644 index 0000000..a68a494 --- /dev/null +++ b/Paulscode SoundSystem CodecIBXM License.txt @@ -0,0 +1,40 @@ +SoundSystem CodecIBXM Class License: + +You are free to use this class for any purpose, commercial or otherwise. +You may modify this class or source code, and distribute it any way you +like, provided the following conditions are met: + +1) You may not falsely claim to be the author of this class or any + unmodified portion of it. +2) You may not copyright this class or a modified version of it and then + sue me for copyright infringement. +3) If you modify the source code, you must clearly document the changes + made before redistributing the modified source code, so other users know + it is not the original code. +4) You are not required to give me credit for this class in any derived + work, but if you do, you must also mention my website: + http://www.paulscode.com +5) I the author will not be responsible for any damages (physical, + financial, or otherwise) caused by the use if this class or any + portion of it. +6) I the author do not guarantee, warrant, or make any representations, + either expressed or implied, regarding the use of this class or any + portion of it. + +Author: Paul Lamb +http://www.paulscode.com + + +This software is based on or using the IBXM library available from +http://www.geocities.com/sunet2000/ + + +IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD License. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of mumart nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..b45931f --- /dev/null +++ b/README.txt @@ -0,0 +1,59 @@ +------------------------------------------- +Source installation information for modders +------------------------------------------- +This code follows the Minecraft Forge installation methodology. It will apply +some small patches to the vanilla MCP source code, giving you and it access +to some of the data and functions you need to build a successful mod. + +Note also that the patches are built against "unrenamed" MCP source code (aka +srgnames) - this means that you will not be able to read them directly against +normal code. + +Source pack installation information: + +Standalone source installation +============================== + +Step 1: Open your command-line and browse to the folder where you extracted the zip file. + +Step 2: Once you have a command window up in the folder that the downloaded material was placed, type: + +Windows: "gradlew setupDecompWorkspace" +Linux/Mac OS: "./gradlew setupDecompWorkspace" + +Step 3: After all that finished, you're left with a choice. +For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux) + +If you preffer to use IntelliJ, steps are a little different. +1. Open IDEA, and import project. +2. Select your build.gradle file and have it import. +3. Once it's finished you must close IntelliJ and run the following command: + +"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux) + +Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project) + +If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not effect your code} and then start the processs again. + +Should it still not work, +Refer to #ForgeGradle on EsperNet for more information about the gradle environment. + +Tip: +If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following: +"setupDevWorkspace": Will patch, deobfusicated, and gather required assets to run minecraft, but will not generated human readable source code. +"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work. + +Tip: +When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE. + +Forge source installation +========================= +MinecraftForge ships with this code and installs it as part of the forge +installation process, no further action is required on your part. + +LexManos' Install Video +======================= +https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be + +For more details update more often refer to the Forge Forums: +http://www.minecraftforge.net/forum/index.php/topic,14048.0.html diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..9c94f53 --- /dev/null +++ b/build.gradle @@ -0,0 +1,89 @@ +buildscript { + repositories { + jcenter() + maven { url = "http://files.minecraftforge.net/maven" } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. +compileJava {options.encoding = "UTF-8"} +compileTestJava {options.encoding = "UTF-8"} + +version = "1.0" +group= "minecrafthdl" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "MinecraftHDL" + +sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = "1.8" +} + +minecraft { + version = "1.10.2-12.18.3.2511" + runDir = "run" + + // the mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD snapshot are built nightly. + // stable_# stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not allways work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20161111" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +dependencies { + // you may put jars on which you depend on in ./libs + // or you may define them like so.. + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" + + // real examples + //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, + // except that these dependencies get remapped to your current MCP mappings + //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' + //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // for more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +runClient { +// args("--username", "yuhc218@gmail.com", "--password", ":Ey692018") //, "--assetsDir", "C:/Users/yuhc2/AppData/Roaming/.minecraft/assets" + jvmArgs("-Dlog4j2.formatMsgNoLookups=true") +} + +runServer { + args("-nogui") + jvmArgs("-Dlog4j2.formatMsgNoLookups=true") +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/build.txt b/build.txt new file mode 100644 index 0000000..957bcbc --- /dev/null +++ b/build.txt @@ -0,0 +1,88 @@ +buildscript { + repositories { + jcenter() + maven { url = "http://files.minecraftforge.net/maven" } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. +compileJava {options.encoding = "UTF-8"} +compileTestJava {options.encoding = "UTF-8"} + +version = "1.0" +group= "minecrafthdl" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "modid" + +sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = "1.6" +} + +minecraft { + version = "1.10.2-12.18.3.2511" + runDir = "run" + + // the mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD snapshot are built nightly. + // stable_# stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not allways work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20161111" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +dependencies { + // you may put jars on which you depend on in ./libs + // or you may define them like so.. + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" + + // real examples + //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, + // except that these dependencies get remapped to your current MCP mappings + //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' + //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // for more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +runClient { + args("--username", "yuhc218@gmail.com", "--password", ":Ey692018", "--assetsDir", "C:/Users/yuhc2/AppData/Roaming/.minecraft/assets") + jvmArgs("-Dlog4j2.formatMsgNoLookups=true") +} + +runServer { + args("-nogui") +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/forge-1.10.2-12.18.3.2511-changelog.txt b/forge-1.10.2-12.18.3.2511-changelog.txt new file mode 100644 index 0000000..085d3e4 --- /dev/null +++ b/forge-1.10.2-12.18.3.2511-changelog.txt @@ -0,0 +1,13033 @@ +Changelog: +Build 2511: + mezz: Fix performance regression in FastTESR rendering + +Build 1.11.2-13.20.1.2510: + mezz: Fix performance regression in FastTESR rendering + +Build 1.12.2-14.23.0.2509: + mezz: Fix performance regression in FastTESR rendering + +Build 1.12.2-14.23.0.2508: + mezz: Fix outdated VersionParser javadoc link + +Build 1.11.2-13.20.1.2507: + PProvenzano: + Clean up Block.getLightValue(IBlockState, IBlockAccess, BlockPos) + (#4202) + +Build 1.11.2-13.20.1.2506: + p3pp3rf1y: Change to allow items to interact with villagers (#4194) + +Build 1.11.2-13.20.1.2505: + bs2609: + Add a hook to allow world providers to change the lightmap colours. + (#3922) + +Build 1.11.2-13.20.1.2504: + rasheeqhere: Add smarter getter for block slipperiness (#3620) + +Build 1.12.2-14.23.0.2503: + mezz: Add configuration for probot-stale for github + +Build 1.12.2-14.23.0.2502: + mezz: Update mcp mappings to 20171003 + +Build 1.12.2-14.23.0.2501: + mezz: [1.12] Add support for client & server dependencies for mods (#4403) + +Build 1.12.2-14.23.0.2500: + mezz: Add Item.getModId to show which mod is associated with a subitem (#4330) + +Build 1.12.2-14.23.0.2499: + erlend: Add Chunk capabilities (#4228) + +Build 1.12.2-14.23.0.2498: + python0429: Add hook to configure EntityEquipmentSlot for item. + bs2609: Fix block and torch placement logic not matching vanilla (#4210) + bs2609: Fix being unable to see with night vision under some conditions (#4383) + tterrag1098: Allow item models to use formats other than ITEM (#4273) + erlend: [1.12] Check both hands for sneak interaction bypass (#4256) + bs2609: Reduce the number of quads generated by ItemLayerModel (#4332) + bs2609: + Improve performance of vertex format mapping by caching hashcodes + (#4370) + bs2609: Fix some chunk data packets being created unnecessarily (#4414) + +Build 1.12.2-14.23.0.2497: + bs2609: Store entity data for dormant chunks using NBT (#4162) + +Build 1.12.2-14.23.0.2496: + williewillus: + Allow for MapDecoration to use alternate rendering, for example a custom + spritesheet (#4027) + +Build 1.12.2-14.23.0.2495: + LexManos: + Remove limitation of Shaped crafting recipes not being used on grids + larger than 3x3 + +Build 1.12.2-14.23.0.2494: + josephcsible: + Fix not being able to write in a blank, renamed Book and Quill (#4433) + https://bugs.mojang.com/browse/MC-1685 + +Build 1.12.2-14.23.0.2492: + LexManos: + Add new /forge entity list command for displaying a list of all entities + in world. As well as tracking down chunks with large amounts of + entities. + +Build 1.12.2-14.23.0.2491: + kashike: Prevent a mutable BlockPos leak in World#setBlockState (#4388) + flashfireex: Fix test mod shield JSON incorrect bottom face UV's (#4295) + +Build 1.12.2-14.23.0.2490: + ichttt: + Fix IngredientNBT comparing stackSize when checking if ingredient is + valid (#4418) + +Build 1.12.2-14.23.0.2489: + kashike: + Auto-detect registry namespace when using a legacy string id in + EntityEntryBuilder fixes #4410 (#4411) + +Build 1.10.2-12.18.3.2488: + LexManos: Fix max CustomPayload size, 1MB not 16MB. + Barteks2x: Fix splitting big packets skipping one byte per additional part (#4302) + Barteks2x: Fix netty warning spam when sending >1MB packets (#4363) + +Build 1.12.2-14.23.0.2487: + kashike: + Introduce entity entry builder, useful in the Register + event replacing needed calls to EntityRegistry. (#4408) + +Build 1.12.2-14.23.0.2486: + LexManos: MC 1.12.2 update. + +Build 1.12.1-14.22.1.2485: + paul.fulham0: Fix lightmap calculation vertex clamping (#4387) + +Build 1.12.1-14.22.1.2484: + Tyler Hancock: Fix chunk gen mobs not firing the CheckSpawn event. Closes #4394 (#4396) + +Build 1.12.1-14.22.1.2483: + thiakil: Add an extra error check for OBJ model materials (#4402) + +Build 1.12.1-14.22.1.2482: + bs2609: Fix up test mods (#4399) + +Build 1.12.1-14.22.1.2481: + LexManos: + Add new /forge gen command to generate large amounts of chunks. Usage: + /forge gen [dimension] [notifications] Position is in + Block Coords, and can be relative to the player. These will be converted + to chunk coords for you. Count is the number of chunks to load. This is + not a radius, actual total number of chunks. Dimension is optional, you + can use this to pregen other worlds. Notifications is the chunk interval + to inform you of the generating progress. This is optional and will be + 5% or 100 whichever is higher. + Added new config option to modify vanilla world gen to fix various + cascading issues. MC-117810 MC-114332 and more. This WILL change block + placement from vanilla world gen. So this is a opt-in value. Do not + report differences in worlds with this flag enabled. + +Build 1.12.1-14.22.1.2480: + LexManos: Fixed ShapedOre recipes not laying out correctly with the guidebook. + +Build 1.12.1-14.22.1.2479: + Tyler Hancock: Fixed search tabs using wrong contents. (#4393) + +Build 1.12.1-14.22.1.2478: + LexManos: Bump version for RB. + +Build 1.10.2-12.18.3.2477: + mezz: Fix MC-117075 lag spike when unloading many tile entities + +Build 1.11.2-13.20.1.2476: + mezz: Fix MC-117075 lag spike when unloading many tile entities + +Build 1.12.1-14.22.0.2475: + mezz: Fix #4386 Race condition when unloading chunks causes dead tile entities + +Build 1.12.1-14.22.0.2474: + bs2609: Improve generation of normals for vanilla models (#4313) + bs2609: Patch block model renderer to use location-aware light value (#4303) + +Build 1.12.1-14.22.0.2473: + bk1325: + Fix CustomModLoadingErrorDisplayScreen not being handled during init or + preinit. (#4320) + bs2609: Fix light sources rendering wrongly with night vision (MC-58177) (#4365) + marvinroesch99: Fire RenderGameOverlayEvent for vignette (#4360) + +Build 1.12.1-14.22.0.2472: + bs2609: Add missing bounds checks to ItemTextureQuadConverter (#4343) + dualspiral: Insert FML handler before Vanilla connection handshake completes (#4380) + +Build 1.12.1-14.22.0.2471: + williewillus: Fix vanilla map pixel data being used in various places (#4068) + bs2609: Adjust float (un)packing functions to be slightly more accurate (#4316) + marvinroesch99: + Add support instructions to be displayed when creating an issue on + Github (#4323) + blay09: + Allow custom GuiEditArrayEntries without having to recreate the object + in several places (#4329) + +Build 1.12.1-14.22.0.2470: + bs2609: + [1.12] Remove patches adding chunkExists() function, switch to vanilla + code (#4054) + +Build 1.12.1-14.22.0.2469: + Tyler Hancock: Added missing MapGen types to the InitMapGenEvent (#4322) + +Build 1.12.1-14.22.0.2468: + josephcsible: + Fix nether wart, pumpkins, and melons passing the new state as the + original state to CropGrowEvent.Post (#4377) + +Build 1.12.1-14.22.0.2467: + Choonster.2010: Fix FieldWrapper.MapWrapper initialising wrong category (#4335) + +Build 1.12.1-14.22.0.2466: + Choonster.2010: + Don't parse category names as regular expressions in + FieldWrapper.MapWrapper (#4334) + +Build 1.12.1-14.22.0.2465: + LexManos: Fix issue saving observers using different metadata then vanilla. + +Build 1.12.1-14.22.0.2464: + Barteks2x: Fix netty warning spam when sending >1MB packets (#4363) + +Build 1.12.1-14.22.0.2463: + Barteks2x: Fix FML handshake crash, fixes #4285 and #3974 (#4304) + +Build 1.12.1-14.22.0.2462: + LexManos: Fix recipe book auto-fill not working for OreDictionary ingredients. + +Build 1.12.1-14.22.0.2461: + molecularphylo: Fix KeyBindings reset buttons being inverted. + +Build 1.12.1-14.22.0.2460: + LexManos: + Fix for dummied server side registry entries while client has read + entries. + +Build 1.12.1-14.22.0.2459: + marvinroesch99: Tabulate crash report mod list and add signature information (#4251) + +Build 1.12.1-14.22.0.2458: + nedelosk: [1.12] Fix wood plank ore dictionary recipes (#4310) + +Build 1.12.1-14.22.0.2457: + codewarrior: + Fix UnknownFormatConversionException during erroring TE/Entity removal + (#4312) + +Build 1.12.1-14.22.0.2456: + LexManos: + Add support for server side only recipes, as well as detection of + vanilla client recipe book filter to prevent errors. + +Build 1.12.1-14.22.0.2455: + mezz: Fix typo in CapabiltyFluidHandler (#4306) + +Build 1.11.2-13.20.1.2454: + Barteks2x: Fix splitting big packets skipping one byte per additional part (#4302) + +Build 1.12.1-14.22.0.2453: + Barteks2x: Fix splitting big packets skipping one byte per additional part (#4301) + +Build 1.12.1-14.22.0.2452: + LexManos: Filter out scala libraries in forge dev workspace. + tterrag1098: Better descriptions on dependency version range error screen (#4284) + mezz: Fix MC-117075 lag spike when unloading many tile entities (#4281) + bs2609: + Add a hook to allow world providers to change the lightmap colours + (#4279) + Choonster.2010: + Continue loading mod recipes and advancements after encountering an + error (#4277) + bartek.bok: Fix invalid FastTESR quad ordering (#4267) + knightminer4: + Add support for running IModel.retexture() on models from blockstates + (#4200) + python0429: + Add support for oredict item predicates in advancements, and add a + registry for item predicates (#4188) + flashfireex: Add Ability to Override PotionEffect Default Sort Order (#4172) + ohai.iChun: Add PlayerSPPushOutOfBlocksEvent. (#4091) + LexManos: Fix tests + +Build 1.12.1-14.22.0.2447: + LexManos: + Cleanup some output and move the Jar-In-Jar extractor to before any + coremods/mods are loaded so. The intention is to rework this entire + thing to use maven style storage, IF we can get Mojang to pass in the + Libraries folder. + LexManos: Fixed missing line in logger. + LexManos: Fix odd NPE with list files for empty directories. + LexManos: Fix IOUtils import error caused by server/client libraries desync. + +Build 1.12.1-14.22.0.2446: + cpw: + Lex doesn't like this. + Revert "Fix up MC version compatibility checking to be a little less + verbose." + This reverts commit 1927fd76e20a1b3075cb841b09c2caeb57ebd242. + +Build 1.12.1-14.22.0.2445: + cpw: + Fix up MC version compatibility checking to be a little less verbose. If + people use properly formatted version compatibility strings, or the + default compiled in one, this will work exactly as before, but has less + dependence on specific formats for the mcversion string. So a mod + declaring [1.11, 1.12] will now be 1.12.1 compatible by default, for + example. + +Build 1.12.1-14.22.0.2444: + LexManos: + 1.12.1 Update, Not much modder facing changes, 1.12 mods should load and + run fine on this version. + +Build 1.12-14.21.1.2443: + rasheeqhere: + Add smarter getter for block slipperiness (#4116) + Fixed MC-119811, Boats rubber banding when dismounted. + +Build 1.12-14.21.1.2442: + Laughlan Coventry: Add GuiContainer Foreground render event. (#4127) + +Build 1.12-14.21.1.2441: + bs2609: + Use ClassValue to store tileentity names for profiler in lazy cache. + (#4021) + +Build 1.12-14.21.1.2440: + ichttt: Move client-only config options to client config (#4084) + +Build 1.12-14.21.1.2439: + goto.minecraft: + Added CriticalHitEvent to allow more control over whether a attack is a + critical or not, and what damage it does. + +Build 1.12-14.21.1.2438: + bartek.bok: + Fix stacked entity item rendering using the wrong transform for the + extra items. (#4158) + +Build 1.12-14.21.1.2437: + bk1325: Fix lopsided 'V' in FML icons. (#4179) + +Build 1.12-14.21.1.2436: + diesieben07: + Fixed bug where config categories errored if they contained regex + special characters. (#4187) + diesieben07: + Ignore neighbor changes for comparators on the client (Vanilla behavior) + (#4186) + xalcon: + Added pages to the advancements GUI to allow for unlimited root + advancements. (#4183) + +Build 1.12-14.21.1.2435: + InfinityRaider: Make LivingEntityUseItemEvent not abstract (#4208) + PProvenzano: + Clean up Block.getLightValue(IBlockState, IBlockAccess, BlockPos) + (#4203) + p3pp3rf1y: Allow sneaking to bypass villager interaction GUI. (#4193) + +Build 1.12-14.21.1.2434: + bs2609: + Replace hardcoded block check with isTopSolid method call for placing + button/lever (#4212) + +Build 1.12-14.21.1.2433: + python0429: + Added support for oredict dyes to Fireworks, Armors, and Shulker + recipes. (#4223) + +Build 1.12-14.21.1.2432: + p3pp3rf1y: Limit some server to client update packets for Item Capabilities (#4252) + +Build 1.12-14.21.1.2431: + williewillus: Fixed Armor bar disappear after changing dimension. MC-88179 (#4265) + +Build 1.12-14.21.1.2430: + mezz: Fix the firing location of InputEvent.MouseInputEvent (#4270) + +Build 1.11.2-13.20.1.2429: + mezz: + Allow the server to handle item-block interaction if onItemUse does not + return PASS (#3951) + +Build 1.12-14.21.1.2428: + bs2609: Fix some broken test mods (#4245) + +Build 1.12-14.21.1.2427: + rslink: Fixed swapping of finite fluids with negative densities. (#4237) + +Build 1.12-14.21.1.2426: + marvinroesch99: Fix overrides not being read from the server registry snapshot (#4224) + +Build 1.11.2-13.20.1.2425: + diesieben07: Ignore fortune for anything but seeds in crops (#3959) + +Build 1.12-14.21.1.2424: + marvinroesch99: Fix some test mods crashing server caused by model loading (#4225) + +Build 1.12-14.21.1.2423: + diesieben07: Fix FML handshake race condition, fixes #4219 (#4220) + +Build 1.10.2-12.18.3.2422: + mezz: Prevent player from dying infinitely due to zero max health (MC-119183) + +Build 1.11.2-13.20.1.2421: + mezz: Prevent player from dying infinitely due to zero max health (MC-119183) + +Build 1.12-14.21.1.2420: + mezz: Prevent player from dying infinitely due to zero max health (MC-119183) + +Build 1.12-14.21.1.2419: + malte0811: + [1.12] Allow the server to handle item-block interaction if onItemUse + doesn not return PASS (#3967) + +Build 1.12-14.21.1.2418: + Madsthunder: Allow support for custom Shields and Shield disabling weapons. + +Build 1.12-14.21.1.2417: + diesieben07: Ignore fortune for anything but seeds in crops (#4160) + ichttt: Log a warning if a coremod does not follow best practices (#4146) + python0429: Make Optional.Interface repeatable (#4138) + +Build 1.12-14.21.1.2416: + xalcon: Added support for vanilla "nbt strings" in json recipes (#4113) + +Build 1.12-14.21.1.2415: + LexManos: + Fix tripwire statemap not being complete when mappings change. Closes + #3924 + +Build 1.11.2-13.20.1.2414: + mezz: Fix unblockable damage being blocked by armor. (#3933) + +Build 1.12-14.21.1.2413: + LexManos: + Fixed invalid erroring case during loading Advancements form mods that + don't have advancements. + +Build 1.12-14.21.1.2412: + LexManos: + Fixed issue where rendered held items wouldn't properly update when the + reequip animations isnt shown. Closes #4175 + +Build 1.12-14.21.1.2411: + LexManos: Fire recipe registry event after json recipes are loaded. + LexManos: + Send remap event when data is frozen to notify modders to bake things. + Fixes search not working when connecting to vanilla servers. + +Build 1.12-14.21.1.2410: + bs2609: + Clean up uses of deprecated library functions (#4130) + Avoid catching and rethrowing runtime exceptions + to exceptions instead of the log + +Build 1.12-14.21.1.2409: + bs2609: Remove unneeded block patches (#4167) + +Build 1.12-14.21.1.2408: + mezz: Improve javadocs for Mod dependencies (#4168) + +Build 1.12-14.21.1.2407: + mezz: Fix errors in test mods + mezz: Add basic Github issue template + mezz: Stop "Binary patch set is missing" error log in dev environment + +Build 1.12-14.21.1.2406: + CrafterKina: Remove unnecessary maxStackSize restrictions on brewing potions. (#4155) + +Build 1.12-14.21.1.2405: + mezz: + Fix game freeze when resizing the window too small on the mods gui + (#4148) + +Build 1.12-14.21.1.2404: + williewillus: Allow advancement icons to have nbt (#4114) + maxanier: Adjust EnumHelper#addCreatureType to EnumType (#4089) + +Build 1.12-14.21.1.2403: + LexManos: + Fix MC-68754, Screen is not resizeable after exiting fullscreen due to + LWJGL bug + LexManos: + Attempt fix, or at least better debugging for RecipeBook accessing + unknown recipes. + +Build 1.12-14.21.1.2402: + mezz: Use Item's custom FontRenderer for tooltips in the Creative Gui (#4101) + +Build 1.12-14.21.1.2401: + mezz: Fix Recipe Toast crash when granted more than 5000 recipes (#4124) + +Build 1.12-14.21.1.2400: + mezz: + Throw packet encoding exceptions instead of suppressing them, to prevent + corrupt packets (#4144) + +Build 1.12-14.21.1.2399: + LexManos: Quiet down warning for missing translation files. + +Build 1.12-14.21.1.2398: + LexManos: Update JOpt version on the dedicated server to match client. + +Build 1.12-14.21.1.2397: + LexManos: Fix log spam when creating dummy blocks. + LexManos: Fix override duplication caused by bad comparison. + LexManos: Fix getting missing models for overridden Item registry entires + +Build 1.12-14.21.1.2396: + mezz: + Include location of the call when a mod uses System.out or System.err + (Fix #4135) + +Build 1.12-14.21.1.2394: + xalcon: Add isSpawner parameter to the CheckSpawn event (#4075) + mezz: Improve furnace fuel handling (#4083) + jmtalandar: Fix unblockable damage being blocked by armor. (#3933) (#4106) + +Build 1.11.2-13.20.1.2393: + ericmyllyoja: RenderLivingEvent now stores partialTick (#3822) + +Build 1.12-14.21.1.2392: + ericmyllyoja: + RenderLivingEvent now stores partialTick + 2 + +Build 1.11.2-13.20.1.2391: + mincrmatt12: Add rotation origin variable for animated models (#3875) + +Build 1.12-14.21.1.2390: + ichttt: Fix missing messages of missing models (#4120) + +Build 1.12-14.21.1.2389: + CrafterKina: Correct the default resource location of potion registry (#4117) + +Build 1.11.2-13.20.1.2388: + LexManos: + Add @ObjectHolder scanning to vanilla MobEffects, Biomes, Enchantments, + SoundEvents, and PotionTypes constants. Closes #4104 + LexManos: + Optimize ExtendedBlockState.getClean, cache the return value instead of + calculating it. Closes #3936 + LexManos: Fix BiomeDictionary not collecting correctly. + +Build 1.12-14.21.1.2387: + LexManos: Version bump for RB + +Build 1.11.2-13.20.1.2386: + LexManos: Version Bump for RB + +Build 1.12-14.21.0.2385: + Laughlan Coventry: + Added Block::getFogColor to allow custom blocks to control fog colors + while inside them. (#4090) + +Build 1.12-14.21.0.2384: + LexManos: + Optimize ExtendedBlockState.getClean, cache the return value instead of + calculating it. Closes #3936 + +Build 1.12-14.21.0.2383: + LexManos: + Add @ObjectHolder scanning to vanilla MobEffects, Biomes, Enchantments, + SoundEvents, and PotionTypes constants. Closes #4104 + LexManos: Squelch spam in EventBus register, Closes #4102 + +Build 1.12-14.21.0.2382: + mezz: Use lambdas for short anonymous methods + mezz: Use java 8 collection functions + +Build 1.12-14.21.0.2381: + mezz: + Use multiple catch, try-with-resources, replace system.out and + e.printStackTrace + +Build 1.12-14.21.0.2380: + LexManos: Fix the creative menu search function. Closes #4100 + +Build 1.12-14.21.0.2379: + LexManos: Fix MissingMapping REMAP action. Closes #4069 + +Build 1.12-14.21.0.2378: + LexManos: Fix Biome unit test + LexManos: + Repopulate client SearchTreeManager when registries are refreshed. + Closes #4094 + +Build 1.12-14.21.0.2377: + LexManos: Allow the recipe registry to be modified. + LexManos: Fix error when using RegistryBuilder and not specifying a max id number. + LexManos: Add support for loading mod advancements from the mod jar files. + +Build 1.12-14.21.0.2376: + LexManos: Fix BiomeDictionary not collecting correctly. + +Build 1.12-14.21.0.2375: + blay09: + Remove incorrect call to .toString() when instantiating custom config + array entries. (#4078) + +Build 1.12-14.21.0.2374: + vincent.lee: Remove outdated patch to BlockDoublePlant + +Build 1.12-14.21.0.2373: + LexManos: Fix ItemStack/Block/BlockSpecial not applying at runtime. + LexManos: More work on registry override ability. Closes #4079 + fry: Added dependencies and dependency ordering for textures. (#4070) + mezz: Remove the call to client.refreshResources during loading (#4032) + quadraxis: Remove some deprecated methods and clean up + LexManos: Fix substitution tests + +Build 1.12-14.21.0.2368: + bs2609: + Add a FluidUtil method to interact with an arbitrary IFluidHandler + (#4080) + +Build 1.12-14.21.0.2367: + ichttt: Further Java 8 cleanup (#4077) + +Build 1.11.2-13.20.0.2366: + LexManos: Fix ItemStackTransformer not applying at runtime. + +Build 1.12-14.21.0.2365: + LexManos: Fix ModelBlockAnimation expsing a private class. + LexManos: Fix missed side only on BlockFlower + +Build 1.12-14.21.0.2364: + LexManos: Make Block.getSubBlocks not client side only. + +Build 1.12-14.21.0.2363: + fry: + Cleanup of model system, taking advantage of java 8; replaced guava + Optional and Function with java 8 versions. + +Build 1.12-14.21.0.2362: + LexManos: Reload client recipe book after loading modded recipes. + +Build 1.12-14.21.0.2361: + LexManos: Make Dummy block an Air block. + +Build 1.12-14.21.0.2360: + LexManos: Fix minecraft:item_nbt ingredient type. + LexManos: Fix Emerald generation causing chunk loading. + LexManos: Make getSubItems non-client only. Use it for Ingredient iteration. + LexManos: Fix NPE in MissingMappings event. Closes #4067 + +Build 1.12-14.21.0.2359: + mezz: + Add Block.getDrops that uses NonNullList, deprecate the old method. Fix + #3567 (#3778) + +Build 1.12-14.21.0.2358: + mezz: Remove arrival/departure message methods from WorldProvider (#2733) + +Build 1.12-14.21.0.2357: + mezz: Clean up logging + +Build 1.11.2-13.20.0.2356: + kinglemming: Enable support for modded Fishing Rods. (#4011) + +Build 1.12-14.21.0.2355: + bs2609: + [1.12] Cleanup of files with old licence headers, Add missing LGPL 2.1 + licence headers (#4051) + kinglemming: Use instanceof ItemFishingRod instead of item equality (#4060) + +Build 1.12-14.21.0.2354: + Choonster.2010: + Fix uncaught ClassCastException from invalid recipe file (#4043) + A JsonSyntaxException will now be thrown, caught and logged when the + conditions property of a recipe isn't an array + +Build 1.12-14.21.0.2353: + TechnicianLP: + Fix onBlockClicked handler firing twice and Item.onArmorTick in the + wrong place (#4037) + +Build 1.12-14.21.0.2352: + quadraxis: Remove Java 8 warnings now that Minecraft requires it + mezz: Update MCP to 20170624 + +Build 1.12-14.21.0.2351: + bs2609: Fire AnimalTameEvent for parrots (#4003) + +Build 1.12-14.21.0.2350: + tterrag1098: Make ForgeRegistry iterator sorted. Closes #4058 (#4059) + +Build 1.12-14.21.0.2349: + LexManos: Loosen up registry locks until data freeze. + +Build 1.12-14.21.0.2348: + LexManos: + First pass of registry rewrite. Tests do not run yet. Things of note: + Removed the idea of substitutions, just register multiple items with the + same name they will override each other like a normal map. Decoupled + Forge registries from vanilla classes. They now use bouncer classes. + MODDERS SHOULD NEVER USE THESE Introduced more stringent registry + locking. As it sits things are only allowed to be registered during the + RegistryEvent.Registry phases! This is to force modders to split up + their registrations, and pave the way for calling these functions + multiple times during a single MC lifecycle. ObjectHolder, Missing + Mappings, etc... *should* now work for all registry types, nothing + should be special cased to Blocks/Items anymore. Added optional generic + dummy factory to registries, to allow registry creators the ability to + dummy more then just Blocks. Re-worked the ItemStack transformer and + applied it to ItemBlock and ItemBlockSpecial. Allowing us to cleanup + reflective hacks in Block callbacks. Registry onAdd callback is now only + fired on the ACTIVE registry, fixing any issues of temp registries + overriding active objects. + LexManos: + More work, game loads and runs now. Moved Registry events to directly + AFTER PreInit instead of before. This allows modders to register + handlers for it without @EventBusSubscriber. It also allows you to + register custom things needed before the construction of blocks or items + such as Fluids. TODO: Move Fluids to a real registry. @ObjectHolder can + now be used on private fields. Reworked FMLModIdMappingEvent to include + data for all registries. Tile Entities are now registrable. + LexManos: Fixup some registry tests, dummies are now persisted across syncing. + LexManos: + Disable substitution test, substitutions are not managed the way they + used to be. We do not care about substitutions, People who replace + entries should make them compatible with the existing item. + LexManos: + Implement override tracking and syncing. Overrides MUST be registered + within a tracked event so we know what mod it came from. This will allow + servers/saves to select which mod 'wins' and becomes to active entry. + This should also mean that when connecting to a vanilla server things + will revert. + LexManos: Fix conflicts + +Build 1.12-14.21.0.2347: + mezz: Fix Universal bucket handling for Fluids with NBT (Fix #3757) + +Build 1.12-14.21.0.2346: + diesieben07: + Clean up Logging (#3953) + # Conflicts: + # + patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch + # + patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch + # patches/minecraft/net/minecraft/entity/EntityList.java.patch + # patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch + # src/main/java/net/minecraftforge/oredict/OreDictionary.java + +Build 1.11.2-13.20.0.2345: + diesieben07: Clean up Logging (#3953) + +Build 1.12-14.21.0.2344: + mezz: Fix ShapedOreRecipe matching. #4038 + +Build 1.12-14.21.0.2343: + LexManos: Fix recipe names in packaged jars. Closes #4039 + +Build 1.12-14.21.0.2342: + bs2609: Update NoteBlockEvent with new instruments. Resolves #4018. (#4019) + +Build 1.12-14.21.0.2341: + mezz: Fix Chunk patch (#4036) + +Build 1.12-14.21.0.2340: + TechnicianLP: IRecipeConditions forge:and and forge:false (#4017) + +Build 1.12-14.21.0.2339: + mezz: Fix itemstack comparison with null + mezz: Fix patches in Chunk and Explosion (#4036) + +Build 1.12-14.21.0.2338: + LexManos: Fix loading recipe jsons from jar files. + +Build 1.12-14.21.0.2337: + lumien231: [1.12] Fixes Exception when getting modlist for a vanilla client (#4028) + williewillus: + Fix shapeless recipes not being able to use NBT on output, and fixed + issue with null groups. + +Build 1.12-14.21.0.2336: + bs2609: Remove unused patch to ItemRecord. Closes #2686. (#4035) + +Build 1.12-14.21.0.2335: + mezz: Add timeout to TestNetworkHandshake setup + mezz: Disable TestNetworkHandshake to make Travis work again + mezz: Log info on Travis tests + +Build 1.12-14.21.0.2334: + mezz: Clean up ShapedOreRecipe and ShapelessOreRecipe + mezz: Update mcp mappings to 20170611 + mezz: Update MCP mappings to 20170617 + mezz: Add missing Override annotations + +Build 1.12-14.21.0.2333: + shadowfacts: Allow condition factories to be registered from JSON (#4015) + +Build 1.12-14.21.0.2332: + cpw: + Patch a small bug in SPacketLoginSuccess that lets us emulate the + network handshake. This will be very useful as I rebuild the networking. + +Build 1.12-14.21.0.2331: + LexManos: + Filter any recipe starting with _, Such names are reserved for metadata. + Actually implement conditions for recipes. + +Build 1.12-14.21.0.2330: + LexManos: Fix NBT ItemStack support in json loader. Closes #4002 + +Build 1.12-14.21.0.2329: + LexManos: Fix OreIngredient comparing items in reverse. Closes #3999 + +Build 1.12-14.21.0.2328: + marvinroesch99: Make registries persist by default, fixes #3989 (#3998) + +Build 1.12-14.21.0.2327: + tterrag1098: + Fix exception in ShapedOreRecipe.checkMatch for recipes that don't fill + entire crafting grid (#3995) + +Build 1.12-14.21.0.2326: + LexManos: Fix parseShaped missing Empty slot item. Closes #3990 + +Build 1.12-14.21.0.2325: + LexManos: Fix CraftingHelper.parseShapred error. Closes #3979 + +Build 1.12-14.21.0.2324: + LexManos: Fix NPE in config menu with custom keybinds. Closes #3985 + +Build 1.12-14.21.0.2323: + LexManos: + In-progress Registry system enhancement. Needs cpw to take a look at + enabling removing/overriding in the registry stuff. But in theory it + loads json recipes for mods now. + +Build 1.12-14.21.0.2322: + LexManos: Update ASM for 5.2, and host it on Forge's maven now. + +Build 1.12-14.21.0.2321: + mezz: Fix log4j configuration + mezz: Fix log4j configuration + mezz: Fix log4j configuration + mezz: Update VanillaRegistryTests + +Build 1.10.2-12.18.3.2316: + mezz: Fix log4j configuration + +Build 1.11.2-13.20.0.2315: + mezz: Fix log4j configuration + +Build 1.11.2-13.20.0.2314: + Choonster.2010: Fix IItemHandler wrappers returned by EntityLivingBase (#3942) + +Build 1.11.2-13.20.0.2313: + mezz: Fix getShareTag replacing data on the server (#3776) Closes #3682 + +Build 1.11.2-13.20.0.2312: + LexManos: + Fix crashed caused by bad mods reflectively breaking the grass drop + list. Closes #3943 + +Build 1.11.2-13.20.0.2311: + Barteks2x: Make World.isValid and World.isOutsideBuildHeight public (#3919) + erlend: + Deprecate vanilla getExplosionResistance and properly annotate the forge + replacement (#3929) + bs2609: Make Teleporter fields accessible to subclasses (#3930) + rlonryan: + Changed Event.setCanceled To throw UnsupportedOperationException instead + of IllegalArgumetnException when called on a non-cancelable object + (#3926) + williewillus: Fix canRiderInteract being called on the wrong entity (#3934) + TechnicianLP: NBTTagList implements Iterable (#3884) + bs2609: Clean up MapData patch (#3905) + LexManos: Fix shaders not loading from mod domains Closes #3921 + +Build 1.11.2-13.20.0.2310: + mezz: Clean up formatting of Forge Test mods and disable noisy ones (#3908) + +Build 1.11.2-13.20.0.2309: + InsomniaKitten: Fix broken milk bucket model (#3925) + +Build 1.11.2-13.20.0.2308: + LexManos: Make hopper update accessible to subclasses. Closes #3849 + lukas172: Fix patches of GuiScreen(#3704) and ItemDye(#3736) (#3878) + +Build 1.11.2-13.20.0.2307: + Flaxbeard: Update EntityPlayer armor calculations and ISpecialArmor (#3838) + +Build 1.11.2-13.20.0.2306: + bs2609: + Fixes for PlayerDestroyItemEvent being called with empty itemstacks. + (#3728) + bs2609: + Tweak vertex lighter to avoid causing excess array initialisations + (#3771) + +Build 1.11.2-13.20.0.2305: + Madsthunder: [1.11.2] Added support for Village capabilities (#3648) + +Build 1.11.2-13.20.0.2304: + bluemonster122: + Fixes BlockLiquidWrapper placing a Static fluid where it should place a + Flowing one (#3893) + +Build 1.11.2-13.20.0.2303: + diesieben07: Disable frost walker enchantment on anything but vanilla water (#3906) + +Build 1.11.2-13.20.0.2302: + mattmess1221: Fix head being angled badly when riding mobs. Fixes MC-1207 (#3901) + +Build 1.11.2-13.20.0.2301: + mezz: + Print system details on startup without printing a full crash report + (#3909) + +Build 1.11.2-13.20.0.2300: + mezz: Reduce memory pressure from new objects during loading screen (#3907) + +Build 1.11.2-13.20.0.2299: + diesieben07: Add methods to write IForgeRegistryEntry to ByteBuf (#3806) + +Build 1.11.2-13.20.0.2298: + tterrag1098: + Fix normals not being generated for formats without normals (#3896) + Fix normals not being generated for formats without normals + +Build 1.10.2-12.18.3.2297: + mezz: + Fix MC-117087, prevent calling Class.getSimpleName on TEs unnecessarily + (#3887) + +Build 1.11.2-13.20.0.2296: + mezz: + Fix MC-117087, prevent calling Class.getSimpleName on TEs unnecessarily + (#3873) + +Build 1.11.2-13.20.0.2295: + ichttt: Add a configurable delay when unloading dimensions, fixes #3455 (#3679) + +Build 1.11.2-13.20.0.2294: + maxanier: + Changed custom entity selectors from event based to factory based. + (#3579) + +Build 1.11.2-13.20.0.2293: + ichttt: + Create ItemFishedEvent, the event is cancelable, but items are not + mutable. Use LootTables to control that. (#3705) + +Build 1.11.2-13.20.0.2292: + williewillus: Fix forge pipeline block shifts (#3789) + +Build 1.11.2-13.20.0.2291: + maxa.shen: Add pack.mcmeta to examplemod (#3813) + +Build 1.11.2-13.20.0.2290: + bs2609: + Relocate TileEntity#onLoad call to after it's added to the world instead + of the chunk so as to have a valid world reference (#3836) + +Build 1.11.2-13.20.0.2289: + diesieben07: + Allow client commands to control whether they can be invoked without + prefix. (#3847) + mezz: Improvements to FluidUtil (#3839) + +Build 1.11.2-13.20.0.2288: + mezz: + Remove splash.properties option for Mojang logo (has been disabled) + (#3859) + Fix backgound color being applied to the Forge logo + mezz: When the window is closed during loading, exit the game quickly (#3858) + +Build 1.11.2-13.20.0.2287: + ichttt: Fix GuiMultipleModsErrored ignoring scrolling with mouse wheel. (#3861) + +Build 1.11.2-13.20.0.2286: + Madsthunder: + [1.11.2] Fixed Zombie Villagers not setting and getting professions + correctly (#3678) + +Build 1.11.2-13.20.0.2285: + JDLogic: + Prevent NPE in ConfigManager and fix config gui being enabled for all + mods. Fixes #3856. (#3860) + +Build 1.11.2-13.20.0.2284: + LexManos: + Fix return value of ItemHandlerHelper.insertItem being incorrect when + destination was null. Closes #3840 + +Build 1.11.2-13.20.0.2283: + LexManos: + Fix vanilla inventory wrappers not properly calling markDirty. Closes + #3854 and #3810 Also updated IItemHandler javadocs to reflect returning + EMPTY instead of NULL. + +Build 1.11.2-13.20.0.2282: + cpw: + Add in a check to the splash screen. If the Display.update call takes + too long on average (over first 200 frames) we'll use a sleep based + timer to allow mods doing splash screen work some time on the LWJGL + global lock. + (cherry picked from commit 03d7eaa) + +Build 1.10.2-12.18.3.2281: + github: + Fix NumberFormatException being thrown for empty ItemStack + deserialization. Fixes #3828. (#3830) + +Build 1.11.2-13.20.0.2280: + LexManos: + Fix NumberFormatException being thrown for empty ItemStack + deserialization Thanks @gabizou, 1.11.2 version of #3830 + LexManos: Cleanup AccessTransformer debug output + +Build 1.11.2-13.20.0.2279: + kyo.se.llout: Fix Fluid models rendering with gaps (#3747) Closes #2993 + +Build 1.11.2-13.20.0.2278: + mezz: Fix mutable blockpos leak MC-114281 (#3742) + +Build 1.11.2-13.20.0.2276: + Leviathan143: + Fix typo in LootEntry.Serialiser causing incorrect serialisation. Closes + #2757, Fixes MC-115407 (#3823) + +Build 1.11.2-13.20.0.2274: + ikp10: + Add Item.canDestroyBlocksInCreative() allowing more items to not break + blocks in creative (#3805) + PProvenzano: Fix invulnerable items becoming invisible client side MC-53850 (#3807) + +Build 1.11.2-13.20.0.2273: + williewillus: + Allow result of PlayerInteractEvent to be changed when it's cancelled + (#3744) + bs2609: Added missing bounds check to ChunkCache.getBiome (#3752) + bs2609: Add AnimalTameEvent for handling animal taming (#3763) + mezz: + Skip loading models if there is a fatal mod dependency error (#3772) + Close #3768 + mezz: Add GenerateMinable event for mesa gold (#3774) Closes #3738 + CrafterKina: Fixed HarvestDropsEvent issue by fixed-length lists on getDrops (#3778) + diesieben07: Ignore calls to sendMessage for fake players. Fixes #3796. (#3798) + +Build 1.10.2-12.18.3.2272: + mezz: Fix Vanilla BlockPos memory leak MC-114281 (#3743) + +Build 1.11.2-13.20.0.2271: + Da-Technomancer: + Added a boolean flag for disabling Entity onUpdate (#3731) + The flag is false by default, and if true the Entity will not update. It + is saved and loaded from NBT, and is called updateBlocked. Modders are + responsible for managing this flag for entities they with to 'freeze' or + 'unfreeze'. + Choonster.2010: Add EnumHand and ItemStack to BonemealEvent (#3736) + +Build 1.11.2-13.20.0.2270: + egabriel: Fix EntityFallingBlock check for ITileEntityProvider (#3711) + paulo.siqueira: Add LootTableManager to the LootTableLoadEvent (#3717) + bs2609: Revert block snapshots in reverse order. Fixes #3608. + +Build 1.11.2-13.20.0.2269: + the.f1repl4ce: Added ClientChatEvent. Closes #1442 (#3704) + +Build 1.11.2-13.20.0.2268: + blay09: + Fix custom array entry class for config GUI being ignored when adding + new entries (#3697) + +Build 1.11.2-13.20.0.2267: + kashike: Use thread groups to detect the effective side (#3644) + +Build 1.11.2-13.20.0.2266: + Silly511: + New LivingDestroyBlockEvent for controlling if some entities can destroy + blocks (#3628) + +Build 1.11.2-13.20.0.2265: + LexManos: Fix arrays in map values for config system + LexManos: Fix breaking particles on dedicated server. Closes #3825 + +Build 1.11.2-13.20.0.2264: + LexManos: [MC-2518] Fixed missing break sound and particles. Closes #3821 + +Build 1.11.2-13.20.0.2263: + kirill.desirehd: + [1.11.x] Fix blank tab in creative inventory when additional tabs evenly + divisible by 10 (#3817) + JDLogic: Fix java 6/7 compatibility in GuiConfig (#3824) + +Build 1.11.2-13.20.0.2262: + thilo: + Adding config GUIs to the @Config based configuration System (#3735) + Lots of internal API that modders should not touch. See test mods for + example usages. + +Build 1.11.2-13.20.0.2261: + LexManos: + Fix vanilla bug where player reputations villages were reset on read. + Deprecated Username based API in favor of UUID based API. + +Build 1.11.2-13.20.0.2260: + LexManos: Add setter for default key in RegistryBuilder. Closes #3804 + +Build 1.11.2-13.20.0.2259: + LexManos: + Fix error when reading world info for old saves with missing dimensions. + Closes #3786 #3331 + +Build 1.11.2-13.20.0.2258: + mezz: + Detect and log cascading chunk generation issues during terrain + population (#3756) + +Build 1.11.2-13.20.0.2257: + mezz: + Fix #3733 Splash Screen memory bar background matches screen background + (#3775) + burtonjae: + Fix duplicate achievements getting added to the achievement list (#3770) + (#3779) + +Build 1.11.2-13.20.0.2256: + mattia.malonni: Add additional constructors to EnergyStorage to set values at load time. + +Build 1.11.2-13.20.0.2255: + diesieben07: Fix parameter-names for WorldProvider.shouldMapSpin (#3767) + +Build 1.10.2-12.18.3.2254: + cpw: + Add in a check to the splash screen. If the Display.update call takes + too long on average (over first 200 frames) we'll use a sleep based + timer to allow mods doing splash screen work some time on the LWJGL + global lock. + +Build 1.11.2-13.20.0.2253: + paul.fulham0: + Fix MC-112730 TE global renderer duplicate render (#3651) + * Fix TE global renderer duplicate render + +Build 1.11.2-13.20.0.2252: + bartek.bok: Fix entity write catch block (#3726) + +Build 1.11.2-13.20.0.2251: + Barteks2x: + Fixed TESR items not rendering correctly before entering world + (MC-112292) (#3666) + Fixed crash when rendering text in TESR items before entering world + +Build 1.11.2-13.20.0.2250: + josephcsible: + Fixed 'reset to defaults' button not working on some Forge config + fields. + +Build 1.11.2-13.20.0.2249: + gigaherz: + Allow mods to set other default "home dimensions" for respawning. + (#3528) + sjx233: Add DifficultyChangeEvent (#3525) + +Build 1.11.2-13.20.0.2248: + Guichaguri: Added Forge slot methods to creative container (#3581) + williewillus: + Persist PotionEffect curative items and initialize defaults from Potion + (#3573) + +Build 1.11.2-13.20.0.2247: + williewillus: Restore missing Biome GetWaterColor event. Closes #3164. (#3625) + +Build 1.11.2-13.20.0.2246: + dawn0966: Fixed Missing Furnace Fuels (#3627) + +Build 1.11.2-13.20.0.2245-3630: + vincent.lee: Fix category comments not working. Closes #3593 + bs2609: Prevent concurrent modification of ClassInheritanceMultiMap (#3632) + +Build 1.11.2-13.20.0.2244: + diesieben07: Start firing AttachCapabilitiesEvent (#3645) + bs2609: Fixed ChunkCache.getTileEntity creating tile entities off world thread. + ichttt: Improve exception messages during initialization. + +Build 1.11.2-13.20.0.2243: + LexManos: + Add @Name annotation to config system allowing you to use custom key for + value. Also added category option to root config to allow customization. + See examples/docs for information. + +Build 1.11.2-13.20.0.2242: + LexManos: Fix Poppy to Dandelion ratio + LexManos: Fixed Flower Forests not having proper flowers. Closes #3652 + +Build 1.11.2-13.20.0.2240: + bs2609: Use Forge setting to determine baby zombie chance. Fixes #3690. + aa1ronham: + Add a null check for the throwable message in + NetWorkDispatcher#exceptionCaught (#3688) + (cherry picked from commit 1be1bb59c5c4c7432c515ef07beb6bf7e1f6ef27) + williewillus: + Make getRGBDurabilityForDisplay use getDurailityForDisplay by default. + Closes #3670 (#3673) + bs2609: Fix bug caused by ItemMinecart patch (#3672) + CreativeMD: + Add implementation for Living Attack event on client-side for players + (#3667) + * Fixed unused import + williewillus: Fix forge:default-item missing case for FIXED transform (#3663) + +Build 1.10.2-12.18.3.2239: + aa1ronham: + Add a null check for the throwable message in + NetWorkDispatcher#exceptionCaught (#3688) + +Build 1.11.2-13.20.0.2238: + LexManos: + Properly fix IShearable implementation. Fixes shears taking damage + twice, mooshroom particles, and blocks dropping incorrect loot. + +Build 1.11.2-13.20.0.2237: + LexManos: Fix English injection for some mods on dedicated server. + +Build 1.11.2-13.20.0.2236: + LexManos: + Override Mojang's new logging config to re-enable our logging to text + file. The new launcher's GUI for logs WILL NOT WORK until they add + support on their end. + LexManos: Fix hoppers being able to insert shulker boxes into shulker boxes. + +Build 1.11.2-13.20.0.2235: + tehgeek: + Stop rotation of extended pistons, beds, and double chests Fixes #3634 + Fix rotation of repeaters and comparators + fry: + Added check for quad builder to always have the particle texture set, + and fixed where that wasn't true. Fixes #3653 + williewillus: Fix Item.doesSneakBypassUse being applied incorrectly. + williewillus: Fix ClientTickEvent Post firing inside another profiler section (#3715) + cordonfreeman: + Fix for bad decompile process on Particle.java that causes onGround flag + to not get set properly as well as motionX and motionZ not being set to + 0 when their axis has collision happening (#3716) + +Build 1.10.2-12.18.3.2234: + tehgeek: + Fixed TileEntity#getRenderBoundingBox not offsetting correctly causing + more TEs to render then needed (#3709) (#3712) + +Build 1.11.2-13.20.0.2233: + florian: + Fixed TileEntity#getRenderBoundingBox not offsetting correctly causing + more TEs to render then needed (#3709) + +Build 1.11.2-13.20.0.2232: + cordonfreeman: + [1.11.2] Make AbstractSkeleton implementable by fixing limited access on + getStepSound (#3702) + +Build 1.11.2-13.20.0.2231: + Choonster.2010: Fix extracted mods crash report file name for Windows (#3701) + +Build 1.11.2-13.20.0.2230: + tehgeek: + Remove dynamic lambda methods when inside of SideOnly methods + Clean signatures of ReflectionHelper methods. + +Build 1.11.2-13.20.0.2229: + LexManos: Fix world spawn fuzz. + LexManos: + Fix world spawn fuzz. (reverted from commit + 450c3a80c10c1dc27ef68a3f5e5f58af6a827fde) Protip Don't code while + groggy. + diesieben07: Fix spawn-fuzz formula (#3695) + +Build 1.11.2-13.20.0.2228: + diesieben07: + Fix some cases where world time is not passed through the WorldProvider. + (#3685) + +Build 1.11.2-13.20.0.2227: + lukas.tenbrink: + Replace listSubtypes with listSupertypes to match the intended behavior. + (#3564) + lukas.tenbrink: Fix addTypes not adding in the base types. (#3681) + +Build 1.11.2-13.20.0.2226: + goto.minecraft: this finaly fixes #2866 (#3656) + +Build 1.11.2-13.20.0.2225: + williewillus: Fix MC-111753 (#3655) + +Build 1.11.2-13.20.0.2224: + fry: Small bugfix in lighting logic. + fry: + Fix default missing model zoom text not being set to false on all + places. + +Build 1.11.2-13.20.0.2223: + fry: Added the variant name to the missing model. (#3328) + +Build 1.11.2-13.20.0.2222: + tehgeek: Fix #3635 MC-103403 fix ingredient count for ingot block recipes (#3640) + +Build 1.10.2-12.18.3.2221: + LexManos: + Cache entity constructors for a small performance optimization + (cherry picked from commit 50bf03b82b72866bd54e796a37707d45bcbf3d80) + LexManos: + New client config option to force all chunk rendering off the main + thread. This may help FPS issues, but may also result in world + holes/rendering issues. Also fix Forge configs not saving properly. + (cherry picked from commit 7da6c2d0e1b0056e520990d78f63a9be8d0db5ed) + +Build 1.11.2-13.20.0.2220: + LexManos: + New client config option to force all chunk rendering off the main + thread. This may help FPS issues, but may also result in world + holes/rendering issues. Also fix Forge configs not saving properly. + +Build 1.10.2-12.18.3.2219: + tehgeek: Skip first baking in ModelLoader (#3621) (#3638) + +Build 1.11.2-13.20.0.2218: + LexManos: Cache entity constructors for a small performance optimization + +Build 1.10.2-12.18.3.2217: + tehgeek: + Fix some resources that are never closed, close in a finally block + (#3637) + +Build 1.11.2-13.20.0.2216: + cpw: + Bypass forge chunk cache if it's configuratively disabled + (cherry picked from commit 9fe6385) + +Build 1.10.2-12.18.3.2215: + cpw: Bypass forge chunk cache if it's configuratively disabled + +Build 1.11.2-13.20.0.2214: + Choonster.2010: + Fix Biome#getSpawnableList returning an empty list for non-vanilla + EnumCreatureTypes (#3611) + +Build 1.11.2-13.20.0.2213: + williewillus: Skip first baking in ModelLoader (#3621) + +Build 1.11.2-13.20.0.2211: + diesieben07: Allow block to specify their type for AI pathfinding (#3546) + +Build 1.11.2-13.20.0.2210: + ichttt: Fix #3576 Unnecessary warning about totem being renamed (#3614) + liach: Removed an unsafe usage of `EntityMinecart.getType()` (#3592) + bs2609: Fix DungeonHooks method to use correct type (#3587) + bs2609: Fix ContainerRepair patch to prevent NPE (#3553) + modmuss50: Add Iron Nugget to OreDictionary (#3571) + JDLogic: Add missing patch to ItemStack isItemStackEqual (#3577) + tehgeek: Improve performance of inserting into inventory wrappers (#3622) + bs2609: Fix vanilla bug MC-98707 (#3565) + +Build 1.10.2-12.18.3.2209: + JDLogic: + [1.10.x] Fix ItemHandlerHelper canStack methods not checking + capabilities (#3105) + +Build 1.11.2-13.20.0.2208: + molecularphylo: Fix null check in BrewingRecipeRegistry (#3584) + williewillus: Fix IItemHandler's IStorage using nulls (#3580) + bs2609: Fix and clean up ItemBow.onPlayerStoppedUsing() patch (#3555) + bs2609: Small cleanup for PlayerInteractEvent (#3563) + tehgeek: Clean up null issues, add more annotations (#3590) + tehgeek: Fix #3596 Close jar sources safely in Java 6 (#3597) + williewillus: Fix milk not working on anything at all (#3574) + +Build 1.11.2-13.20.0.2207: + tehgeek: Use travis_wait to extend the timeout on gradlew build (#3610) + bs2609: Fix a couple more ItemStack null checks (#3586) + +Build 1.11.2-13.20.0.2206: + fry: + Fix super call to ItemOverrideList constructor inside + AnimationItemOverrideList, fixes #3264. + +Build 1.11.2-13.20.0.2205: + fry: Added caching for baked vanilla models, fixes #3594. + +Build 1.11.2-13.20.0.2204: + williewillus: Fix horse cap patch being reapplied in the wrong place (#3609) + +Build 1.11.2-13.20.0.2203: + tehgeek: + Add .travis.yml (#3598) + * Add .travis.yml + + * fix --refresh-dependencies + + * try java 8 + + * add build with stracktrace + + * Fix running test + + * try building with java 6 + + * try using simplified init.gradle + + * Revert "try using simplified init.gradle" + This reverts commit e56041e794e3b8c13453245eb2605118e4ac68ce. + + * Revert "try building with java 6" + This reverts commit 51795385f453fdd8a0e77c632b5463d8754b1ba4. + + * Fix running tests + + * skip createExe task + + * Test with broken debug mod + + * Revert "Test with broken debug mod" + This reverts commit 3b26700582ba4f4f5477f5927b0006ef0fe85bb0. + +Build 1.10.2-12.18.3.2202: + aa1ronham: Properly deobfuscate lambda expressions (#3532) + +Build 1.11.2-13.20.0.2201: + LexManos: Inital 1.11 update. + LexManos: Fix tests... + +Build 1.11-13.19.1.2199: + tehgeek: Fix #3561 import io.IOUtils instead of compress.utils.IOUtils (#3562) + +Build 1.11-13.19.1.2198: + tehgeek: Update MCP mappings to snapshot_nodoc_20161220 (#3551) + +Build 1.11-13.19.1.2197: + bs2609: [1.11] Fixes for Chunk.getBlockLightOpacity implementation (#3537) + tehgeek: + Fix some resources that are never closed, close in a finally block + (#3544) + tehgeek: + Add hook to allow any block to respond to filtered block updates like + the Observer block (#3547) + tehgeek: Add nullable annotations to IGuiHandler (#3550) + tehgeek: Properly deobfuscate lambda expressions (#3552) + +Build 1.11-13.19.1.2196: + JDLogic: + [1.11] Fix ItemHandlerHelper canStack and ItemStack areTagsEqual methods + not checking capabilities (#3500) + +Build 1.11-13.19.1.2195: + tehgeek: + Make NBSP character display as a space. MC-2595 (#3522) + Add easy getter for the Locale: MinecraftForgeClient.getLocale() + +Build 1.11-13.19.1.2194: + bs2609: + Patch EntityPlayerSP to use location-aware version of isNormalCube + (#3494) + tehgeek: + Fix uses of uppercase "Forge" where it fails Loader.isModLoaded(modID) + (#3513) + maxanier: [1.11] Made WalkNodeProcessor consider burning blocks (#3515) + tehgeek: Fix setting the world in TileEntity.addTileEntity (#2863) (#3517) + dawn0966: + Added Oak door to Ore Dictionary Exclusion list to fix able to craft it + with any wood type (#3519) + +Build 1.11-13.19.1.2193: + whs1999kr: reset repo to upstream and reapplied patches (#3434) + tehgeek: [1.11] Add memory display to loading screen (#3447) + +Build 1.11-13.19.1.2192: + rock: [1.11] Added EnchantmentLevelSetEvent (#3433) + +Build 1.11-13.19.1.2191: + minecrell: Register Minecraft mod container in FML loader (#3414) + +Build 1.11-13.19.1.2190: + LexManos: Fix modid field name for ProjectInjector. + LexManos: Small memory optimization in Registries. + +Build 1.11-13.19.1.2189: + LexManos: + Enable Enforcement of modid formatting. Must be lowercase and <= 64 + characters + +Build 1.11-13.19.1.2188: + LexManos: Bump version for RB. + +Build 1.11-13.19.0.2187: + mezz: [1.11.x] Refine fluid placement utilities (#3509) + +Build 1.11-13.19.0.2186: + LexManos: + Properly filter out annotations that are for multiple mods in the same + mod source. This prevents disabled mods from getting their proxies + injected. Also prevents mods from getting their proxies injected + multiple times. Effects the @EventBusSubscriber, @Instance, @Metadata, + @SidedProxy annotations. If the target modid is not in the annotation + data, and there are multiple mods in the source, it will attempt to find + it by matching the annotations's class names. This is a potentially + breaking change. Review your logs for "skipping" messages. + +Build 1.10.2-12.18.3.2185: + LexManos: Bump version number for new Recommended Build. + +Build 1.11-13.19.0.2184: + LexManos: + Prevent a crash when scheduling block updates for non-existing blocks + #3485 + +Build 1.10.2-12.18.2.2183: + LexManos: + Prevent a crash when scheduling block updates for non-existing blocks + #3485 + +Build 1.10.2-12.18.2.2182: + LexManos: + Make Container.mergeItemStack respect target slot's max size when slot + is non-empty. Closes #3498 Fix Shift clicking in Beacons with stacked + items when fuel slot is empty. + (cherry picked from commit c6bc4ec5a92b640ebe773bfa48732dfa7eb59a17) + LexManos: + Fix NPE when rendering missing mod screen with version bound + requirements. #3501 + (cherry picked from commit c1e832bff09c949bfe736f492c2e4aa8004baa84) + LexManos: + Fix issue reading chunks from the network when client and server do not + agree on block count. Closes #34925 + (cherry picked from commit daf21e4dcf246cfa15c362800effc5dc787ab777) + +Build 1.11-13.19.0.2181: + LexManos: Make sure to log kick messages in NetworkDispatcher. Closes #3507 + LexManos: + Fix NPE when rendering missing mod screen with version bound + requirements. #3501 + LexManos: + Added isItemValidForSlot check to hopper extraction (#3444) + (cherry picked from commit 0348760a774ca7ed9639376baadae38e272f5bf8) + LexManos: + Fix for showing config default values twice in tooltip (#2257) (#3338) + (cherry picked from commit be73ec3d5ebd972cfacb0f255f71112a0430bc43) + LexManos: + Add null check and informative error message when client receives an + invalid update packet (#3266) + (cherry picked from commit 882e0e3bf22784d693e3816b0efeba5fbedb1a22) + LexManos: + Add ItemBlockSpecial#getBlock (#3343) + (cherry picked from commit cf26f4acbe48ee8790edc03d0b5c16c1167278ab) + LexManos: + Added gradle.properties to MDK (#3361) + The file sets the default max heap size to 3 GiB so that the + decompilation doesn't fail as often. + (cherry picked from commit 49ec3d1b9322ee2b7a1312059118173b0b3fe6d0) + LexManos: + Make SlotItemHandler override Slot.getSlotStackLimit. Closes #3497 Make + Container.mergeItemStack respect target slot's max size when slot is + non-empty. Closes #3498 Fix Shift clicking in Beacons with stacked items + when fuel slot is empty. + LexManos: Restore missed patch in World.updateComparatorOutputLevel. Closes #3495 + LexManos: + Fix issue reading chunks from the network when client and server do not + agree on block count. Closes #34925 + +Build 1.11-13.19.0.2180: + diesieben07: Add missing pooled BlockPos retain in World patch (#3486) + mezz: + Add a way for modded GuiScreens to cancel mouse and keyboard events + (#3438) + blay09: + [1.11] Add canApplyAtEnchantmentTable to Item (#3463) + Allowing increased control of which enchantments can be put on an item + over Vanilla's hard-coded item type checks. + disabled when the item is enchantable but the enchantability requirement + is not met on lower levels. + mezz: [1.11] Add biome dictionary types for newer biomes (#3475) + bs2609: [1.11] Fix null checks in shouldCauseReequipAnimation (#3482) + +Build 1.10.2-12.18.2.2179: + blay09: + Add null check and informative error message when client receives an + invalid update packet (#3266) + raoulvdberge: Add ItemBlockSpecial#getBlock (#3343) + yannick: + Added gradle.properties to MDK (#3361) + The file sets the default max heap size to 3 GiB so that the + decompilation doesn't fail as often. + +Build 1.11-13.19.0.2178: + liach: Moved TextureStitchEvent.Pre to allow custom sprites for blocks (#3436) + +Build 1.11-13.19.0.2177: + bs2609: Fix sky colour blending not working for render distances >16 (#3476) + +Build 1.11-13.19.0.2176: + logictechcorp: Allow connectable blocks to choose what they can connect to (#3437) + +Build 1.11-13.19.0.2175: + dawn0966: Changed Armor Material to use an ItemStack aware version (#3469) + +Build 1.11-13.19.0.2174: + bs2609: Fix Redstone Torch memory leak (#3474) + +Build 1.11-13.19.0.2173: + diesieben07: BiomeDictionary code cleanup (#3466) + +Build 1.11-13.19.0.2172: + TechnicianLP: Added EquipmentChangeEvent (#3411) + +Build 1.10.2-12.18.2.2171: + bs2609: Fix Redstone Torch memory leak (#3271) + +Build 1.10.2-12.18.2.2170: + 1vInc: Fix for showing config default values twice in tooltip (#2257) (#3338) + +Build 1.11-13.19.0.2169: + marvinroesch99: Update assets to new Forge brand (#3464) + +Build 1.11-13.19.0.2168: + LexManos: + First pass at exposing data fixers to modders. Each mod gets its own + version number, mods SHOULD NOT rely on other mod's fixers, just care + about yourself. Walkers can use IDataFixerData to retrieve their + version. + +Build 1.11-13.19.0.2167: + williewillus: Add getSlotLimit(slot) to IItemHandler (#3445) + +Build 1.10.2-12.18.2.2166: + draco18s: Added isItemValidForSlot check to hopper extraction (#3444) + +Build 1.11-13.19.0.2165: + mezz: Provide access to GuiContainer location and dimensions (#3440) + kashike: + Add method to check if an Entity can trample a Block. Fixes #2510 + (#2730) + cpw: + Pass along if the respawn event was the result of the end being + conquered or not (end respawning is really FUNKY code and uses death + instead of 'change dimension') + +Build 1.11-13.19.0.2162: + bs2609: Clean up handling of changes to IVertexConsumer (#3458) + +Build 1.11-13.19.0.2161: + bs2609: Quick fix for another ItemStack null check (#3426) + mezz: Provide access to ShapedOreRecipe width and height (#3439) + +Build 1.11-13.19.0.2160: + cpw: + Fix problem with the server hanging around after forcing the client to + exit, leaving behind stale processes. + +Build 1.11-13.19.0.2159: + mezz: + Fix #3432 Hopper and Dropper item moving does not exactly match vanilla + (#3442) + mezz: Fix using the wrong Pair implementation (#3449) + +Build 1.11-13.19.0.2157: + mezz: Fix #3424 ItemCraftedEvent returns air when shift-clicking (#3441) + +Build 1.11-13.19.0.2156: + mezz: + Cleanup some null checks and remove deprecated methods in Item and Block + (#3429) + +Build 1.11-13.19.0.2155: + LexManos: Make all tests one side only, so we can test vanilla clients in dev env. + LexManos: + Insert FML packet handler into Vanilla pipelines in case modders send + FMLPacket to vanilla. Fixes #3422 + LexManos: Fix max CustomPayload size, 1MB not 16MB. + +Build 1.11-13.19.0.2154: + LexManos: Fix AbstractMethodException in FML Registries. Closes #3427 + +Build 1.11-13.19.0.2153: + shadowfacts: + Move EntityHorse capability patches to AbstractHorse (#3417) + Fixes #3409 + LexManos: Fix ItemStack null check in PlayerInteractionManager + +Build 1.11-13.19.0.2152: + shadowfacts: Initial annotations/nullability changes (#3392) + TechnicianLP: Remove Block.addInformation exists in vanilla (#3413) + LexManos: Fix Item transfers related to Hoppers. + +Build 1.10.2-12.18.2.2151: + ohai.iChun: + Add GetCollisionBoxesEvent. Allows manipulation of the collision boxes + for moving entities and entities stuck in walls. (#3397) + +Build 1.11-13.19.0.2150: + ohai.iChun: + Add GetCollisionBoxesEvent. Allows manipulation of the collision boxes + of blocks for entities. MC1.11 edition. (#3405) + +Build 1.11-13.19.0.2149: + LexManos: First draft of Entity Registry re-write. + +Build 1.11-13.19.0.2148: + LexManos: + Make Wither Skulls respect Block.canEntityDestroy. Closes #3404 + (cherry picked from commit 6b52023a5c341420d976cb50359e2a2a4a6a9192) + +Build 1.10.2-12.18.2.2147: + LexManos: Make Wither Skulls respect Block.canEntityDestroy. Closes #3404 + +Build 1.11-13.19.0.2146: + Bartek_s2: Added EnumHand parameter to Block.getStateForPlacement (#3402) + +Build 1.11-13.19.0.2145: + LexManos: + Fix issues with ZombieVillagers Closes #3398 1.11 doesn't intertwine + zombie types anymore so our edits to split them out for custom + professions are not needed. + LexManos: Fix client side placement issue on blocks with GUIs. Closes #3399 + +Build 1.11-13.19.0.2144: + ezterry3: + Fix Villagers for 1.11 (#3401) + - Add cartographer registry entry + - Fix textures for the nitwit + +Build 1.11-13.19.0.2143: + mezz: [1.11] Fix nullability issues around ForgeHooks and Capabilities (#3395) + +Build 1.11-13.19.0.2142: + larsgerrits99: + Change OreDictionary over from "null" to the new ItemStack system. + (#3400) + +Build 1.11-13.19.0.2141: + LexManos: + Do not install mod_list.json for optional mods. Classpath scanning is in + so they will still be detected + +Build 1.10.2-12.18.2.2140: + LexManos: + Do not install mod_list.json for optional mods. Classpath scanning is in + so they will still be detected + +Build 1.10.2-12.18.2.2139: + LexManos: Include Mercurius in installer. See Forge Forums for more info. + +Build 1.11-13.19.0.2138: + LexManos: Include Mercurius in installer. See Forge Forums for more info. + +Build 1.11-13.19.0.2137: + LexManos: Restore the ability to register modded TileEntities. + +Build 1.11-13.19.0.2136: + mezz: Remove deprecated Fluid stuff + mezz: Implement fluid item capabilities without item swapping + +Build 1.11-13.19.0.2135: + LexManos: + Make EntityShulker fire EnderTeleportEvent. Closes #3383 + (cherry picked from commit d48985fafaed6de6f09136b999ca8aa44184a7b9) + LexManos: Fixed damage bar color. Closes #3389 + LexManos: Fix ItemStackHandler's constructor ignoring size. Closes #3386 + shadowfacts: Fix crafting causing crash (#3388) Closes #3387 + +Build 1.10.2-12.18.2.2134: + LexManos: Update installer to 1.5, and fix local buildscript issues. + LexManos: Make EntityShulker fire EnderTeleportEvent. Closes #3383 + +Build 1.11-13.19.0.2133: + LexManos: + Added event to allow modification of player visibility to mobs/AI + (#3382) + (cherry picked from commit 0a5ef64d6ea96fe85d7c62107081ced649e6a3e9) + +Build 1.10.2-12.18.2.2132: + maxanier: + Added event to allow modification of player visibility to mobs/AI + (#3382) + +Build 1.11-13.19.0.2131: + LexManos: Apply missed patch to WorldProvider. + mezz: [1.11] Fix initCapabilities for ItemStacks (#3379) + LexManos: Disable capabilities for empty ItemStacks. + LexManos: Restore another missing patch in WorldProvider. + +Build 1.11-13.19.0.2130: + LexManos: + Fix build.gradle problems: Installer missing url.png UploadArchives + erroring on local systems due to missing changelog Adding branch name + improperly. + +Build 1.11-13.19.0.2129-1.11.x: + LexManos: Fix localizations not loading correctly in legacy resource packs. + +Build 1.11-13.19.0.2128-1.11.x: + LexManos: Fix FurnaceRecipy registration. + +Build 1.11-13.19.0.2127-1.11.x: + LexManos: Fixed test cases for 1.11 changes. + +Build 1.10.2-12.18.2.2125: + cpw: Update to 20161111 mcp names + cpw: regenerate entitylivingbase patch + +Build 1.10.2-12.18.2.2124: + mezz: Improve error message from crashes during loading (#3362) + +Build 1.10.2-12.18.2.2123: + draco18s: Added events for crop growth (#3320) + +Build 1.10.2-12.18.2.2122: + maxanier: Add support for custom entity selectors in commands (#3356) + +Build 1.10.2-12.18.2.2121: + latvianmodder: Added PermissionAPI (#3155) + +Build 1.10.2-12.18.2.2120: + Choonster.2010: Add hand argument to BlockEvent.PlaceEvent (#3221) (#3270) + +Build 1.10.2-12.18.2.2119: + jezzadabomb: + Fixes #3237 and #2752. (#3347) + * Fix #3237 by correctly utilising the keepLooking argument. + + * Explain within SimpleNetworkWrapper's javadoc that the execute of the + handler isn't on the main Minecraft thread. + +Build 1.10.2-12.18.2.2118: + draco18s: Made default slot implementation respect inventory stack size limit. + +Build 1.10.2-12.18.2.2117: + aa1ronham: Fixed Block.setBedOccupied ignoring 'occupied' parameter + +Build 1.10.2-12.18.2.2116: + raoulvdberge: + Add Item#getNBTShareTag (#3342) + * Add Item#getNBTShareTag + + * Update comment + +Build 1.10.2-12.18.2.2115: + bonii-xx: + Call Looting Event on player death and loot table drops (#3275) + * Call Looting Event on player death and loot table drops + + * Simplify patches + + * More code cleanup: Replace old usage with compact forgehooks + implementation + +Build 1.10.2-12.18.2.2114: + LexManos: Fix POTENTIAL issue with Texture Stitcher exceeding max size. + +Build 1.10.2-12.18.2.2113: + dawn0966: + Fixed Ore Dictionary replacing the oak boat recipe (#3329) + Fixes the oak boat recipe being able to be crafted with any wood + +Build 1.10.2-12.18.2.2112: + rwtema: + Improve the default isItemValid() and getItemStackLimit() + implementations in SlotItemHandler. You can now properly swap the + player's held itemstack with the slot's itemstack. (#3273) + +Build 1.10.2-12.18.2.2111: + LexManos: + Fixed texture stitcher not using full texture height before expanding + width. + +Build 1.10.2-12.18.2.2110: + LexManos: + Special case not drooping snowballs for water and snow layers. Closes + #3326 + LexManos: Update readme to be a little more clear. + +Build 1.10.2-12.18.2.2109: + bs2609: Fix MC-105406 (OpenGL leak in View Frustum) (#3308) + +Build 1.10.2-12.18.2.2108: + mezz: Fix very laggy mipmap slider MC-64581 (#3305) + +Build 1.10.2-12.18.2.2107: + shadowfacts: Add Block#getStateForPlacement (#3129) + +Build 1.10.2-12.18.2.2106: + mezz: Add better key modifier behavior for GUI contexts (#3307) + +Build 1.10.2-12.18.2.2105: + tterrag1098: Make item repair recipe respect itemstack's getMaxDamage (#3295) + +Build 1.10.2-12.18.2.2104: + LexManos: Fix Tabbing issues with config classes. + LexManos: Fix infinite loop in dragon fight when the dragon is over the void. + +Build 1.10.2-12.18.2.2103: + LexManos: Initial pass a re-working the configuration system. Work in progress. + +Build 1.10.2-12.18.2.2102: + atomicblom+github: Allow all Forge Registries to work with ObjectHolder (#3220) + LexManos: @ObjectHolder will now inject null for dummied objects. Closes #3301 + cpw: + Revert "Another fix for registry substitutions. Closes #3212" + This reverts commit ec2977afc919c0f676f59977e6065148ea635f9e. + cpw: + Fix substitutions being broken after freezing - actually store the + original state in registry copies, not the computed state, which is + wrong because it only sees the sub, not the original. + cpw: + Add in missing test runner for a test. Fixes failing tests on jenkins, + hopefully. + +Build 1.10.2-12.18.2.2099: + LexManos: + Revert commits related to filtering proxy and Automatic Subscriber + annotations. Broke some existing setups, will require a annotation + definition change in 1.11. + +Build 1.10.2-12.18.2.2098: + mezz: Fix proxy injector filtering. (#3300) + +Build 1.10.2-12.18.2.2097: + LexManos: Bump version for new Recommended Build. + +Build 1.10.2-12.18.1.2096: + LexManos: Small Cleanup in example build.gradle. + LexManos: + Filter out proxy injectors for incorrect mods. Prevents mod classes + being initialized early when multiple mods are in the same source. + LexManos: + Introduce IContextSetter for events. This will set the active mod + container for events using the normal EventBus. Fixes improper warnings + from initializing mods using the new Registry events. Modders, you + should not use this as it has many performance implementations and if + abused will slow down the event bus A LOT. ActiveModContainer is not + thread safe. + +Build 1.10.2-12.18.1.2095: + mezz: Fix unbound keybindings are activated by unknown keyboard keys (#3288) + +Build 1.10.2-12.18.1.2094: + mmehnert: + caseSensitiveCustomCategories must be set before loading the + configuration file. (#3269) + Otherwise one set with categories in lowercase letters and on case + sensitive + +Build 1.10.2-12.18.1.2093: + tterrag1098: Fix typo in sky rendering causing tons of BlockPos allocations (#3267) + +Build 1.10.2-12.18.1.2092: + cpw: + Add in registry registration events, new subscription events you can use + to make sure you're registering things at the "best" time. + +Build 1.10.2-12.18.1.2091: + LexManos: + Add support for generic filtering of events. Please DO NOT use this in + performance sensitive environments where you will have tons of things + added to the listener list. If that's the case define sub-classes as + they have completely separate lists and will thus be more efficient when + firing the event. + +Build 1.10.2-12.18.1.2090: + lukas.tenbrink: + Fix roofed forests posting decoration events for small mushrooms rather + than big (#3259) + +Build 1.10.2-12.18.1.2089: + mattmess1221: + Add support for offhand bow aiming animation (#3085) + Vanilla allows you to use a bow in your offhand, but it's not visible to + others or in third person. + +Build 1.10.2-12.18.1.2088: + tehgeek: + Remove oredict for Bone Block recipe, stop white dye to bonemeal exploit + (#3255) + +Build 1.10.2-12.18.1.2087: + LexManos: + Fixed Biome.platFlower not being called when bonemealing grass. Closes + #3254 + +Build 1.10.2-12.18.1.2086: + latvianmodder: + Added getCommandMap() & getSortedCommandList() in CommandTreeBase + (#3251) + +Build 1.10.2-12.18.1.2085: + atomicblom+github: New event to allow mutating a baby entity based on it's parents (#3227) + +Build 1.10.2-12.18.1.2084: + latvianmodder: Added CommandTreeBase (#3193) + +Build 1.10.2-12.18.1.2083: + paul.fulham0: Fix debug command creating empty file (MC-103399) (#3218) + +Build 1.10.2-12.18.1.2082: + marvinroesch99: Fix universal bucket not being returned in crafting recipes (#3234) + +Build 1.10.2-12.18.1.2081: + cpw: Create EnergySystems.md + +Build 1.10.2-12.18.1.2080: + LexManos: + Introducing a new standardized energy capability system. Heavily + inspired by the old RedstoneFlux API developed by King Lemming and Team + CoFH. + LexManos: Fix potential shading issue in GuiEditArrayEntries. Closes #3247 + +Build 1.10.2-12.18.1.2079: + LexManos: Fixed ItemStacks having ForgeCaps tag when no caps are serialized. + +Build 1.10.2-12.18.1.2078: + LexManos: Fix Cactus being able top be planted on incorrect soil. + +Build 1.10.2-12.18.1.2077: + bloodmc: Fix wrong var being used during getMaxSpawnPackSize check. (#3240) + +Build 1.10.2-12.18.1.2076: + LexManos: + Move dismount version of EntityMountEvent to Entity class. Should fix + canceling dismounting. Closes #3226 + +Build 1.10.2-12.18.1.2075: + LexManos: Yet another fix for stupid stairs. Closes #3224 + +Build 1.10.2-12.18.1.2074: + LexManos: Make StructureBlock TESRs always render. Closes #3222 + +Build 1.10.2-12.18.1.2073: + paul.fulham0: Fix item use stats (#3216) + +Build 1.10.2-12.18.1.2072: + LexManos: + Fixed decorate event being called with SHROOM type for both convered + trees and large mushrooms. Closes #3215 + +Build 1.10.2-12.18.1.2071: + LexManos: Another fix for registry substitutions. Closes #3212 + +Build 1.10.2-12.18.1.2070: + LexManos: Add legacy support for signature change of AddCallback. + LexManos: + Update gradle wrapper to 2.14, reference MC json, and add java6 compat + lines to default MDK build.gradle. + +Build 1.10.2-12.18.1.2069: + bonii-xx: Revert changes to ItemTool for binary compatibility (#3211) + +Build 1.10.2-12.18.1.2068: + bonii-xx: Expand getHarvestLevel to include player and blockstate (#3192) + +Build 1.10.2-12.18.1.2067: + LexManos: + Make enchantment tables spawn particles for any custom energy provider. + Closes #3208 + +Build 1.10.2-12.18.1.2066: + williewillus: Allow blocks to affect the beacon color (#3205) + +Build 1.10.2-12.18.1.2065: + LexManos: Fix armors rendering badly. Closes #3196 + +Build 1.10.2-12.18.1.2064: + abab9579: Fixed NPE from missing Capabilities (#3191) + +Build 1.10.2-12.18.1.2063: + LexManos: Fix World Capabilities NPE when there are no attached capabilities. + +Build 1.10.2-12.18.1.2062: + abab9579: Introduced Capabilities for World (#3069) + +Build 1.10.2-12.18.1.2061: + LexManos: + Fix vanilla bug in BlockFalling that caused blocks to loose state info + during world gen. Closes #3183 + +Build 1.10.2-12.18.1.2060: + Gerard Bruwn: Added PlayerBrewedPotionEvent (#3187) + +Build 1.10.2-12.18.1.2059: + cpw: Don't crash if you select a fake player + +Build 1.10.2-12.18.1.2058: + LexManos: + Skip searching for mods in the JAVA_HOME directory. Closes #2249 and + #2250 + +Build 1.10.2-12.18.1.2057: + LexManos: + Fix leather armor overlay not rendering when armor is pure white. Closes + #3184 + +Build 1.10.2-12.18.1.2056: + josephcsible: + Fix test mod IDs, names, and versions (#3122) + Most of our test mods have bad IDs (uppercase) and are missing names or + versions. Forge produces a bunch of warnings in the console about this, + which + +Build 1.10.2-12.18.1.2055: + florian: + Make InventoryHelper#spawnItemStack use ItemStack#splitStack to avoid + losing capability data. (#3163) + +Build 1.10.2-12.18.1.2054: + sebastian: + Unlike BakedQuad, UnpackedBakedQuad does not propagate the diffuse + lighting flag to Vertex Consumers. Made UnpackedBakedQuad conform to + BakedQuad's behavior. (#3181) + +Build 1.10.2-12.18.1.2053: + LexManos: + Set ModelLoader.WHITE's texture size iniatlly instead of defaulting to + zero and being set later. + LexManos: Add RenderTooltipEvent (#3034) + +Build 1.10.2-12.18.1.2052: + tehgeek: + Fix #3165 Dispensers with buckets can destroy fluid handler blocks + (#3180) + +Build 1.9.4-12.17.0.2051: + tterrag1098: Add RenderTooltipEvent (#3034) + +Build 1.10.2-12.18.1.2050: + LexManos: Fix Fire not using getFireSpreadSpeed. Closes #3175 + +Build 1.10.2-12.18.1.2049: + LexManos: Fix issue with stairs. + +Build 1.10.2-12.18.1.2048: + LexManos: Removed unintentional functionality when using the Splash Screen. + +Build 1.10.2-12.18.1.2047: + LexManos: Make stair culling use actual state, and be more robust. Closes #3170 + LexManos: Fix name in legacy support in registry changes. + LexManos: + Compleetly skip FML handshake for Vanilla connections. Should fix race + condition. Closes #3084 + LexManos: + Disable DecorateEventDebug by default. Prevents me thinking that + decoration is broken >.< + +Build 1.10.2-12.18.1.2046: + AlgorithmX2: + Fix Vertex Transformer for breaking models (#3132) + * Add setTexture to IVertexConsumer and propagate it. + +Build 1.10.2-12.18.1.2045: + LexManos: + Restone binary compatibility with registry substitution rework. Modders + please switch to using the provided RegistryBuilder to ensure more + forward compatbility. Closes #3144 + LexManos: Fix Forge fluids not serializing properly. Closes #3152 + +Build 1.10.2-12.18.1.2044: + LexManos: + Second pass at fixing 'Dissapearing Doors' This now more robustly fixes + ALL uses of get and has slight performance improvements for itterable + states. Closes #3139 + +Build 1.10.2-12.18.1.2043: + LexManos: + Added config option to disable Forge's fix of Stair/Slab face culling. + Some vanilla resource packs exploit this issue in their custom models + causing unintended rendering issues. + +Build 1.10.2-12.18.1.2042: + LexManos: + Fixed 'Dissapearing Doors', An issue where the world would try to save + blockstates that are not serializeable. + +Build 1.10.2-12.18.1.2041: + cpw: Allow CommandEvent to change the parameter set. Closes #1762 + +Build 1.10.2-12.18.1.2040: + cpw: + Another pass at substitutions - now capable of fixing up ItemBlock to + point at the right block when a block is substituted, should also handle + substituting itemblocks. There's some hackery in the way we have to + change the value of ItemBlock.block, but it's not too egregious in my + opinion. + +Build 1.10.2-12.18.1.2039: + dakotapierone: Update decorate for biomes to support Decorate event + cpw: Clean up AT file + +Build 1.10.2-12.18.1.2038: + cpw: + Fix anvil output slots being wrong by adding new ones. Closes #3121 + without breaking existing mod workarounds for the badly ordered slots. + +Build 1.10.2-12.18.1.2037: + vincent.lee: + Expose vanilla brewing recipe registration (cherry picked from commit + 24bf163) + +Build 1.10.2-12.18.1.2036: + cpw: + Clean up some legacy settings, making sure there's translation strings. + Closes #2965 Thanks for the prompt Zaggy! + +Build 1.10.2-12.18.1.2035: + vincent.lee: Fix MC-91728 (cherry picked from commit 71f75bf) + cpw: Refresh patch after cherry pick (cherry picked from commit 71f75bf) + +Build 1.10.2-12.18.1.2034: + vincent.lee: + Remove sideonly on all other SoundType methods (cherry picked from + commit 46c7cac) + +Build 1.10.2-12.18.1.2033: + mnmiller1: + Fixed NeighborNotifyEvent not containing the piston facing direction. + (cherry picked from commit 5637c41) + +Build 1.10.2-12.18.1.2032: + AlgorithmX2: Use extended state for breaking models (#3086) + +Build 1.10.2-12.18.1.2031: + vincent.lee: No-nonsense getSoundType + cpw: Clean up block patch. Also push json update. + +Build 1.10.2-12.18.1.2030: + CreativeMD: Fixed sound paused/resume issue + +Build 1.10.2-12.18.1.2029: + alexandre.duponchel: FIX : IndexOutOfBoundException + +Build 1.10.2-12.18.1.2028: + cpw: Mark it for actual removal in 1.11 + cpw: Tidy up some more todos + cpw: + Fix #3126 - duplicate stat id error - don't use the "universal + iterators" in statbuilding, use the one without the duplicate entries. + (The duplicate entry one is for rendering setup) + +Build 1.10.2-12.18.1.2027: + cpw: + Fix a vanilla bug with the blockstate ID map not being properly + symmetric with respect to block.getStateFromMeta - closes #3012 properly + but probably has a random MCJIRA ticket somewhere too. + +Build 1.10.2-12.18.1.2026: + vincent.lee: Add ability for custom detector rail output + vincent.lee: Move to a hook in EntityMinecart + vincent.lee: Remove event stuff + +Build 1.10.2-12.18.1.2025: + mezz: Force mipmap even if textures are the wrong size + mezz: Add TextureDump forge test mod + +Build 1.10.2-12.18.1.2024: + vincent.lee: Add hand-specific render event + vincent.lee: Add missing cancelable + cpw: Rename the event to RenderSpecificHandEvent + +Build 1.10.2-12.18.1.2023: + josephcsible: Add CreateFluidSourceEvent to control infinite fluid sources + josephcsible: Add a test for CreateFluidSourceEvent + josephcsible: Use CreateFluidSourceEvent for mod fluids as well + +Build 1.10.2-12.18.1.2022: + mezz: Fix hotkey with default modifier loading wrong when modifier set to NONE + +Build 1.10.2-12.18.1.2021: + bernhard.bonigl: + Add shouldCauseBlockBreakReset callback to Item. This allows to keep + breaking blocks if the NBT or similar changes. + +Build 1.10.2-12.18.1.2020: + Mumfrey: Store member field mappings in the mapping table, possible fix for #3043 + +Build 1.10.2-12.18.1.2019: + cpw: + Something that needs to happen: warn people about bad modids- if they're + not lowercased, or if they're too long. + +Build 1.10.2-12.18.1.2018: + ezterry3: + Fix async race condition on new chunks (closes #3020) (#3090) + This patch fixes a race condition that sometimes caused a just generated + chunk + structures to + generated version + chunk. + This patch ensures when ProvideChunk calls LoadChunk synchronously we + always + condition without + already saved to disk. + Thus this should retain the async functionality from PR #2946 while + preventing + +Build 1.10.2-12.18.1.2017: + cpw: + Some test harness stuffs. Time to get the registry manager properly + tested. + cpw: + More tests. Substitutions now work, and a fix is included. *sigh* Closes + too many bugs to count. + cpw: Some more substitution tests. It seems like it's working as it should. + cpw: Some dummy block replacement tests - it seems they work correctly. + cpw: Add the new tests into the suite + cpw: + Some tweaks to ContainedDeps - it should extract to a file in + versionedMods directly, even if the tag in the jar has a subpath + element. It'll also skip if there is a matching filename in the main + mods dir. + +Build 1.10.2-12.18.1.2016-failtests: + cpw: Some more substitution tests. It seems like it's working as it should. + cpw: Some dummy block replacement tests - it seems they work correctly. + +Build 1.10.2-12.18.1.2014: + LexManos: + Added support for using static methods as event listeners, Register the + .class instead of an instance. And added an improvement to calltime + listener rebuilding. + +Build 1.10.2-12.18.1.2013: + cpw: Lets make a half-decent readme. Thanks to Rorax for the install video! + +Build 1.10.2-12.18.1.2012: + mezz: Add Forge fluid handler test + +Build 1.10.2-12.18.1.2011: + LexManos: Bump version for a RB + +Build 1.10.2-12.18.0.2010: + bernhard.bonigl: + Add an event that allows to modify the looting level based on damage + source + +Build 1.10.2-12.18.0.2009: + williewillus: Add throwable impact event (#3071) + +Build 1.10.2-12.18.0.2007-1.10.0: + LexManos: + Fix hopper extract behavior being broken on edge cases due to + IItemHandler capability. Closes #3062 + +Build 1.10.2-12.18.0.2006-1.10.0: + LexManos: + Fixed FPS graph and new debug lines not being rendered in Debug screen. + Closes #3054 + +Build 1.10.2-12.18.0.2005-1.10.0: + diesieben07: + Restore (buggy?) behavior of vanilla BlockPistonMoving and ignore drop + chance (#3052) + +Build 1.10.2-12.18.0.2004-1.10.0: + LexManos: + Fix villages generating to high when using a cusom sea level. Closes + #3050 + +Build 1.10.2-12.18.0.2003-1.10.0: + LexManos: + Forge will now load extra mods from mods/mod_list.json and + mods/mc_version/mod_list.json. As defined by the same json spec as + --modListFile. And now if repositoryRoot is prefixed with absolute: the + path will NOT be relative to the MC directory. + LexManos: + Update build.gradle to have single line for specifying minecraft + version, and will update ForgeVersion.java as needed. + +Build 1.10.2-12.18.0.2002-1.10.0: + LexManos: + Fixed MC version number... I could of SWORN we removed this in favor of + a automated system... + +Build 1.10.2-12.18.0.2001-1.10.0: + LexManos: 1.10.2 Update + +Build 1.10-12.18.0.2000-1.10.0: + diesieben07: + Fix mob-spawners crashing for non-living entities and simply the patch + in the process (#3042) + +Build 1.10-12.18.0.1999-1.10.0: + mezz: + Fix legacy handling for ItemBucket subclasses and non-universal buckets + (#3038) + mezz: + Fix milk bucket is fillable with water or lava when milk is unregistered + (#3039) + +Build 1.10-12.18.0.1998-1.10.0: + mezz: Remove duplicated universal buckets from the creative list (#3035) + mezz: Fix FluidContainerRegistry handling potions as water bottles (#3037) + +Build 1.10-12.18.0.1997-1.10.0: + cpw: + Big warning for recipe types found without being registered, it turns + out this is pretty severe, modders need to fix it. + +Build 1.10-12.18.0.1996-1.10.0: + mezz: + Fix comparison stability of the Recipe Sorter with unknown recipes #2962 + (#3030) + +Build 1.10-12.18.0.1995-1.10.0: + LexManos: Fixed Husks rendering as standard zombies. Closes #3028 + +Build 1.10-12.18.0.1994-1.10.0: + LexManos: Fixed chests being replaced when trees grew. + +Build 1.10-12.18.0.1993-1.10.0: + luacs1998: Simple implementation of a Open/Close container event (#3017) + +Build 1.10-12.18.0.1991-1.10.0: + LexManos: + Fixed shifted patch in GameSettings causing settings to not load + properly. Closes #3025 #3022 + LexManos: Fixed incorrect variable being sent to doSpecialSpawn. Closes #2986 + LexManos: Fix incorrect logic in ChunkCache.isSideSolid. Closes #3026 + LexManos: Provide 'cleaner' version of TextureMap.setTextureEntry. Closes #1385 + +Build 1.9.4-12.17.0.1990: + LexManos: Fixed incorrect variable being sent to doSpecialSpawn. Closes #2986 + LexManos: Fix incorrect logic in ChunkCache.isSideSolid. Closes #3026 + +Build 1.10-12.18.0.1989-1.10.0: + cpw: Fix doors popping off solid sides. + +Build 1.10-12.18.0.1988-1.10.0: + cpw: Fix that the Missing blocks/items/registries prompt often got stuck. + +Build 1.9.4-12.17.0.1987: + LexManos: + Set ModelLoader.WHITE's texture size iniatlly instead of defaulting to + zero and being set later. + +Build 1.10-12.18.0.1986-1.10.0: + cpw: Fix Realms button text to be shorter again. Closes #3019 + +Build 1.10-12.18.0.1985-1.10.0: + cpw: Fix item pickup dupe bugs. Closes #3015 + +Build 1.10-12.18.0.1984-1.10.0: + blay09: + [1.10] Fix keys with KeyModifier failing to load (#3018) + Fix key options with KeyModifier failing to load due to + NumberFormatException + +Build 1.10-12.18.0.1983-1.10.0: + cpw: + Accept more 1.9.4 version strings. Fix NPE for custom villager types and + their associated zombie spawns. Still needs review. + +Build 1.10-12.18.0.1982-1.10.0: + mezz: Fix all guis closing as soon as they are opened (#3013) + +Build 1.10-12.18.0.1981-1.10.0: + cpw: Update to 1.10 + LexManos: Fix version number. + +Build 1.9.4-12.17.0.1980-1.10.0: + cpw: Fix the MDK - it gets the license too! + +Build 1.9.4-12.17.0.1979-1.10.0: + cpw: + Update the build.gradle script to ship the new license and stop shipping + the old licenses. + +Build 1.9.4-12.17.0.1978-1.10.0: + cpw: + In accordance with our stated goal of relicensing Forge to LGPL v2.1, + this commit enacts that change. Although it is using the 1.9.4 codebase, + it is intended that this branch become public with the 1.10 changes, as + such the license will take effect at that time. The three commits from + persons who have failed to accept the new license, as documented in + #2789, have had their commits reverted. This should complete the license + transition. Commits after the commit date of this commit should be + considered licensed by LGPLv2.1, as indicated in LICENSE-new.txt. All + patches are now considered owned by the Forge project and Forge + Development LLC in particular (note that they will not get the license + boilerplate, as they are machine generated files). + +Build 1.9.4-12.17.0.1976: + GirafiStudios: + Made forge-type spawn eggs spawn childs, when right clicking + EntityAgeable again. (#2982) + +Build 1.9.4-12.17.0.1975: + shadowfacts: Fix broken EntityItem merging for Items with capabilities + diesieben07: + Make ASMDataTable more useful: (#2911) + - EnumHolder now has getters for it's data + - enum arrays work now + - nested annotations work now outside of being in arrays + (cherry picked from commit f10f750) + +Build 1.9.4-12.17.0.1974-1.9.4: + diesieben07: + Make ASMDataTable more useful: (#2911) + - EnumHolder now has getters for it's data + - enum arrays work now + - nested annotations work now outside of being in arrays + +Build 1.9.4-12.17.0.1973: + mezz: Fix incorrect FluidUtil doc (#2996) + +Build 1.9.4-12.17.0.1972: + mezz: Fix ItemStack deserialization can't clear nbt (#3005) + mezz: Improve the "missing mods" on-screen error message (#2997) + +Build 1.9.4-12.17.0.1970: + cpw: Update CONTRIBUTING.md + +Build 1.9.4-12.17.0.1969: + cpw: Update CONTRIBUTING.md + +Build 1.9.4-12.17.0.1968: + mezz: Fix #2918 Make dispensers with buckets work with modded fluids (#2947) + +Build 1.9.4-12.17.0.1967: + LexManos: Fixed brewing stand returning incorrect solts for side inventories. + +Build 1.9.4-12.17.0.1966: + LexManos: Fixed villager career display names being off by one. + +Build 1.9.4-12.17.0.1965: + diesieben07: + Fix DataParameter mixup when vanilla clients are connected causing CCE + in zombie renderer (#2992) + +Build 1.9.4-12.17.0.1964: + williewillus: Fix AnimationItemOverrideList not falling back to super (#2990) + +Build 1.9.4-12.17.0.1963: + mezz: + Fix #2961 Capability data is not preserved by fluid handler interactions + (#2976) + +Build 1.9.4-12.17.0.1962: + cpw: Slight tweak to early loading, to accommodate FMP + +Build 1.9.4-12.17.0.1961: + LexManos: + Fixed Fernflower decompile issue in AnvilChunkLoader.saveExtraData() + Closes #2985 + +Build 1.9.4-12.17.0.1960: + cpw: + Mute the connection reset by peer exception - it's spamilicious for the + most part. + +Build 1.9.4-12.17.0.1959: + cpw: Fix missing IMC message query. + +Build 1.9.4-12.17.0.1958: + man.of.j: Read a Update JSON in UTF-8 (#2978) + +Build 1.9.4-12.17.0.1957: + williewillus: Add getter for the world to LootContext (#2954) + +Build 1.9.4-12.17.0.1956: + gurreja: Fixed arrows not showing in non default AchievementPages (#2968) + +Build 1.9.4-12.17.0.1955: + mezz: Add methods to Fluid to allow custom vaporization overrides (#2959) + +Build 1.9.4-12.17.0.1954: + fry: Fixes #1984. + +Build 1.9.4-12.17.0.1953: + fry: + Modified SimpleModelState to ignore the parts it doesn't know about. + Fixes model part hiding always applying to some models when + transformations are specified in the blockstate json. + +Build 1.9.4-12.17.0.1952: + fry: + Pass the GL context back from the splash screen during the + EntityRenderer init. + +Build 1.9.4-12.17.0.1951: + cpw: + Fire ChunkWatchEvent.Watch event, closes #2767. Based on @sfPlayer1 + patch suggestion. It looks like this logic has shifted relative to 1.8, + so there may be differences in event behaviour now. + +Build 1.9.4-12.17.0.1950: + minecrell: + Fix asynchronous chunk loading (#2946) + Since the update to Minecraft 1.9.4 chunks were actually never loaded + asynchronously because a sync request was always made from the + PlayerChunkMap shortly after the chunk had been queued. + + - PlayerChunkMapEntry now only loads chunks synchronously *after* the + chunk failed to load asynchronously. + - Fixed some minor bugs that caused "Attempted to dequeue chunk" + messages + - Simplified ChunkProviderServer patch. loadChunk no longer generates + chunks, + so there is no need to handle that. + - Moved loader and provider to ChunkIOProvider so there is no need for + "hashCode abuse" + +Build 1.9.4-12.17.0.1949: + mezz: + Make it easier to use FluidTanks that have input/output restrictions + (#2945) + These internal function should NOT be used by anything except the owner + of the tank. + +Build 1.9.4-12.17.0.1948: + LexManos: Fixed BiomeProvider.getModdedBiomeGenerators method name. Closes #2937 + +Build 1.9.4-12.17.0.1947: + williewillus: + Several bugfixes for PlayerInteractEvent (#2943) + * Don't change Result if setCanceled(false) called + + * Fix RightClickEmpty firing even when targeting a block or entity + + * Add a left click empty event + + * Move hook point for EntityInteractSpecific to the right place + + * Fix LeftClickBlock not firing clientside in creative, and clarify docs + about creative + +Build 1.9.4-12.17.0.1946: + mezz: + Add new IFluidHandler for capabilities. (#2942) + Old fluid system is deprecated and slated for removal in the next + cleanup cycle. + +Build 1.9.4-12.17.0.1945: + matti.j.ruohonen: + Add a Slot#isSameInventory() method (#2884) + This fixes shift + double clicking items in Containers that use + SlotItemHandler slots. + +Build 1.9.4-12.17.0.1944: + LexManos: + Fixed POTENTIAL issue where mods would query world infrom from TEs + before they are set. Closes #2863 + +Build 1.9.4-12.17.0.1943: + LexManos: + Fixed client side ticking TileEntites after they are unloaded. Closes + #2852 + LexManos: + Expanded custom villagers to Zombies and world gen. Fixed edge cases + where custom professiosn wernt being used correctly. Closes #2862 + +Build 1.9-12.16.0.1942-1.9: + ljfa-ag: Fix forge:default-tool transformation (#2795) + +Build 1.9.4-12.17.0.1941: + LexManos: Fixed position sent to sanSustainPlant from cactus. Closes #2941 + +Build 1.9.4-12.17.0.1940: + LexManos: + Forge will now warn the user and ask permission to load a world with + unknown registries. Closes #2934 + +Build 1.9.4-12.17.0.1939: + LexManos: Fix BlockFluidBase having collision. Closes #2932 + +Build 1.9.4-12.17.0.1937: + LexManos: + 1.9.4 Update. Major things to note: Class renames: + https://gist.github.com/LexManos/44dd211f90f498ad4015279b103dff86 Tile + Entities are now packed in the ChunkData packet. Forge intends to work + around this to better support large moded worlds, but for the time being + modders should implement the new function carefully and only send what + data they need to! Minecraft's codebase now has annotations, these are + directly from Mojang and should be adheared to! Added support for + package-info.java's containing @Nullable information for all MC code + base. + LexManos: Update mappoings snapshot to 20160518 + cpw: Fix schizophrenia in version numbers. + LexManos: Bump version information for 1.9.4. + LexManos: Update example mod for new mappings. + atomicblom: Add Unit Test to detect mismatches between EnumHelper and Enum ctor + cpw: + Tweak build file slightly - allow passing buildNumber using gradle + parameters (-PbuildNumber=...) and provide a "resetBuildNumber" function + to reset the buildNumber to zero in the ForgeVersion file. Means builds + can be reproducible in-IDE. + tterrag1098: Fix screenshot link paths on Windows (#2886) + LexManos: + Take capabilities into account when comparing ItemStack NBT's. Closes + #2726 + LexManos: + Tipped arrows are now not affected by infinite enchantment but are still + effected by creative mode. + LexManos: Set max enchantment ID to Short.MAX_VALUE. Closes #2799 + LexManos: + Fix Container.compouteStackSize not respecting stack version of + maxStackSize. Closes #2756 + LexManos: Fire playerDestroyItem event's in some cases where we were not. + LexManos: Fix villagers having farmer skin on vanilla servers. Closes #2894 + LexManos: Add alternative ItemAxe Constructor + LexManos: Fix paramters for addArmorMaterial, addOption and addGameType. + LexManos: + Make unit test for EnumHelper more robust and less spammy. Now detects + missing accessors as well. + the.f1repl4ce: Switch new constructor to use floats (#2904) + tterrag1098: Add hook for TE data sync on client (#2893) + cpw: + Strip Optional from the class signature as well, since that's loaded by + the TypeToken registry code and might cause a crash. + LexManos: + Fix installer downloading vanilla jar when not needed. And filter some + more known libraries. + LexManos: + Capture interfaces when scanning classes and preload implementations of + ICrashReportDetail. + LexManos: Set Enchantment table's harvest level. Closes #1349 + LexManos: + More uniformly apply Configuration.caseSensitiveCustomCategories. Closes + #1353 + LexManos: + Close player's inventory to prevent potential dupe issues on some modded + items. Closes #1431 + LexManos: + Move getArmorModel hook up two lines so that the attributes and + animation information is set. Closes #1939 + LexManos: Fire PopulateChunkEvent Pre and Post in ChunkProviderFlat. Closes #2050 + LexManos: Fire LivingSpawnEvents for MobSpawners. Closes #2079 + LexManos: Fix javadocs for BiomeColor events. Closes #2093 + LexManos: + Fixed EntityRegistry.addSpawn adding duplicate spawn entries. Closes + #2112 + LexManos: + Fix setTileEntity causing the world to remove the new and old tile + entities. Closes #2164 + LexManos: Add ServerHangWatchdog to TerminalTransformer whitelist. Closes #2203 + LexManos: Fixed NBTTagString.toString not properly escaping \'s. Closes #2393 + LexManos: + Reinitalize statistics information on Mapping changes. Fixes mismatched + stats to item/block ids. And auto registers stats for modded items. + Closes #2454 + LexManos: + Fix Thorns enchantment bypassing ISpecialArmor.damageArmor function. + Closes #2463 + LexManos: + Fix tooltip for survival tab in the creative menu not drawing on any but + the first page. Closes #2908 and #2504 + LexManos: + Make sure tool-classes for vanilla tools are initialized early. Closes + #2909 and #2525 + LexManos: + Fixed FluidUtil.tryEmptyFluidContainerItem not checking if the tank can + accept fluids first. Closes #2527 + LexManos: + Fixed potential issue with Chunk.getLightOpacity being called before the + chunk is added to the world map. Closes #2529 + LexManos: + Fixed TileEntityBeacon not using position-aware getLightOpacity. Closes + #2530 and #2910 + LexManos: Fixed village wells not having their biomes set. Closes #2499 + LexManos: + Fixed issue with @ObjectHolder and the new registry system. Closes #2640 + Only run static initalizers for classes we need to get the names from + values. + LexManos: + Fixed new ICrashReportDetail loader working with packaged mods by + delaying it until the ModContainer's construct event. Closes #2924 + fry: Reordered transformations during LayerHeldItem rendering, fixes #2827. + fry: + Initial support for model visibility system. Implemented it for OBJ, B3D + and normal vanilla models; fixed NPE accessing parent state in B3DModel. + Fixes #2801. + +Build 1.9.4-12.17.0.1935-1.9.4: + fry: Initial support for model visibility system. Implemented it for OBJ, B3D and normal vanilla models; fixed NPE accessing parent state in B3DModel. Fixes #2801. + +Build 1.9-12.16.1.1934: + mezz: + Improve JavaDoc links, fix some broken JavaDocs (#2833) + + Improve JavaDoc links, fix broken JavaDocs + +Build 1.9.4-12.17.0.1933-1.9.4: + fry: Reordered transformations during LayerHeldItem rendering, fixes #2827. + +Build 1.9.4-12.17.0.1932-1.9.4: + LexManos: Fixed new ICrashReportDetail loader working with packaged mods by delaying it until the ModContainer's construct event. Closes #2924 + +Build 1.9.4-12.17.0.1931-1.9.4: + LexManos: Fixed village wells not having their biomes set. Closes #2499 + LexManos: + Fixed issue with @ObjectHolder and the new registry system. Closes #2640 + Only run static initalizers for classes we need to get the names from values. + +Build 1.9.4-12.17.0.1930-1.9.4: + LexManos: Fix tooltip for survival tab in the creative menu not drawing on any but the first page. Closes #2908 and #2504 + LexManos: Make sure tool-classes for vanilla tools are initialized early. Closes #2909 and #2525 + LexManos: Fixed FluidUtil.tryEmptyFluidContainerItem not checking if the tank can accept fluids first. Closes #2527 + LexManos: Fixed potential issue with Chunk.getLightOpacity being called before the chunk is added to the world map. Closes #2529 + LexManos: Fixed TileEntityBeacon not using position-aware getLightOpacity. Closes #2530 and #2910 + +Build 1.9.4-12.17.0.1929-1.9.4: + LexManos: Fix Thorns enchantment bypassing ISpecialArmor.damageArmor function. Closes #2463 + +Build 1.9.4-12.17.0.1928-1.9.4: + LexManos: Fixed NBTTagString.toString not properly escaping \'s. Closes #2393 + LexManos: + Reinitalize statistics information on Mapping changes. + Fixes mismatched stats to item/block ids. And auto registers stats for modded items. + Closes #2454 + +Build 1.9.4-12.17.0.1927-1.9.4: + LexManos: Fire LivingSpawnEvents for MobSpawners. Closes #2079 + LexManos: Fix javadocs for BiomeColor events. Closes #2093 + LexManos: Fixed EntityRegistry.addSpawn adding duplicate spawn entries. Closes #2112 + LexManos: Fix setTileEntity causing the world to remove the new and old tile entities. Closes #2164 + LexManos: Add ServerHangWatchdog to TerminalTransformer whitelist. Closes #2203 + +Build 1.9.4-12.17.0.1926-1.9.4: + LexManos: Set Enchantment table's harvest level. Closes #1349 + LexManos: More uniformly apply Configuration.caseSensitiveCustomCategories. Closes #1353 + LexManos: Close player's inventory to prevent potential dupe issues on some modded items. Closes #1431 + LexManos: Move getArmorModel hook up two lines so that the attributes and animation information is set. Closes #1939 + LexManos: Fire PopulateChunkEvent Pre and Post in ChunkProviderFlat. Closes #2050 + +Build 1.9.4-12.17.0.1925-1.9.4: + LexManos: Fix installer downloading vanilla jar when not needed. And filter some more known libraries. + LexManos: Capture interfaces when scanning classes and preload implementations of ICrashReportDetail. + +Build 1.9.4-12.17.0.1924-1.9.4: + cpw: Strip Optional from the class signature as well, since that's loaded by the TypeToken registry code and might cause a crash. + +Build 1.9-12.16.1.1923: + shadowfacts: Pass the correct position into isSideSolid in BlockRailBase#canPlaceBlockAt (#2919) + +Build 1.9.4-12.17.0.1922-1.9.4: + tterrag1098: Add hook for TE data sync on client (#2893) + +Build 1.9.4-12.17.0.1921-1.9.4: + the.f1repl4ce: Switch new constructor to use floats (#2904) + +Build 1.9.4-12.17.0.1920-1.9.4: + atomicblom: Add Unit Test to detect mismatches between EnumHelper and Enum ctor + LexManos: Fix paramters for addArmorMaterial, addOption and addGameType. + LexManos: Make unit test for EnumHelper more robust and less spammy. Now detects missing accessors as well. + +Build 1.9.4-12.17.0.1918-1.9.4: + LexManos: Add alternative ItemAxe Constructor + +Build 1.9.4-12.17.0.1917-1.9.4: + LexManos: Fix villagers having farmer skin on vanilla servers. Closes #2894 + +Build 1.9.4-12.17.0.1916-1.9.4: + LexManos: Fire playerDestroyItem event's in some cases where we were not. + +Build 1.9.4-12.17.0.1915-1.9.4: + LexManos: Fix Container.compouteStackSize not respecting stack version of maxStackSize. Closes #2756 + +Build 1.9.4-12.17.0.1914-1.9.4: + LexManos: Set max enchantment ID to Short.MAX_VALUE. Closes #2799 + +Build 1.9.4-12.17.0.1913-1.9.4: + LexManos: Tipped arrows are now not affected by infinite enchantment but are still effected by creative mode. + +Build 1.9.4-12.17.0.1912-1.9.4: + tterrag1098: Fix screenshot link paths on Windows (#2886) + LexManos: Take capabilities into account when comparing ItemStack NBT's. Closes #2726 + +Build 1.9.4-12.17.0.1910-1.9.4: + cpw: Tweak build file slightly - allow passing buildNumber using gradle parameters (-PbuildNumber=...) and provide a "resetBuildNumber" function to reset the buildNumber to zero in the ForgeVersion file. Means builds can be reproducible in-IDE. + +Build 1.9.4-12.17.0.1909-1.9.4: + LexManos: Update example mod for new mappings. + +Build 1.9-12.16.1.1907: + bonii-xx: + Fix Bucket rendering and add sound (#2865) + + * Adjust generated quads from texture to take texture size into account #2858 + + * Fix universal bucket not passing through when rightclicking on a non-block + Add proper sound events when picking up modded fluids #2821 + + * Have FluidUtil execute properly on both sides and sync as expected. Add default sounds to interacting with tanks + + * Save sound for filling/emptying in the fluid + +Build 1.9-12.16.1.1906: + LexManos: Lets just simply this. Fixes last commit. + +Build 1.9-12.16.1.1905: + LexManos: Add modder facing API for Villager Career level trades. Ref: #2854 + +Build 1.9-12.16.1.1904: + cpw: Fix up release jsons to clean up extraneous netty references + fry: Extended Animation State Machine format to allow multiple transitions from one state. + +Build 1.8.9-11.15.1.1902-1.8.9: + cpw: Fix up release jsons to clean up extraneous netty references + +Build 1.9-12.16.1.1901: + cpw: Fix up release jsons to clean up extraneous netty references + +Build 1.9-12.16.1.1900: + LexManos: Make LootPool constructor public again. Closes #2847 + +Build 1.9-12.16.1.1899: + LexManos: Fix type in LootEntry json name. And rename LootTable.finalize to freeze to avoid overriding Object function. Closes #2846 and #2847 + +Build 1.9-12.16.1.1898: + fry: Fixed joint animation application correctly. + +Build 1.9-12.16.1.1897: + shadowfacts: + Add ScreenshotEvent (#2828) + + Add ScreenshotEvent + +Build 1.9-12.16.1.1896: + LexManos: + New LootTable interaction system and event. + Modders can now modify and reference internal elements of a loot table by name. + Editing can ONLY be done in the event and any external editing will cause a exception to be thrown. + See this gist for more information: https://gist.github.com/LexManos/77c983d67b9ad27010428478b66d50fd + +Build 1.9-12.16.1.1895: + fry: Fixed joint hierarchy not being used fully in the animation system. + +Build 1.9-12.16.1.1894: + LexManos: Fixed issue in ChunkIO that would potentially cause NPEs on chunks. Closes #2837 + +Build 1.9-12.16.1.1893: + LexManos: Fixed map extension recipie. + +Build 1.9-12.16.1.1892: + mezz: Fix the rand given to PopulateChunkEvent (#2834) + +Build 1.9-12.16.1.1891: + LexManos: Fix areas where dimension types are used as dimension IDs. + +Build 1.9-12.16.1.1889: + LexManos: Add NPE protection to in-hand item rendering. + +Build 1.9-12.16.1.1888: + mattmess1221: + Fix url regex (#2815) + + Fixed url detection in chat messages. Stops false positives such as `um.....no` + +Build 1.9-12.16.1.1887: + LexManos: Slightly better practice because wait can be randomly interupted. + LexManos: Bump version for new RB. + +Build 1.9-12.16.0.1886: + cpw: Don't ignore rejects + cpw: Add in mcp named patches and use them. Initial 1.9 setup. + cpw: Add rejects with mcp names for application to main codebase. Let's roll? + cpw: First few patches applied + LexManos: net.minecraft.block.* patches + LexManos: util, tileentity, stats, realms. Potions got an overhaul and out registry will need to be adapted. + LexManos: Some import renames and compile error fixes, killed ~800. + fry: Updated various block model patches. + fry: A bunch of rendering rejects updated. + fry: RendererLivingEntity, RenderEntityItem, RenderItem, RenderManager, LayerArmorBase; Item.getModel + ISmartItemModel are now inside ItemOverrideList; fix class rename in TESR patch. + fry: EntityRenderer, most of RenderGlobal, minor fix to LayerBipedArmor. + fry: tabs -> spaces. + fry: FontRenderer + fry: Fixed most errors in the model stuff, except for ModelLoader and b3d and obj getQuads/handleBlockState methods. + LexManos: Some entity patches. + CovertJaguar: Fix broken patches for EntityMinecart + LexManos: Items done, <1000 errors whoot! + LexManos: Small renames before bed. + fry: GuiCreateWorld, GuiSlot, GuiUtilRenderComponents, GuiContainerCreative + fry: GuiOverlayDebug, ItemModelMesher, RenderManager, Stitcher fixed + minor fixes in forge gui classes. + fry: removed Item.getModel, functionality is now achieveable via ItemOverrides. + fry: Updated raw types in ExtendedBlockState, fixed some ATs, updated some things that needed updating in model classes. + fry: Chunk + cpw: + DedicatedServer + IntegratedServer + Adubbz: + Updated the biome dictionary + + Squashed commits: + + [4064de6] Updated the biome dictionary + LexManos: Enchantments, some world, Biomes, bucks, world/gen/features. + Adubbz: Updated BiomeManager to 1.9 + LexManos: Delete reject files i missed + LexManos: More work on misc things. + LexManos: World Patches work. + fry: Fix various errors in text mods. + fry: Fixed B3D loader, fixed some obvious errors in ModelLoader. + cpw: + LanguageManager + NetHandlerPlayClient + fry: ModelBox, PositionTextureVertex, TexturedQuad. Does anyone really use those on the server? + cpw: + ServerPinger + PlayerList + cpw: + WorldServer: NOTE - ChestGenHooks has NOT been updated in accordance with plans for removing it + GuiStats + Fixup deletion of egg handling in entity registry? + fry: Removed generics from IModel subinterfaces, add ed ModelProcessingHelper instead. + fry: Model UV lock handling from the state to the model, fixed most compile errors in ModelLoader, disabled it (and ModelBakeEvent) until it's functional, fixed some errors in ForgeHooksClient. + fry: Made OBJModel.java compile. + LexManos: Fixed errrors in Fluids package. TODO: Make BlockLiquid implement IFluidBlock and REMOVE FluidContainerRegsitry. Everything *should* be able to use IFluidContainer directly. + LexManos: Fishing is now a loot table no more need for FishingHooks. {LootTables still need to be evaludated if they need extra hooks, but thats later} Goodbye 44 compile errors! + LexManos: Temporary hack to fix MCP mappings for param names we are using that is causing compile errors. + LexManos: NetworkDispatcher/FMLProxyPacket 41 more errors cleaned. + cpw: Some fixups for FML, and use the FML registry for potions + cpw: Some more FML related fixups + cpw: Fix up import in Potion + cpw: Some client handler cleanup + cpw: Remove two patches that aren't needed anymore + cpw: Command fixups + cpw: Few more compile fixups + LexManos: More patch work, client patches. + LexManos: + 10 more rejects down. + 98 errors 6 rejects left. + fry: World + fry: Most of ItemInWorldManager reject, various small error fixes. + cpw: Some more forge code fixes + cpw: + Another compilation fix + More patch tweaks for compilation errors. onItemUseTick takes an entity now, cos skellies use stuff too + cpw: More fixups, removing chestgenstuff aggressively. Use loot tables. Any missing ones WILL be added by Mojang. + cpw: Remove more chestgenhooks stuff. Clean up some more ATs + cpw: Potion cleanup. Moar fixes! + cpw: Finish world, chunkloading should work again? + cpw: Another AT, for the player + cpw: Fix up PlayerSP for the AT + LexManos: Interaction hooks need to be re-added but compiles {Doesn't run} + LexManos: + Added bypass functions to Defaulted registry, DO NOT USE THIS MODDERS FORGE INTERNAL ONLY. + And some other fixups for running. + LexManos: Bump version info. Rather important. + LexManos: Fixed position being shifted before being sent to shouldSideBeRendered. + fry: Fix perspective transformations for left-handed items, disable ModelAnimationDebug until model loading is fixed. + cpw: Fix race condition between server ticks and the netlogin code handshaking for FML + cpw: Move the patch into the fml override handler, for less patch + fry: Fix items rendering too low in first person. + fry: Fixed (hopefully) perspective transformations for custom models too. + cpw: Capture Biome Registry within FML + fry: Fixed emply hand not rendering in first person. + fry: Fixed incorrect rendering state caused by transparent rendering pass for entities. + fry: Fixed armor rendering + cpw: Switch to srg patches + fry: Updated to latest mappings. Exc is broken, some anonymous classes didn't map to srg names. + fry: Fixed some errors in forge.exc + fry: First version of updated of ModelLoader, mostly works. + fry: Big model loader refactoring: simplified a lot of things, broke some error reporting. Still generally works. + LexManos: Update patches for fixed inner class suffeling in srg files. + LexManos: We are based on 1.9 not 1.8.9 :D + LexManos: Delete mcp patches. + LexManos: PlayerManager updated. + LexManos: Fix digging blocks in survival. + LexManos: Fixed breaking of tall grass. It now uses fortune. Expanded grass seed hooks to allow Fortune. Potentially removing in future in favor of LootTables. + vazkii: + 1.9: Fixed registering armor materials through EnumHelper exploding + + 1.9 ArmorMaterial now requires a SoundEvent for the equip sound. + fry: Fixed model error reporting, fixed model errors in test mods that shouldn't happen, fixed custom texture loading, made more things private/final. + fry: Fixed incorrect rotations for items in the left hand. Closes #2548. + fry: Fixed incorrect culling of mod TESRs. + fry: Fixed EffectRenderer patch, closes #2547. + fry: Removed imports in patches. + fry: Fixed progress reporting for model loading. + fry: Javadocs, small cleanup. + LexManos: Remove our entity position fixer. Vanilla fixed the bug in 1.9. + LexManos: Fix vanilla bug where bows consumed tipped arrows in creative. + LexManos: Fixed onUseStop being called twice {Bows firing twice} + LexManos: Fixed Sand not falling. + LexManos: Fixed NPE when sneak using a item. + Adubbz: BlockColors and ItemColors no longer assume non-Vanilla id constancy. Added a getter for ItemColors. + fry: Fixed MultiLayerModel not getting correct submodels; Unified the gui lighting of normal and custom models - diffuse lighting is now done in the pipeline, no need for IColoredBakedQuad anymore. + fry: Fixed quads that don't need diffuse lighting getting it anyway. + LexManos: Fix AT lines. + fry: Fixed invalid index calculation in BakedQuadRetextured. + fry: Fixed Block.doesSideBlockRendering, closes #2564. + fry: Fixed outline shader rendering, closes #2560. + fry: Fixed sprite not being passed to the quad builder for custom models. + cordonfreeman: Fix for patch targetting the wrong field to change for failed pathfinding penalty + iTitus: + Fix the EntityPlayer patch + + In 1.8.9 the call goes to getDisplayNameString() so that any changes from the PlayerEvent.NameFormat event are being take into account. + In this patch the call goes to func_70005_c_() which is the getter for the GameProfile name. + I changed it back. + + Sorry if you do not want to accept it because it is a one-liner. + vincent.lee: Fix #2555 + diesieben07: Fix broken patch in EntityPlayer.updateRidden + blay09: + Fix KeyInputEvent only being fired if Keyboard.getEventKeyState() is false. + + It used to be called for both key-up and key-down states prior to 1.9, so I assume Vanilla's changes to F3 behavior broke the patch. + matthewprenger: Pass exceptions thrown in mod event buses back to FML to handle apropriately + vincent.lee: Fix double dropping of items. Closes #2549 + cpw: Ignore classes directory + cpw: Fix bucket test + diesieben07: Fix EntityList.func_188429_b not supporting mod-entities, fixes spawn eggs, fixes #2581 + CovertJaguar: Fix #2601 Minecart infinite acceleration + gigaherz: Fix a condition that caused the enchantment table to roll invalid enchantments. + fry: Switched animation system to capabilities, added animated item example, fixed state passing in MultiModel. + fry: Separated model classes to client and common packages. + fry: instance -> INSTANCE + vincent.lee: Expose IItemHandler on vanilla entities + fry: Implemented slightly more generic version of UVLock, re-enabled it for json models. Closes #2607. + fry: Removed blockCenterToCorner from TRSRTransformation constructor. Closes #2461. + fry: Ignore blocks/items with null registry name during model loading. Fixes NPE during resource reloading in worlds with removed blocks/items. + fry: Made VertexBuffer.sortVertexData cleanup pointers after it's done. Closes #2528. + fry: Added default left hand transforms for forge transform strings. Closes #2615. + elpatricimo: + Allow players sized smaller than 1 block to walk into small spaces + + Same as #2605 but for 1.9 branch + LexManos: Rework DimensionManager for new DimensionType enum, replaces the old provider registry. Also fixed save folder issues with dimensions. Closes #2570 + LexManos: Fix Chests not opening correctly with semi-solid blocks on top. + LexManos: Fixed Item.shouldCauseReequipAnimation hook. + LexManos: Add ShieldDecoration and Tipped arrows to recipe sorter. Closes #2613 + LexManos: Exclude jna from termal tansformer. + vincent.lee: Update according to suggestions + LexManos: Fix pushing players inside blocks. + LexManos: Make RenderLivingBase.add/remvoeLayer, Closes #2573 + LexManos: Added support for custom dyes with Banners. Closes #2596 + LexManos: Allow finite fluids to be drained correctly + LexManos: Make OreDictionary.initVanillaEntries() private so that dumb modders will stop calling it. + vincent.lee: Actually fix dupe drop + LexManos: Fix swap animations for sure this time. + fry: Added Capability.cast, to allow avoiding unchecked casts in ICapabilityProvider.getCapability + LexManos: Update FML Entity Spawn packet for 1.9's location change. Closes #2567 + LexManos: Fixed custom entities unique ids. + LexManos: Fix typo causing biomes to be generated in wrong chunks. Closes #2632 + fry: Show meaningful error if ModelLoaderRegistry is used before the missing model is initialized. + fry: Register the animation Capability. No idea how it worked before at some point. + iTitus: + Add flashing update notification icon made by @gigaherz, closes #2582 + + It is added to the "Mods" button in the main menu and to out-of-date mods in the mod list (there it replaces the "U"). + Also fixes a little typo. + diesieben07: Fix BlockCrops.getDrops not respecting new age methods (for beetroots) + diesieben07: Fix PopulateChunkEvent.Post not firing + LexManos: + New Builder class in BlockStateContainer. Makes building containers with both listed and unlisted properties cleaner. + Make all methods of BiomeGenBase$BiomeProperties public so that modders can use that class outside subclasses. + fry: Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos. + fry: Fixed isSideSolid causing infinite loops due to the call to getActualState. + fry: Removed LanguageRegistry and CollectionWrapperFactory. + fry: Removed RenderWorldEvent, encapsulated all public event fields. + fry: Made some more public fields either private or final. + fry: Disabled erroring block, fixed DynBucketTest.TestItem model. + mezz: + Make tooltips layout in the right direction, wrap if there is no room + + Same as #2649, but for Minecraft 1.9 + fry: Fixed diffuse lighting not being applied if forge lighting pipeline is disabled, closes #2651 + fry: Enabled diffuse lighting by default in UnpackedBakedQuad.Builder. + fry: Fixed crosshair always being white, closes #2653. + kashike: + Replace Forge's `BlockPos#getImmutable` method with the included `BlockPos#toImmutable` (func_185334_h), while keeping the override in PooledMutableBlockPos to prevent mutable leaks. + Also prevent a mutable blockpos leak in World#setTileEntity + gigaherz: Add wrapper methods for IStorage#readNBT/writeNBT. + mezz: Fix Block.getPickBlock returning an ItemStack with a null Item + fry: Prevent missing model from loading multiple times. + fry: Fixed StackOverflow caused by the previous commit, closes #2669. + LexManos: Fix EntityPlayer still running old armor logic. Closes #2670 + LexManos: Fix shrubs not generating correctly. Closes #2663 + LexManos: Fix bows not animating properly when picking up ammo while using. Closes #2672 + LexManos: Make NoteBlockEvent raw constructor protected to allow subclasses. Closes #2153 + LexManos: Fix landing particles not showing up. Cloes #2661 + shadowfacts: Forward ItemBlock#addInformation to Block#addInformation + tterrag1098: Add state param to canRenderInLayer + hea3venmc: Fix remapped blocks being overriden with dummy air blocks. Closes #2491 + cpw: + Squashed commit of the following: + + commit b3b290aec9d3010a134859da6001ea28a96c2fdc + Merge: c6ce6a0 d803f7d + Author: cpw + Date: Fri Mar 25 13:28:04 2016 -0400 + + Merge branch 'RegistryRework' of https://github.com/LexManos/MinecraftForge into LexManos-RegistryRework + + Implement proper registry slaves. Should help with rollback related issues. + + Missing patch + + commit d803f7db76f65db9d27302c9804a643bc853dc22 + Author: LexManos + Date: Tue Mar 22 03:36:14 2016 -0700 + + Update VillagerRegistry and use it. Should in theory make custom villagers work now. Using string version instead of int id for networking. + + commit eb5e5b4b42fdca26d2a104e4dc1e6a3ea3051a7b + Author: LexManos + Date: Tue Mar 22 02:14:16 2016 -0700 + + More cleanup. + + commit edbc56b2ff314629d0e402709f3cf29fc79c4a3d + Author: LexManos + Date: Tue Mar 22 02:05:23 2016 -0700 + + More cleanups, removed deprecated UniqueIdentifier {ResourceLocation now} + + commit e2df8d1be3c97601508f83dc97b0e8853fa1e271 + Author: LexManos + Date: Tue Mar 22 01:29:19 2016 -0700 + + Stupid generics.... + + commit 46d57dc4677fa5ff3923e64eaccfb33d7e5aad8d + Author: LexManos + Date: Tue Mar 22 01:00:25 2016 -0700 + + Some registry tweaking to provde a non-complicated API modders can use. + cpw: Reconcile Block.patch + cpw: + Add registries for soundevents, enchantments and potiontypes + MinecraftForge-2576 [1.9] SoundEvents (and Enchantments and PotionTypes) need a FML registry + cpw: MinecraftForge-2683 InvocationTargetException for Forge 1820 for 1.9 + cpw: MinecraftForge-2684 [1.9] New Registry ignores keys + fry: Improved UV offset hackery - should fix most visible custom model seams. + cpw: Support ResLocations for IMC + cpw: Capture a vanilla freeze - will be used when FML connects to vanilla servers, soon + LexManos: Fixed compile error in registry code with Eclipse. + mezz: + Add key binding modifiers and contexts. + + Same as #2674, but for Minecraft 1.9 + Adubbz: Fixed mismatch registry names and mod ids + LexManos: Properly deprecate and link the replacement methods in GameRegistry. Add helper method for registering a block with default ItemBlock because people keep complaining -.- + fry: Changed generic signature of GameRegistry.register methods to work around the type inference bug; updated all example mods to the new block/item registration method. + fry: + Revert "Add key binding modifiers and contexts.", until it's fixed. + + This reverts commit 34c3af7e853d578c8e17e1f0cdf886251fad74ae. + mezz: Re-Add key binding modifiers and contexts. + mezz: Fix inability to attack while holding modifier keys + mcjty1: + Added DimensionManager.createProviderFor() to WorldClient constructor similar to what is done + in WorldServer to make sure the correct provider is created client-side too. + AEnterprise: onBlockHarvested is no longer called twice + fry: Added the ability to change the printed model error count; Added printing of actual exceptions causing missing variants related to blockstate loading, closes #2689. + fry: Made both exceptions occuring during item model loading print in the log; closes #2696. + LexManos: Fix issue caused by setting spawnRadius to 0. Closes #2624 + LexManos: Fixed EntityJoinWorldEvent not being fired for some entitites on Server Worlds. Closes #2685 + LexManos: Fix improper logic in ItemHandlerHelper.giveItemToPlayer causing some items to not be added. Closes #2705 + mezz: + Add modifier support to vanilla keybindings. + + Add Orange conflict color for modifier/key conflicts + (like Ctrl and Ctrl-Z conflicting) + Related to #2692 + vincent.lee: Player Interact Event + Zaggy1024: Fixed using PlaySoundEvent to replace a sound with a PositionedSound causing an NPE due to the Sound field not being set by a call to ISound.createAccessor(SoundHandler). + fry: Fixed mod languages not being loaded on the server. + fry: Fixed some test mods not being marked as client-only. + iTitus: Fix dynbucket item transformation. + fry: Fixed zip being closed too early in the server language loading. + fry: Fixed forge fluid having a collision box. + kat.swales: Corrected CapabilityItemHandler.readNBT ignoring anything in slot 0 in 1.9 + mezz: Fix #2717 Pick block hotkey not working in inventories + mezz: Fix some plain keybinds not working when a modifier is active + LexManos: Enhance some error logging related to OBJLoader issues, and RegistryEntries. + LexManos: + Cleanup OBJLoader parse function and fix issues related to JVM differences. + Also fix support for sopme of the spec that was partially respected. + LexManos: Fixed NPE in dedicated server languages. And fixed logger for main FML event bus. + fry: Made forge fluids use smooth lighting. + kashike: + Remove @SideOnly(Side.CLIENT) from BossInfo/BossInfoServer methods + + These methods can also be used by the server (see BossInfoServer, it sends packets to the client but the methods are @SideOnly(Side.CLIENT)) + LexManos: Fix potential desync between Forge's Villager profession and vanilla's int based system. + LexManos: Fix being kicked from server when climbing ladders. + matti.j.ruohonen: Fix ForgeChunkManager world unloading check (#2736) + mezz: + Add cancelable event for Potions shifting the gui position (#2667) + + Add cancelable event for Potions shifting the gui position + matthewprenger: Don't use import static with net.minecraft classes. Using the latest MCP snapshots this causes an import conflict. (#2742) + CrafterKina: make WorldSavedData implement NBTSerializable (#2745) + mezz: Fix log spam from invalid key modifiers (#2746) + LexManos: Expose a central place to access all of Vanilla and Forge's registries using the new registry API. + iTitus: + Fix forge:default-block transformation. (#2760) + + The first-person left-hand rotation was a little bit of. + vincent.lee: + Boss bar render event (#2701) + + Allow control over increment height + LexManos: Fix NPE on shield break. Closes #2786 + cpw: Add the new license text. Not yet applicable to forge. + cpw: + Update LICENSE-new.txt + + Clarification on infectivity + cpw: + Update LICENSE-new.txt + + Words + cpw: + Update LICENSE-new.txt + + Better words + mezz: Close #2780 add CMD localization for Mac key bindings (#2792) + bonii-xx: + Fix SidedInvWrapper accessing wrong slots for setStackInSlot. (#2797) + + Fix DoubleChestItemHandler not implementing IItemHandlerModifiable + LexManos: Fix sluggish scrolling on GuiScrollList's and fix small rendering issue with scroll bar on certian screen sizes. + bloodmc: + Only run block physics for TileEntities while capturing block placement. (#2803) + + Currently, all blocks placed by players that are not TE's run physics + twice. Blocks that contain a TileEntity are not affected due to a check in + 'ForgeHooks.onPlaceItemIntoWorld'. + + In order to fix the problem, 'Chunk.setBlockState' will now verify if + blocks are being captured before running onBlockAdded and if so, only run + physics if the block has a tileentity. This check also prevents blocks such + as TNT's from running its physics (explosion) when event is cancelled. + williewillus: Add Potion.renderHUDEffect (#2798) + bloodmc: + Call markDirty when restoring blocks with TileEntities. (#2809) + + This change makes sure the updated tileentity is saved properly within the + chunk. + AlexIIL: Fix TextureMap failing when registering a sprite's resource location twice (#2785) + fry: Fixed custom fluid sufraces not rendering from the bottom. Closes #2800. + fry: Make ChunkRenderDispatcher.countRenderBuilders configurable. Closes #2775. + fry: Fixed cooldown overlay sometimes rendering opaque. Closes #2772. + fry: Fixed villager profession not being set correctly on the client, and fixed custom village texture rendering. Closes #2766. + LexManos: Fix withers breaking bedrock. Closes #2813 + LexManos: + Add a java version detection and nag system for users on Java 7 or below. + Added detection of mods that rely on Java 8 and a graceful error screen. + The nag screen will be shown once a day. It can be disabled by editing the forge.cfg. + However it is HIGHLY recomended that user update to Java 8. + LexManos: Remove usage of AsynchronousExecutor library in favor or a simpler implementation. + cpw: Merge in a fix from 1.8.9 for rails + +Build 1.9-12.16.0.1885-1.9: + LexManos: Remove usage of AsynchronousExecutor library in favor or a simpler implementation. + +Build 1.9-12.16.0.1884-1.9: + LexManos: + Add a java version detection and nag system for users on Java 7 or below. + Added detection of mods that rely on Java 8 and a graceful error screen. + The nag screen will be shown once a day. It can be disabled by editing the forge.cfg. + However it is HIGHLY recomended that user update to Java 8. + +Build 1.9-12.16.0.1883-1.9: + LexManos: Fix withers breaking bedrock. Closes #2813 + +Build 1.9-12.16.0.1882-1.9: + fry: Fixed villager profession not being set correctly on the client, and fixed custom village texture rendering. Closes #2766. + +Build 1.9-12.16.0.1881-1.9: + fry: Fixed cooldown overlay sometimes rendering opaque. Closes #2772. + +Build 1.9-12.16.0.1880-1.9: + fry: Make ChunkRenderDispatcher.countRenderBuilders configurable. Closes #2775. + +Build 1.9-12.16.0.1879-1.9: + fry: Fixed custom fluid sufraces not rendering from the bottom. Closes #2800. + +Build 1.9-12.16.0.1878-1.9: + AlexIIL: Fix TextureMap failing when registering a sprite's resource location twice (#2785) + +Build 1.9-12.16.0.1877-1.9: + bloodmc: + Call markDirty when restoring blocks with TileEntities. (#2809) + + This change makes sure the updated tileentity is saved properly within the + chunk. + +Build 1.8.9-11.15.1.1875: + bloodmc: + Call markDirty when restoring blocks with TileEntities. (#2807) + + This change makes sure the updated tileentity is saved properly within the + chunk. + +Build 1.9-12.16.0.1874-1.9: + williewillus: Add Potion.renderHUDEffect (#2798) + +Build 1.8.9-11.15.1.1873: + bloodmc: Fix wrong blockstate being passed to notifyNeighborsRespectDebug. (#2806) + +Build 1.8.9-11.15.1.1872: + bloodmc: + Only run block physics for TileEntities while capturing block placement. (#2805) + + Currently, all blocks placed by players that are not TE's run physics + twice. Blocks that contain a TileEntity are not affected due to a check in + 'ForgeHooks.onPlaceItemIntoWorld'. + + In order to fix the problem, 'Chunk.setBlockState' will now verify if + blocks are being captured before running onBlockAdded and if so, only run + physics if the block has a tileentity. This check also prevents blocks + such as TNT's from running its physics (explosion) when placement event is + cancelled. + +Build 1.9-12.16.0.1871-1.9: + bloodmc: + Only run block physics for TileEntities while capturing block placement. (#2803) + + Currently, all blocks placed by players that are not TE's run physics + twice. Blocks that contain a TileEntity are not affected due to a check in + 'ForgeHooks.onPlaceItemIntoWorld'. + + In order to fix the problem, 'Chunk.setBlockState' will now verify if + blocks are being captured before running onBlockAdded and if so, only run + physics if the block has a tileentity. This check also prevents blocks such + as TNT's from running its physics (explosion) when event is cancelled. + +Build 1.9-12.16.0.1870-1.9: + LexManos: Fix sluggish scrolling on GuiScrollList's and fix small rendering issue with scroll bar on certian screen sizes. + +Build 1.9-12.16.0.1869-1.9: + bonii-xx: + Fix SidedInvWrapper accessing wrong slots for setStackInSlot. (#2797) + + Fix DoubleChestItemHandler not implementing IItemHandlerModifiable + +Build 1.9-12.16.0.1868-1.9: + cpw: + Update LICENSE-new.txt + + Clarification on infectivity + cpw: + Update LICENSE-new.txt + + Words + cpw: + Update LICENSE-new.txt + + Better words + mezz: Close #2780 add CMD localization for Mac key bindings (#2792) + +Build 1.9-12.16.0.1867-1.9: + cpw: Add the new license text. Not yet applicable to forge. + +Build 1.9-12.16.0.1866-1.9: + LexManos: Fix NPE on shield break. Closes #2786 + +Build 1.9-12.16.0.1865-1.9: + vincent.lee: + Boss bar render event (#2701) + + Allow control over increment height + +Build 1.9-12.16.0.1864-1.9: + izooDee5: + Fix forge:default-block transformation. (#2760) + + The first-person left-hand rotation was a little bit of. + +Build 1.9-12.16.0.1863-1.9: + LexManos: Expose a central place to access all of Vanilla and Forge's registries using the new registry API. + +Build 1.9-12.16.0.1862-1.9: + LexManos: Fix log spam from invalid key modifiers (#2746) + +Build 1.9-12.16.0.1861-1.9: + LexManos: make WorldSavedData implement NBTSerializable (#2745) + +Build 1.9-12.16.0.1860-1.9: + LexManos: Don't use import static with net.minecraft classes. Using the latest MCP snapshots this causes an import conflict. (#2742) + +Build 1.9-12.16.0.1859-1.9: + LexManos: + Add cancelable event for Potions shifting the gui position (#2667) + + Add cancelable event for Potions shifting the gui position + +Build 1.9-12.16.0.1858-1.9: + LexManos: Fix ForgeChunkManager world unloading check (#2736) + +Build 1.9-12.16.0.1857-1.9: + LexManos: Fix being kicked from server when climbing ladders. + +Build 1.9-12.16.0.1856-1.9: + LexManos: Fix potential desync between Forge's Villager profession and vanilla's int based system. + +Build 1.8.9-11.15.1.1855: + LexManos: + Update ore dictionary (#2721) + + Updated the Ore Dictionary with more vanilla items: + -Prismarine Shard ( "gemPrismarine" ) + -Prismarine Crystals ( "dustPrismarine" ) + -Prismarine Block ( "blockPrismarine" ) + -Prismarine Brick ( "blockPrismarineBrick" ) + -Dark Prismarine ( "blockDarkPrismarine" ) + -Nether Wart ( "cropNetherWart" ) + -Sugarcane ( "sugarcane" ) + -Paper ( "paper" ) + -Ender Pearl ( "enderpearl" ) + -Bone ( "bone) + -Gunpowder ( "gunpowder) + -String ( "string" ) + -Nether Star ( "netherStar" ) + -Leather ( "leather" ) + -Feather ( "feather" ) + -Egg ( "egg" ) + -End Stone ( "endstone" ) + -Torch ( "torch" ) + -Vine ( "vine" ) + -Cactus ( "blockCactus" ) + -Grass ( "grass") + -Obsidian ( "obsidian" ) + -Red Sandstone ( added to "sandstone" ) + -Crafting Table ( "workbench" ) + -Slime Block ( "blockSlime" ) + -Granite ( "stoneGranite" ) + -Polished Granite ( "stoneGranitePolished" ) + -Diorite ( "stoneDiorite" ) + -Polished Diorite ( "stoneDioritePolished" ) + -Andesite ( "stoneAndesite" ) + -Polished Andesite ( "stoneAndesitePolished" ) + +Build 1.9-12.16.0.1854-1.9: + kashike: + Remove @SideOnly(Side.CLIENT) from BossInfo/BossInfoServer methods + + These methods can also be used by the server (see BossInfoServer, it sends packets to the client but the methods are @SideOnly(Side.CLIENT)) + +Build 1.9-12.16.0.1853-1.9: + fry: Made forge fluids use smooth lighting. + +Build 1.9-12.16.0.1852-1.9: + LexManos: Fixed NPE in dedicated server languages. And fixed logger for main FML event bus. + +Build 1.9-12.16.0.1851-1.9: + LexManos: Enhance some error logging related to OBJLoader issues, and RegistryEntries. + LexManos: + Cleanup OBJLoader parse function and fix issues related to JVM differences. + Also fix support for sopme of the spec that was partially respected. + +Build 1.9-12.16.0.1850-1.9: + mezz: Fix some plain keybinds not working when a modifier is active + +Build 1.9-12.16.0.1849-1.9: + mezz: Fix #2717 Pick block hotkey not working in inventories + +Build 1.9-12.16.0.1848-1.9: + kat.swales: Corrected CapabilityItemHandler.readNBT ignoring anything in slot 0 in 1.9 + +Build 1.8.9-11.15.1.1847: + kat.swales: Corrected readNBT ignoring anything in slot 0 + +Build 1.9-12.16.0.1846-1.9: + fry: Fixed zip being closed too early in the server language loading. + fry: Fixed forge fluid having a collision box. + +Build 1.9-12.16.0.1845-1.9: + iTitus: Fix dynbucket item transformation. + +Build 1.9-12.16.0.1844-1.9: + fry: Fixed some test mods not being marked as client-only. + +Build 1.9-12.16.0.1843-1.9: + fry: Fixed mod languages not being loaded on the server. + +Build 1.9-12.16.0.1842-1.9: + Zaggy1024: Fixed using PlaySoundEvent to replace a sound with a PositionedSound causing an NPE due to the Sound field not being set by a call to ISound.createAccessor(SoundHandler). + +Build 1.9-12.16.0.1841-1.9: + mezz: + Add modifier support to vanilla keybindings. + + Add Orange conflict color for modifier/key conflicts + (like Ctrl and Ctrl-Z conflicting) + Related to #2692 + +Build 1.9-12.16.0.1840-1.9: + vincent.lee: Player Interact Event + +Build 1.9-12.16.0.1839-1.9: + AEnterprise: onBlockHarvested is no longer called twice + LexManos: Fixed EntityJoinWorldEvent not being fired for some entitites on Server Worlds. Closes #2685 + LexManos: Fix improper logic in ItemHandlerHelper.giveItemToPlayer causing some items to not be added. Closes #2705 + +Build 1.9-12.16.0.1838-1.9: + LexManos: Fix issue caused by setting spawnRadius to 0. Closes #2624 + +Build 1.9-12.16.0.1837-1.9: + fry: Made both exceptions occuring during item model loading print in the log; closes #2696. + +Build 1.9-12.16.0.1836-1.9: + fry: Added the ability to change the printed model error count; Added printing of actual exceptions causing missing variants related to blockstate loading, closes #2689. + +Build 1.9-12.16.0.1835-1.9: + mcjty1: + Added DimensionManager.createProviderFor() to WorldClient constructor similar to what is done + in WorldServer to make sure the correct provider is created client-side too. + +Build 1.9-12.16.0.1834-1.9: + iTitus: + Add flashing update notification icon made by @gigaherz, closes #2582 + + It is added to the "Mods" button in the main menu and to out-of-date mods in the mod list (there it replaces the "U"). + Also fixes a little typo. + +Build 1.9-12.16.0.1833-1.9: + mezz: Fix inability to attack while holding modifier keys + +Build 1.9-12.16.0.1832-1.9: + mezz: Re-Add key binding modifiers and contexts. + +Build 1.9-12.16.0.1831-1.9: + fry: + Revert "Add key binding modifiers and contexts.", until it's fixed. + + This reverts commit 34c3af7e853d578c8e17e1f0cdf886251fad74ae. + +Build 1.9-12.16.0.1830-1.9: + fry: Changed generic signature of GameRegistry.register methods to work around the type inference bug; updated all example mods to the new block/item registration method. + +Build 1.9-12.16.0.1829-1.9: + Adubbz: Fixed mismatch registry names and mod ids + +Build 1.9-12.16.0.1828-1.9: + mezz: + Add key binding modifiers and contexts. + + Same as #2674, but for Minecraft 1.9 + +Build 1.9-12.16.0.1827-1.9: + LexManos: Properly deprecate and link the replacement methods in GameRegistry. Add helper method for registering a block with default ItemBlock because people keep complaining -.- + +Build 1.9-12.16.0.1826-1.9: + LexManos: Fixed compile error in registry code with Eclipse. + +Build 1.9-12.16.0.1825-1.9: + cpw: Capture a vanilla freeze - will be used when FML connects to vanilla servers, soon + +Build 1.9-12.16.0.1824-1.9: + cpw: Support ResLocations for IMC + +Build 1.9-12.16.0.1823-1.9: + fry: Improved UV offset hackery - should fix most visible custom model seams. + +Build 1.9-12.16.0.1822-1.9: + cpw: MinecraftForge-2684 [1.9] New Registry ignores keys + +Build 1.9-12.16.0.1821-1.9: + cpw: MinecraftForge-2683 InvocationTargetException for Forge 1820 for 1.9 + +Build 1.9-12.16.0.1820-1.9: + cpw: + Add registries for soundevents, enchantments and potiontypes + MinecraftForge-2576 [1.9] SoundEvents (and Enchantments and PotionTypes) need a FML registry + +Build 1.9-12.16.0.1819-1.9: + cpw: Fix remapped blocks being overriden with dummy air blocks. Closes #2491 + cpw: + Squashed commit of the following: + + commit b3b290aec9d3010a134859da6001ea28a96c2fdc + Merge: c6ce6a0 d803f7d + Author: cpw + Date: Fri Mar 25 13:28:04 2016 -0400 + + Merge branch 'RegistryRework' of https://github.com/LexManos/MinecraftForge into LexManos-RegistryRework + + Implement proper registry slaves. Should help with rollback related issues. + + Missing patch + + commit d803f7db76f65db9d27302c9804a643bc853dc22 + Author: LexManos + Date: Tue Mar 22 03:36:14 2016 -0700 + + Update VillagerRegistry and use it. Should in theory make custom villagers work now. Using string version instead of int id for networking. + + commit eb5e5b4b42fdca26d2a104e4dc1e6a3ea3051a7b + Author: LexManos + Date: Tue Mar 22 02:14:16 2016 -0700 + + More cleanup. + + commit edbc56b2ff314629d0e402709f3cf29fc79c4a3d + Author: LexManos + Date: Tue Mar 22 02:05:23 2016 -0700 + + More cleanups, removed deprecated UniqueIdentifier {ResourceLocation now} + + commit e2df8d1be3c97601508f83dc97b0e8853fa1e271 + Author: LexManos + Date: Tue Mar 22 01:29:19 2016 -0700 + + Stupid generics.... + + commit 46d57dc4677fa5ff3923e64eaccfb33d7e5aad8d + Author: LexManos + Date: Tue Mar 22 01:00:25 2016 -0700 + + Some registry tweaking to provde a non-complicated API modders can use. + cpw: Reconcile Block.patch + +Build 1.9-12.16.0.1817-1.9: + kashike: + Replace Forge's `BlockPos#getImmutable` method with the included `BlockPos#toImmutable` (func_185334_h), while keeping the override in PooledMutableBlockPos to prevent mutable leaks. + Also prevent a mutable blockpos leak in World#setTileEntity + gigaherz: Add wrapper methods for IStorage#readNBT/writeNBT. + LexManos: Fix landing particles not showing up. Cloes #2661 + shadowfacts: Forward ItemBlock#addInformation to Block#addInformation + tterrag1098: Add state param to canRenderInLayer + +Build 1.9-12.16.0.1816-1.9: + LexManos: Make NoteBlockEvent raw constructor protected to allow subclasses. Closes #2153 + +Build 1.9-12.16.0.1815-1.9: + LexManos: Fix EntityPlayer still running old armor logic. Closes #2670 + LexManos: Fix shrubs not generating correctly. Closes #2663 + LexManos: Fix bows not animating properly when picking up ammo while using. Closes #2672 + +Build 1.9-12.16.0.1814-1.9: + mezz: Fix Block.getPickBlock returning an ItemStack with a null Item + +Build 1.9-12.16.0.1813-1.9: + fry: Fixed StackOverflow caused by the previous commit, closes #2669. + +Build 1.9-12.16.0.1812-1.9: + fry: Prevent missing model from loading multiple times. + +Build 1.9-12.16.0.1811-1.9: + fry: Enabled diffuse lighting by default in UnpackedBakedQuad.Builder. + fry: Fixed crosshair always being white, closes #2653. + +Build 1.9-12.16.0.1810-1.9: + fry: Fixed diffuse lighting not being applied if forge lighting pipeline is disabled, closes #2651 + +Build 1.9-12.16.0.1809-1.9: + mezz: + Make tooltips layout in the right direction, wrap if there is no room + + Same as #2649, but for Minecraft 1.9 + +Build 1.8.9-11.15.1.1808: + mezz: + Make tooltips layout in the right direction, wrap if there is no room + + Fixes #2255 + +Build 1.9-12.16.0.1807-1.9: + fry: Disabled erroring block, fixed DynBucketTest.TestItem model. + +Build 1.9-12.16.0.1806-1.9: + diesieben07: Fix PopulateChunkEvent.Post not firing + +Build 1.9-12.16.0.1805-1.9: + fry: Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos. + fry: Fixed isSideSolid causing infinite loops due to the call to getActualState. + fry: Removed LanguageRegistry and CollectionWrapperFactory. + fry: Removed RenderWorldEvent, encapsulated all public event fields. + fry: Made some more public fields either private or final. + +Build 1.9-12.16.0.1804-1.9: + LexManos: + New Builder class in BlockStateContainer. Makes building containers with both listed and unlisted properties cleaner. + Make all methods of BiomeGenBase$BiomeProperties public so that modders can use that class outside subclasses. + +Build 1.9-12.16.0.1803-1.9: + diesieben07: Fix BlockCrops.getDrops not respecting new age methods (for beetroots) + +Build 1.9-12.16.0.1802-1.9: + fry: Show meaningful error if ModelLoaderRegistry is used before the missing model is initialized. + fry: Register the animation Capability. No idea how it worked before at some point. + +Build 1.9-12.16.0.1801-1.9: + LexManos: Fix typo causing biomes to be generated in wrong chunks. Closes #2632 + +Build 1.9-12.16.0.1800-1.9: + LexManos: Fixed custom entities unique ids. + +Build 1.9-12.16.0.1799-1.9: + LexManos: Update FML Entity Spawn packet for 1.9's location change. Closes #2567 + +Build 1.9-12.16.0.1798-1.9: + vincent.lee: Actually fix dupe drop + +Build 1.9-12.16.0.1797-1.9: + fry: Added Capability.cast, to allow avoiding unchecked casts in ICapabilityProvider.getCapability + +Build 1.9-12.16.0.1796-1.9: + LexManos: Fix swap animations for sure this time. + +Build 1.9-12.16.0.1795-1.9: + LexManos: Allow finite fluids to be drained correctly + LexManos: Make OreDictionary.initVanillaEntries() private so that dumb modders will stop calling it. + +Build 1.8.9-11.15.1.1794: + Choonster.2010: Allow finite fluids to be drained correctly + +Build 1.9-12.16.0.1792-1.9: + matthewprenger: Pass exceptions thrown in mod event buses back to FML to handle apropriately + vincent.lee: Fix double dropping of items. Closes #2549 + diesieben07: Fix EntityList.func_188429_b not supporting mod-entities, fixes spawn eggs, fixes #2581 + +Build 1.8.9-11.15.1.1791: + elpatricimo: + Fix pushing players inside blocks. + + same changes made to the 1.9 branch + +Build 1.9-12.16.0.1790-1.9: + vincent.lee: Expose IItemHandler on vanilla entities + vincent.lee: Update according to suggestions + +Build 1.9-12.16.0.1789-1.9: + LexManos: Make RenderLivingBase.add/remvoeLayer, Closes #2573 + LexManos: Added support for custom dyes with Banners. Closes #2596 + +Build 1.9-12.16.0.1788-1.9: + LexManos: Add ShieldDecoration and Tipped arrows to recipe sorter. Closes #2613 + LexManos: Exclude jna from termal tansformer. + LexManos: Fix pushing players inside blocks. + +Build 1.9-12.16.0.1787-1.9: + LexManos: Fix Chests not opening correctly with semi-solid blocks on top. + LexManos: Fixed Item.shouldCauseReequipAnimation hook. + +Build 1.9-12.16.0.1786-1.9: + elpatricimo: + Allow players sized smaller than 1 block to walk into small spaces + + Same as #2605 but for 1.9 branch + +Build 1.8.9-11.15.1.1785: + elpatricimo: Allow players sized smaller than 1 block to walk into small spaces + +Build 1.9-12.16.0.1784-1.9: + LexManos: Rework DimensionManager for new DimensionType enum, replaces the old provider registry. Also fixed save folder issues with dimensions. Closes #2570 + +Build 1.8.9-11.15.1.1783: + CovertJaguar: Add missing Minecart/Track hook. + +Build 1.9-12.16.0.1782-1.9: + fry: Removed blockCenterToCorner from TRSRTransformation constructor. Closes #2461. + fry: Ignore blocks/items with null registry name during model loading. Fixes NPE during resource reloading in worlds with removed blocks/items. + fry: Made VertexBuffer.sortVertexData cleanup pointers after it's done. Closes #2528. + fry: Added default left hand transforms for forge transform strings. Closes #2615. + +Build 1.9-12.16.0.1781-1.9: + fry: Switched animation system to capabilities, added animated item example, fixed state passing in MultiModel. + fry: Separated model classes to client and common packages. + fry: instance -> INSTANCE + fry: Implemented slightly more generic version of UVLock, re-enabled it for json models. Closes #2607. + +Build 1.9-12.16.0.1780-1.9: + gigaherz: Fix a condition that caused the enchantment table to roll invalid enchantments. + +Build 1.9-12.16.0.1779-1.9: + blay09: + Fix KeyInputEvent only being fired if Keyboard.getEventKeyState() is false. + + It used to be called for both key-up and key-down states prior to 1.9, so I assume Vanilla's changes to F3 behavior broke the patch. + +Build 1.9-12.16.0.1778-1.9: + CovertJaguar: Fix #2601 Minecart infinite acceleration + +Build 1.8.9-11.15.1.1777: + cordonfreeman: Fix for patch targetting the wrong field to change for failed pathfinding penalty + +Build 1.9-12.16.0.1776-1.9: + diesieben07: Fix broken patch in EntityPlayer.updateRidden + +Build 1.9-12.16.0.1775-1.9: + iTitus: + Fix the EntityPlayer patch + + In 1.8.9 the call goes to getDisplayNameString() so that any changes from the PlayerEvent.NameFormat event are being take into account. + In this patch the call goes to func_70005_c_() which is the getter for the GameProfile name. + I changed it back. + + Sorry if you do not want to accept it because it is a one-liner. + vincent.lee: Fix #2555 + +Build 1.9-12.16.0.1774-1.9: + cordonfreeman: Fix for patch targetting the wrong field to change for failed pathfinding penalty + +Build 1.9-12.16.0.1773-1.9: + cpw: Fix bucket test + +Build 1.9-12.16.0.1772-1.9: + bernhard.bonigl: + Fix CombinedInvWrapper accessing incorrect slots + Closes #2533 + +Build 1.9-12.16.0.1771-1.9: + cpw: Ignore classes directory + +Build 1.9-12.16.0.1770-1.9: + fry: Fixed sprite not being passed to the quad builder for custom models. + +Build 1.9-12.16.0.1769-1.9: + fry: Fixed outline shader rendering, closes #2560. + +Build 1.9-12.16.0.1768-1.9: + fry: Fixed Block.doesSideBlockRendering, closes #2564. + +Build 1.9-12.16.0.1767-1.9: + fry: Fixed invalid index calculation in BakedQuadRetextured. + +Build 1.8.9-11.15.1.1765: + bernhard.bonigl: + Fix CombinedInvWrapper accessing incorrect slots + Closes #2533 + +Build 1.8.9-11.15.1.1764: + abab9579: + Added EntityViewRenderEvent#FOVModifier + + Enables mods to modify raw FOV directly. + Avoids modifier limit from FOVUpdateEvent. + Aware of blocks which are needed for fov change related with materials. + +Build 1.8.9-11.15.1.1763: + mnmiller1: Added local click position to PlayerInteractEvent. + +Build 1.8.9-11.15.1.1762: + LexManos: + Fixed dummy blocks not being removed from registry on dedicated server correctly. Closes #2487 + Also added some more debug logs! + +Build 1.8.9-11.15.1.1761: + bernhard.bonigl: + Fix WordServer.canCreatureTypeSpawnHere not using Forge Events. + Followup of #2496 + +Build 1.8.9-11.15.1.1760: + agent-lego: + Increased actual maximum fuel burn time + + Increased actual maximum fuel burn time from 32767 to 2147483647. + Backwards compatible. + +Build 1.8.9-11.15.1.1759: + bernhard.bonigl: Fix WorldEvent.PotentialSpawns Event passing the list instance of the ChunkProvider to users + +Build 1.8.9-11.15.1.1758: + fry: ModelLoader: added verbose error logging showing items/blockstates associated with model locations; removed redundant cast leftover from ungenerified code; fixed up a couple of warnings. + +Build 1.8.9-11.15.1.1757: + cpw: Fix race condition when using indexed codec in a LAN server. Fixes spurious crash when LAN server is running. + +Build 1.8.9-11.15.1.1756: + cpw: Log when it's likely the indexedcodec is gonna fail, because of LAN server derps likely. Try and give some context for debuggers. + +Build 1.8.9-11.15.1.1755: + bernhard.bonigl: Fix universal bucket logging an exception + +Build 1.8.9-11.15.1.1754: + AlgorithmX2: Preserve ItemStack Caps when picking Items up. + AlgorithmX2: Test getLightOpacity(world,pos) in World as well as the chunk. + +Build 1.8.9-11.15.1.1752: + AlgorithmX2: In material Liquid Hooks. + +Build 1.8.9-11.15.1.1751: + diesieben07: Fix Potion.shouldRenderInvText + +Build 1.8.9-11.15.1.1750: + AlgorithmX2: + Fix bug with getLightOpacity based on TileEntities, + Capture getLightOpacity prior to removing the tile entity. + +Build 1.8.9-11.15.1.1749: + LexManos: Fix loading of world ID maps for worlds without dummy data. Closes #2477 + +Build 1.8.9-11.15.1.1748: + bernhard.bonigl: Fix customized bucket names not getting translated correctly + +Build 1.8.9-11.15.1.1747: + fry: Added default levels for fluid extended properties in fluid model. + +Build 1.8.9-11.15.1.1746: + bernhard.bonigl: Add universal bucket + +Build 1.8.9-11.15.1.1745: + LexManos: Fix chat formatting not surviving line wraps in chat messages. + +Build 1.8.9-11.15.1.1744: + diesieben07: Fix the entity shader hook + +Build 1.8.9-11.15.1.1743: + iLexiconn: Added hook to add entity spectator shader + +Build 1.8.9-11.15.1.1742: + ross: Workaround JDK-8087309: Constant folding "static final boolean" in boolean expressions is incomplete + +Build 1.8.9-11.15.1.1741: + LexManos: Protect BlockSnapshot and Chunk.getTileEntity from mutible BlockPos instances. Closes #2438 + +Build 1.8.9-11.15.1.1740: + LexManos: Fixed invalid parameters being sent to LivingSpawnEvent.CheckSpawn. Closes #2453 + LexManos: Fixed Entity.shouldRiderSit modifying game logic and not just rendering. Closes #2402 + LexManos: Fixed Block/Item.setRegistryName printing a incorrect warning when used. Closes #2398 + LexManos: Fixed vanilla bug where network clients would see incorrect break progress on blocks. Closes #2462 + LexManos: Fixed implementation of RenderEntityItem.shouldSpreadItems. Closes #2448 + LexManos: Fixed invalid item being passed to gatherCapabilities when itemstacks changed item. Closes #2445 + LexManos: Add missing classes to CrashReport preloading. Closes #2421 + LexManos: Fixed Block.onNeighborChange not being called for all axises. Closes #2428 + +Build 1.8.9-11.15.1.1739: + LexManos: Potential fix for NPE when using an item to open a slotless inventory. Closes #1354 + +Build 1.8.9-11.15.1.1738: + fry: Fix custom model loader reload hook not firing during registration. + +Build 1.8.9-11.15.1.1737: + fry: Fix incorrectly updated patch to ChunkCache. Related to #2451. + +Build 1.8.9-11.15.1.1736: + fry: Fix multiple registrations of reloading hooks in custom model loaders. + +Build 1.8.9-11.15.1.1735: + LexManos: Fix jar signer not applying to universal packed in the installer. + LexManos: Remove Mojang logger spam in EntityItem. + +Build 1.8.9-11.15.1.1734: + fry: Fix TRSRTransformation.toItemTransform. Closes #2425. + +Build 1.8.9-11.15.1.1733: + paul.fulham0: Fix #2321 + +Build 1.8.9-11.15.1.1732: + Mumfrey: Fix ASM SignatureReader choking on lambda signatures generated by JDT + +Build 1.8.9-11.15.1.1731: + fry: Revert binary-incompatible changes in models. + +Build 1.8.9-11.15.1.1730: + fry: Fix droppers not dropping. + +Build 1.8.9-11.15.1.1729: + fry: Added "gui3d" and "smooth_lighting" options to the forge blockstate. Implemented them for vanilla and B3D models. Added generic types to IModel subinterfaces, to simplify chaining. + fry: One day I will learn to include all required classes in the commit. + +Build 1.8.9-11.15.1.1727: + matthewprenger: Log unknown exceptions in commands. Resolves #2433 + +Build 1.8.9-11.15.1.1726: + fry: Fixed incorrect patch to GenLayer, causing large vanilla biomes to not work properly. + +Build 1.8.9-11.15.1.1725: + fry: Provide original armor model in the custom armor model hook. + +Build 1.8.9-11.15.1.1724: + fry: Fixed small bug in item extraction code. + +Build 1.8.9-11.15.1.1723: + fry: Fix NoSuchElementException in ModelBlockAnimation caused by empty event list. + +Build 1.8.9-11.15.1.1722: + LexManos: Bump version in prep for new Recomended Build. + +Build 1.8.9-11.15.0.1721: + LexManos: Loosen TileEntity's default hasCapability implementation. Modders should specifically opt in. + +Build 1.8.9-11.15.0.1720: + vikestepftb: + Add EntityTravelToDimensionEvent + + Resolve Merge Conflict + + Move event call inside conditional + +Build 1.8.9-11.15.0.1719: + fry: Fixed minor race condition between mouse clicks and TESR in the animation example. + +Build 1.8.9-11.15.0.1718: + fry: + Model animation system. + Main things of interest: + * IAnimationStateMachine - state machine for animations; can load + from json. + * AnimationTESR - automatic TESR for animated models. + * AnimationModelBase - same for entities. + * ITimeValue - time-varying value, used to control animation + parameters from code. + + * TESRs can now be batched - look at TESR.renderTileEntityFast + + TE.hasFastRenderer. + * RegionRenderCache is not accessible to TESRs and other client-side + logic - MinecraftForgeClient.getRegionRenderCache. + fry: Sometimes I forget how much trivial things are missing from Java 6. + +Build 1.8.9-11.15.0.1716: + t.tomkins: Fixed: BlockPos passed to isBeaconBase + rwtema: + Add IItemHandler capability + + Add the actual patches that I forgot. + + Add simple implementations of IStorage and the factory methods. + + Add ItemStackHandler. A simple IItemHandler implementaton. + + return nulls, not throw nulls. + + Move the vanilla wrappers to a separate class for now. + + Minor clean ups of VanillaWrapper code. + + Inline static methods. + + Add comments. + + Minor cleanup of code. + + Remove redundant size field and add a validate slot index method. + + Minor formatting issues. + + Break early If stacksize to insert is 0. + + Remove setByte() methods. + + Throw exception if IItemHandler can't be modifyed in NBT loading. + + Replace event handler with patches + + Add capability to mine cart inventory entities. + + Change formatting and registration of capability. + + Make InventoryPlayer implements IItemHandler because why not. Also added a field to allow mods that add additional player inventory space to publicly expose them. + + Reduce patch sizes + + Lazy initialization of the item handler for vanilla tiles. + + Minor formatting changes. + + Create a single vanilla chest item handler that will merge with adjacent chests when detected. Added hooks to reset the cached adjacent value when a block update is detected and when a chunk loads. + + Revert "Make InventoryPlayer implements IItemHandler because why not. Also added a field to allow mods that add additional player inventory space to publicly expose them." + + This reverts commit 306d4a37fd0e8c8a0754411c013b750dfe8e2c87. + + Fix furnace derp + + Replace double chest code with a simpler method. + + Vanilla wrappers implement IItemHandlerModifiable (since they are modifiable) + + Minor code cleanups + + Add an onContentsChanged() and onLoad() callback methods.to the default implementation. + + Add slot as a parameter in the callback method. + + Change IItemHandlerModifiable.setStackInSlot() to void, and added a note about not being intended for cross-mod use. + + Improve ItemStackHandler handling of errored NBT. + + Make the stacks array protected. + + Fix a lot of derps in SlotItemHandler. + + Fix derp in ItemStackHandler + + Clarify comments on IItemHandler + + ItemStackHandler no longer caches the stack array in local variable. + + Clean up the Chests code to make intentions clearer + + Vanilla hoppers have their cooldown activated when an item is inserted. Made this behavior part of an item handler (rather than the insertion code) + + Fix mistake in ItemStackHandler + + More documentation of potential edge cases in getStackInSlot() + + Make limit checking more resiliant. + LexManos: Fix J6 compile error in IItemHandler PR. + +Build 1.8.9-11.15.0.1715: + blay09: Fix items being dropped out of a GuiContainer when dealing with a slot outside of the xSize/ySize boundaries. + +Build 1.8.9-11.15.0.1714: + asiekierka: Fix #2388 + +Build 1.8.9-11.15.0.1713: + LexManos: Fix invalid ServerHangWatchdog patch causing it to not apply. + LexManos: + Restore OreDictionary.getOres(String, boolean) and doeOreNameExist(String) functions that went MIA in git merge issue. + Original Commit: https://github.com/MinecraftForge/MinecraftForge/commit/cd3bbfb02c9fcd4ce4bbf00f460dfdd6a386d107 + +Build 1.8.9-11.15.0.1712: + minecrell: Strip console formatting codes for Vanilla log file + +Build 1.8.9-11.15.0.1711: + iLexiconn: + Fixed makeItemStack ignoring stackSize + + Fixes #2376 + +Build 1.8.9-11.15.0.1710: + fry: Fixed error detection login in ModelLoader, reduced the maximum number of printed stack traces to 5 per domain. + +Build 1.8.9-11.15.0.1709: + LexManos: Fix Deobfusication transformer throwing verification errores in Eclipse development environments. + LexManos: Fix forge logging not working correctly in ForgeDev. + +Build 1.8.9-11.15.0.1708: + fry: Correctly handle error caused by missing/malformed bucket model definition file. + +Build 1.8.9-11.15.0.1707: + LexManos: Call deserialze on capabilities in ItemStack.setItem. Closes #2384 + +Build 1.8.9-11.15.0.1706: + LexManos: Fix ItemStacks not getting the parent capability provider from items. Closes #2383 + +Build 1.8.9-11.15.0.1705: + bartek.bok: Allow sleeping without bed + kashike: Skip hang detection on first run of the server hang watchdog + +Build 1.8.9-11.15.0.1703: + fry: Fixed missing model error reporting, made block and item variants sort before loading, to make the splash screen info more useful. + +Build 1.8.9-11.15.0.1702: + cpw: Fix spruce not growing properly + +Build 1.8.9-11.15.0.1701: + cpw: Fixed problem with LAN connections seeing the original ProxyPacket and consuming the first byte. Closes #2373 + +Build 1.8.9-11.15.0.1700: + cpw: Fix shouldRefresh not to be so over-eager about modded TEs. Should fix Packet21 causing a TE reset. + +Build 1.8.9-11.15.0.1699: + LexManos: Clone FML packet indexes if channel is not open. Fixes potential threading issue. + +Build 1.8.9-11.15.0.1698: + bernhard.bonigl: + Default bucket model is empty, allow bucket model without fluid. + This allows capsules, cans, bottles,... to use the same item model for their item variant. Also it's makes much more sense. + +Build 1.8.9-11.15.0.1697: + mezz: Add GuiScreenEvent.BackgroundDrawnEvent + +Build 1.8.9-11.15.0.1696: + cpw: + Fix problem which meant runtime deobf to MCP names wasn't working. SRG named mods located in the mods dir of a dev + environment will now load normally. + +Build 1.8.9-11.15.0.1695: + LexManos: + New Capability system allowing for more manageable world object features. + + When combined with @Optional this should address all issues of soft dependancy on mods/apis. + This also addresses the issue of dynamic functionality in TileEntities/Entities. + + Current capability providers: TileEntity, Entity, ItemStack + + Also added INBTSerializeable, a generic interface for game objects that can be written to/from NBT tags. + + Vanilla capabilities will be coming soon, mostly on request and review. + So start requesting capabiliteis on vanilla/Forge features. + +Build 1.8.9-11.15.0.1694: + LexManos: Fixed GuiWrongMinecraft having wrong Log file name. Closes #2348 + LexManos: Fix jline server console not showing colored text. Closes #2334 + LexManos: Fixed banners not droping the correct item when harvested using modded mechanics. Closes #2258 + +Build 1.8.9-11.15.0.1693: + LexManos: Remove dead code in JarDiscoverer. Closes #2346 + LexManos: Made WrongMinecraftVersionException and ModSortingException a bit easier to read in log files. Closes: #2345 + +Build 1.8.9-11.15.0.1692: + fry: Catch GROUND item transform type with the forge hook too. + +Build 1.8.9-11.15.0.1691: + fry: Implemented face culling for item models, improves performance slightly. Closes #2326 + +Build 1.8.9-11.15.0.1690: + vincent.lee: + Fix visual effect entity persisting longer than it should + + Fix derp + +Build 1.8.9-11.15.0.1689: + LexManos: Fixed issue with WorldServer.getTileEntities when being called with ranges that overlap chunks oddly. Closes #2350 + +Build 1.8.9-11.15.0.1688: + fry: Made block model loading bar more robust, and fixed the count. + +Build 1.8.9-11.15.0.1687: + fry: Added progress bar for the ModelLoader. + +Build 1.8.9-11.15.0.1686: + fry: Model loader improvements: adding custom data/textures to models that don't need them doesn't cause a error now, since it's common to put those in the defaults section of the blockstate json; you can get IModel associated with the variant now - using ModelLoaderRegistry.getModel; MultiLayerModel should now respect transformations applied to it, and respect part transformations. + fry: Derp. + +Build 1.8.9-11.15.0.1684: + cpw: STFU I know how to code. *shouts* get off my lawn! + +Build 1.8.9-11.15.0.1683: + cpw: Make the parent dir tree for the dep extractor + +Build 1.8.9-11.15.0.1682: + fry: Changed default implementation of Block.getExtendedState. Closes #2309. + +Build 1.8.9-11.15.0.1681: + fry: Fixed perspective transformation handling for fluid models, changed inventory fluid model to use unrotated still texture. + fry: Don't crash on exception during loading of item variants from blockstate jsons. + fry: Fixed implementation if IRetexturableModel in ItemLayerModel. Closes #2244. + fry: Java6 + Eclipse + Gradle strike again. + +Build 1.8.9-11.15.0.1677: + fry: Fixed invalid flow vector caching of still fluids. + +Build 1.8.9-11.15.0.1676: + fry: Fixed random offset not working properly for flatly-lit models. + +Build 1.8.9-11.15.0.1675: + cpw: Explicitly close the file. + +Build 1.8.9-11.15.0.1674: + cpw: + Add a simple ContainedDep mechanic- mods can contain other mods or libs, and can specify them using a manifest tag: "ContainedDeps". + This is a space separated (manifest standard) list of jar files that are to be extracted into the version specific directory. + + There's also a special system property "fml.skipContainedDeps" that will allow for runtime skipping of extraction of contained deps (a comma separated list, based on the file name). + +Build 1.8.9-11.15.0.1673: + LexManos: + Added new get/setRegistryName functions to Item and Block. + And helper functions in GameRegistry to allow for registering using those names automatically. + This is to simplify registration and get rid of the horrible hacks users are doing now with 'unlocalised names'. + +Build 1.8.9-11.15.0.1672: + cpw: Move substitution activation after id loading. This should fix the problem of null for existing object. + +Build 1.8.9-11.15.0.1671: + fry: SidedProxy now has sensible default values - nested ClientProxy and ServerProxy classes. + +Build 1.8.9-11.15.0.1670: + mattmess1221: Add links for messages and other commands + +Build 1.8.9-11.15.0.1669: + fry: Reverted Render registration changes due to them working. + +Build 1.8.9-11.15.0.1668: + fry: Fixed RenderingRegistry not working. Closes #2312. + fry: Nobody is left behind. + +Build 1.8.9-11.15.0.1666: + cpw: Fix that the dummy registry entries don't allow clients connecting to servers. Also fix that it repeatedly nags about missing stuff in the world. + +Build 1.8.9-11.15.0.1665: + LexManos: Fix boss health bar rendering when debug overlay is enabled. Closes #2328 + +Build 1.8.9-11.15.0.1664: + LexManos: Allow for default 1.8.8 mods to be loaded. Should be SRG compatible. + LexManos: Fix J6 compile issue with ModelFluid. + LexManos: Swap Mod and Realms button to fix new realms 'notification' icon. + +Build 1.8.9-11.15.0.1663: + fry: Restored transparency to the Forge logo. + +Build 1.8.9-11.15.0.1662: + fry: Updated the forge logo to a higher-quality GIF file. Closes #2276. + +Build 1.8.9-11.15.0.1661: + fry: Fixed broken leaky caching of OBJ models. + fry: Fixed wrong import. + +Build 1.8.9-11.15.0.1659: + fry: Caching of fluid models. Fixes #2145. + +Build 1.8.9-11.15.0.1658: + fry: TESRs registering in preinit don't break pistons anymore. Fixes #2298. + +Build 1.8.9-11.15.0.1657: + fry: Fixed color disabling not working for forge pipeline. Closes #2286. + +Build 1.8.9-11.15.0.1656: + fry: 1.8.9 update + +Build 1.8.8-11.15.0.1655: + mezz: Allow server to access Potion isBadEffect() + cpw: 1.8.8 initial work + cpw: regenerate reference patchset at patches.mcp. These will be used to generate a new patchtree under patches. + cpw: Test of mcp patching + cpw: + Patches and rejected patches. Note: some which had imports are not listed here because they need + to be refactored not to have imports. + Progress: https://gist.github.com/cpw/29695e426e2b122cf8ff + fry: Updated various rendering-related patches and classes to 1.8.8; forge still uses vecmath. + fry: Fix generics and error in the BlockState patch. + fry: FontRenderer + Item patch update; WorldVertexBufferUploader patch derp fix. + fry: IntegratedServer, World, EnumChatFormatting and EnumFacing + fry: WorldProvider, WorldType, WorldServer, WorldServerMulti + fry: EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes. + fry: BlockOre, BlockRotatedPillar, SoundManager, EntityPlayerSP, GuiScreen, GuiAchievements, GuiContainer, BlockModelRenderer, ContainerEnchantment, Slot updated manually and imports removed; GitSlot patch updated. + cpw: Delete rejects that I initially processed. + cpw: + LoadingScreenRenderer,Minecraft,GuiContainerCreative,PlayerControllerMP,LanguageManager,Locale,SimpleReloadableResourceManager,EntityList,EntityLivingBase,EntityWither,EntityMinecart,EntityPlayerMP + + NethanlderPlayClient patch is now in vanilla. The FMLCommonHandler future exception catcher is not needed anymore, it's in Util. The caching of player profiles is now in vanilla (SkinManager). + fry: Updated FML Gui methods to WorldRenderer API changes. + fry: EntityPlayer patch updated. + fry: GuiButton, GuiChat, GuiCreateWorld, GuiIngameMenu, ServerListEntryNormal, GuiStats rejects updated. + fry: RenderEntityItem, RenderPlayer, RendererLivingEntity, LayerArmorBase, ItemStack rejects fixed; changed Armor Layer hook to catch LayerBipedArmor only. + fry: ItemRenderer, RenderGlobal, StateMap, RenderItem rejects updated. + fry: TileEntity and TileEntityHopper rejects fixed, GuiOverlayDebug patch fixed. + fry: PlayerManager, PlayerProfileCache, ServerConfigurationManager, NetHandlerHandshakeTCP rejects fixed; ItemInWorldManager patch error fixed. + fry: ItemBlock, ItemBow, ItemMonsterPlacer, ItemReed, ItemSign rejects fixed. + fry: Manually updated WorldChunkManager, Chunk and BiomeDecorator patches, removed imports. + fry: TextureMap, TextureManager and Stitcher rejects fixed. + fry: EntityRenderer, StringTranslate rejects fixed. + fry: Overlay patch fix: use the correct block position. + cpw: + Enchantment,EnchantmentHelper,EntityEnderman,EntityZombie,EntityVillager,FurnaceRecipes,RecipeFireworks,RecipeRepairItem,NetworkSystem,S00PacketServerInfo + PotionEffect,StatList,Session,WeightedRandomChestContent,Explosion,ExtendedBlockStorage,SaveHandler. + + All NBT patches seem to have been merged upstream, so removing. The IntegratedServer and MinecraftServer pending queue changes also removed, as fixed upstream. + cpw: WorldGen rejects, lots of them. Couple of small fixes elsewhere. + cpw: Fix a newly missing AT. Remove all CL_ references. OBFID is gone. + cpw: All the patches done? Some code fixups.. It begins. + cpw: A few tweaks, things are starting to work now.. + fry: Model stuff: updated to generics, fixed various warnings, added handling of new perspective types. + cpw: Some generic and other warning cleanups + fry: ExtendedBlockState, Properties generic updates. + cpw: Remove a suppression + cpw: This should be everything needed to separate blocks and items completely. + fry: Implemented interpolation of TRSR transformations; B3D: added interpolation capabilities to B3DState, animated TESR example in ModelAnimationTest (pure TESR right now, no separation inside the example model between the static and dynamic parts right now). + kashike: Use the FMLSecurityManager checkPermission(Permission) method for context-based permission checks. Fixes #2067 + fry: B3D loader: removed 2 redundand null checks, changed constructor args to final to fix (java6?) inner arg error. + fry: Fix holes in generated item models. + fry: Removed face doubles from item models. + minecrell: Add jline-based console with colors and tab-completion + cpw: Fix a typesig that was broken + cpw: Re-add trove and vecmath. Mojang no longer ship them. + cpw: Use the 2.1 snapshot for FG + fry: Fixed forge lighting working incorrectly outside 0x1000000 coordinates. + cpw: Back to srgnames for patches. We should be starting to look OK now. + cpw: Small tweak to the OUT/ERR logger - should skip the Throwable stuffs now. + cpw: + Fix weird patch issue where the this FG commit: https://github.com/MinecraftForge/ForgeGradle/commit/2f0ca9921b961133689d29b807333241010a802d + breaks if the exact end of a line is a srgname. Not ideal, but should work. + cpw: Fix derpy fir trees in the taiga. So many patches. See if we can find any more mistakes?! + fry: Fixed NPE is B3D loader caused by the missing vertex normal; updated the example chest model - it's now has 2 meshes; Updated ModelAnimationDebug - it now uses the new chest model, renders the base with the static world renderer, and only the lid with the TESR. + cpw: Update mappings to 20151122. + LexManos: Update universal manifest for 1.8.8's json. + cpw: Cleanup Fluid deprecations stuff. + cpw: + OMG! Documentation? WUT? I haz lost my mind. + Also, Functional interface for IMC. Senders can send a classname implementing Guava's function, and receivers + will be able to get that function, and do, well, whatever, really. Probably best for those callback type + scenarios, connecting up APIs and stuffs. + cpw: Fix MDK for 1.8.8 using FG2.1 snapshot + cpw: Yeah, amount is NOT deprecated. + cpw: ONE EVENT BUS TO RULE THEM ALL AND IN THE DARKNESS FIRE THEM! + cpw: Deprecate it as well, because hey, it's redundant now. + cpw: Clean up some very long dead code. Bukkit hasn't existed in a very long time now. IASM never worked, and I'm not about to implement it. + cpw: Cleaning up some derpy names + cpw: More cleanups, some documentation, a bunch of deprecations. + lordillyohs: + Remove trailing */ in the build.gradle + + Signed-off-by: Anthony Anderson + cpw: Fix button and lever placement problem. Closes #2204 + cpw: Fix up a couple of patches, affected by the recent update + cpw: + Add .exc for StatList patch + + More tweaking + lumien231: Fixed: The Integrated Server not being stopped when exiting a singleplayer world to the main menu + cpw: Propogate AbortException. Closes #2206. Also fix tracing printstream when printStackTrace is called. + LexManos: Bump version for new Minecraft version. + LexManos: Fixed placing blocks on snow layers with more then one layer. + LexManos: Fixed Large mushrooms generating incorrectly. + LexManos: Removed IItemRenderer class, all functionality is possible with new rendering system. + LexManos: Compiler warnings pass, undeprecated SplashProgress related stuff. + cpw: Giant registry fixup + LexManos: Add chunk loading protection to WorldSever.getTileEntitiesIn, may prevent orphanced chunks and a CME in EntityPlayerMP. Note: The 'max' parameters are NON-inclusive. + cpw: Fix up blockstate rebuild. Closes #2221. Also fix formatting. IDEA has differences. Solved now. + bernhard.bonigl: Add a PotionRegistry to handle dynamic distribution and remapping of Potion IDs + cpw: Fix problem with spam from registry on loading a second world. Empty the staging. + cpw: Some tweaks - GameRegistry is modder facing API, so avoid having MC methods there. Fix a couple of registry bugs. + cpw: Fixup Jline integration + cpw: A few fixes + cpw: Allow entity selectors to select "." in entity names. Closes #2125 + cpw: Be noisy when API is in a coremod. It'll never work and modders should realize that fact. + cpw: + Fix language adapter loading. + + The language adapter is now properly picked up after the mod is loaded + on the classpath, fixing the ClassNotFoundException occurring before. + Also fixed some minor formatting and made it throw a full + RuntimeException on failure. + + Fix up some formatting + cpw: Most requested feature of all time? TileEntity init method called after it's ready to roll. remove all the if (firstTicks) + mark.a.woodman: + Initialize sources list + + Fixes crash NPE thrown by addFile() + cpw: Clean up chunk patch. + liach: Fix typo in `guava` + cpw: Add a flag to the modidremapping event. If the remapevent is because the registry is refreezing, it'll be true. + minecrell: + Improve the console command completer + + - Fix space after command getting removed when completing a + subcommand together with the command prefix + - Add support for completing without input (shows command list) + - Sort command completion results + - Fix console spamming command prefixes after closing the input stream + bernhard.bonigl: Add shouldRender() to Potions that allows to hide them completely in the inventory + LexManos: Remove MCP reference patches. + LexManos: Fixed colored leather armor, and custom armor textures. + fry: Fixed orientations of generated item faces. Fixes #2215. + fry: Workaround for https://github.com/google/guava/issues/738 + bx9j52xd: Fixed that oldLight is not being used. + LexManos: Fixed ModList GUI rendering incorrectly. Closes #2254 + LexManos: Add EMERALD and SILVERFISH to GenerateMinable event. Closes #1158 + LexManos: Deprecate int IDs in FluidRegistry. Modders should only ever use the String name. Also add a 'friendly' exception when attempting to get an ID for a unregistered fluid. Closes #1374 + LexManos: Fix wrong EventType passed for Emerald ore-gen. + AlgorithmX2: + Added doesSideBlockRendering to provide finer grain face culling. + Implemented for BlockStairs and BlockSlab. + cpw: Use ItemStack.hasEffect. closes #2230 + minzmann: Update PotionEffect.java.patch + cpw: Fix derpage when loading a 1.8 world, with persistent state being entirely ignored in that case. + AlgorithmX2: Add getHighlightTip allowing a item to override its displayed renderToolHightlight. + cpw: + A test for issue #1848. Please try this with any mods you can @ 1.8.8, and see if you still get log spam of any kind (not just the + log message from the issue either). + AlgorithmX2: Added addLandingEffects allowing mods to override landing particles, for blocks that require world information to determine textures. + LexManos: Fix enchanting applying the same enchantment multiple times. Closes #2273 + fry: + Preparations for the Animation system. + Changes to the Model API - IModelState now works with Optional. Handling of parts of the model is not optional, and coordinate space/result interpretation is up to the caller. IModel doesn't extend IModelPart by default anymore; MapModelState uses composition to achieve previous functionality, IModelPart implementations are disjoint now. Updated perspective handing to the new API, removed IPerspectiveState (MapModelState is now the same thing). Perspective transforms for the default fluid model. + fry: IModel can now depend on a variant definition (ModelResourceLocation); added MultiLayerModel - simple model that'll render correctly in multiple layers + example of using it. + fry: Fixed java6 errors in previous commit. + fry: Forge pipeline will now take original model lightmap into account, if present. + fry: Delayed quad list resolution in MultiModel, fixes NPE in MultiLayerModel. + fry: LightUtil.pack and .unpack now work correctly with unpacked arrays of size <4. + fry: Fix dependency resolution for models with custom data/textures. + jadran.kotnik: Fix client side commands adding parts of the color codes on autocomplete (prefix "7" and suffix "r"). + fry: Fixed NPE caused by accessing undefined layer in MultiLayerModel. + bernhard.bonigl: + Add a dynamic bucket model that displays the animated liquid contained + Has a config option (default off) that replaces the vanilla buckets with the forge bucket model + + New original bucket textures from mr_hazard + LexManos: + Fixed registry issues that prevented connecting to 1.8 Forge servers. + More precisely: Servers with missing registries default back to frozen version. + Throw descriptive error if we do not have any information. + LexManos: Fixed vanilla bug related to spawning entities on top of fences. Closes #2303 + cpw: Fix the channel handler naming. It now uses the standard netty namer for it, by careful use of cunning reflection. + cpw: Fix up persistent substitution. Should close #2259 + cpw: + Blocks are no longer erased from the registry if the mod isn't present. This means that modded blocks can potentially retain their IDs + even if they are temporarily not present in the game. Currently TileEntity data associated with the block is erased. + cpw: Try and fix registry NPE when substitution is active. + cpw: Capture ItemBlock remaps. + cpw: Actually use the delegate for the itemblock + cpw: Try and make sure active substitutions are immediately available in the block to item map. + fry: Added an ability to register custom item variants, not ending with "#inventory". Should allow grouping multiple item models into 1 blockstate json. + fry: Fixed random block position offset not applying correctly. + LexManos: Fix Button/Torch/Lever placement on stairs and slabs. Closes #2291 + diesieben07: Allow forge-type spawn-eggs to spawn child entities when clicking EntityAgeable + bernhard.bonigl: Add a hook for custom particle spawning for slimes + bernhard.bonigl: + Fix bucket replacement not loading the bucket model by itself if replacing buckets. + This happens when no other mod that uses the bucket model is present. + Also added a simple method for registering the bucket model, should give + modders an idea on how to use the general model. + +Build 1.8.8-11.15.0.1654-1.8.8: + bernhard.bonigl: + Fix bucket replacement not loading the bucket model by itself if replacing buckets. + This happens when no other mod that uses the bucket model is present. + Also added a simple method for registering the bucket model, should give + modders an idea on how to use the general model. + +Build 1.8.8-11.15.0.1653-1.8.8: + bernhard.bonigl: Add a hook for custom particle spawning for slimes + +Build 1.8.8-11.15.0.1652-1.8.8: + diesieben07: Allow forge-type spawn-eggs to spawn child entities when clicking EntityAgeable + +Build 1.8.8-11.15.0.1651-1.8.8: + LexManos: Fix Button/Torch/Lever placement on stairs and slabs. Closes #2291 + +Build 1.8.8-11.15.0.1650-1.8.8: + fry: Fixed random block position offset not applying correctly. + +Build 1.8.8-11.15.0.1649-1.8.8: + fry: Added an ability to register custom item variants, not ending with "#inventory". Should allow grouping multiple item models into 1 blockstate json. + +Build 1.8.8-11.15.0.1647-1.8.8: + cpw: Try and make sure active substitutions are immediately available in the block to item map. + +Build 1.8.8-11.15.0.1646-1.8.8: + cpw: Actually use the delegate for the itemblock + +Build 1.8.8-11.15.0.1645-1.8.8: + cpw: Capture ItemBlock remaps. + +Build 1.8.8-11.15.0.1644-1.8.8: + cpw: Try and fix registry NPE when substitution is active. + +Build 1.8.8-11.15.0.1643-1.8.8: + cpw: + Blocks are no longer erased from the registry if the mod isn't present. This means that modded blocks can potentially retain their IDs + even if they are temporarily not present in the game. Currently TileEntity data associated with the block is erased. + +Build 1.8.8-11.15.0.1642-1.8.8: + cpw: Fix up persistent substitution. Should close #2259 + +Build 1.8.8-11.15.0.1641-1.8.8: + cpw: Fix the channel handler naming. It now uses the standard netty namer for it, by careful use of cunning reflection. + +Build 1.8.8-11.15.0.1640-1.8.8: + LexManos: Fixed vanilla bug related to spawning entities on top of fences. Closes #2303 + +Build 1.8.8-11.15.0.1639-1.8.8: + LexManos: + Fixed registry issues that prevented connecting to 1.8 Forge servers. + More precisely: Servers with missing registries default back to frozen version. + Throw descriptive error if we do not have any information. + +Build 1.8.8-11.15.0.1638-1.8.8: + bernhard.bonigl: + Add a dynamic bucket model that displays the animated liquid contained + Has a config option (default off) that replaces the vanilla buckets with the forge bucket model + + New original bucket textures from mr_hazard + +Build 1.8.8-11.15.0.1637-1.8.8: + fry: Fixed NPE caused by accessing undefined layer in MultiLayerModel. + +Build 1.8.8-11.15.0.1636-1.8.8: + jadran.kotnik: Fix client side commands adding parts of the color codes on autocomplete (prefix "7" and suffix "r"). + +Build 1.8.8-11.15.0.1635-1.8.8: + fry: Fix dependency resolution for models with custom data/textures. + +Build 1.8.8-11.15.0.1634-1.8.8: + fry: LightUtil.pack and .unpack now work correctly with unpacked arrays of size <4. + +Build 1.8.8-11.15.0.1633-1.8.8: + fry: Delayed quad list resolution in MultiModel, fixes NPE in MultiLayerModel. + +Build 1.8.8-11.15.0.1632-1.8.8: + fry: IModel can now depend on a variant definition (ModelResourceLocation); added MultiLayerModel - simple model that'll render correctly in multiple layers + example of using it. + fry: Fixed java6 errors in previous commit. + fry: Forge pipeline will now take original model lightmap into account, if present. + +Build 1.8.8-11.15.0.1630-1.8.8: + LexManos: Fix enchanting applying the same enchantment multiple times. Closes #2273 + fry: + Preparations for the Animation system. + Changes to the Model API - IModelState now works with Optional. Handling of parts of the model is not optional, and coordinate space/result interpretation is up to the caller. IModel doesn't extend IModelPart by default anymore; MapModelState uses composition to achieve previous functionality, IModelPart implementations are disjoint now. Updated perspective handing to the new API, removed IPerspectiveState (MapModelState is now the same thing). Perspective transforms for the default fluid model. + +Build 1.8.8-11.15.0.1628-1.8.8: + AlgorithmX2: Added addLandingEffects allowing mods to override landing particles, for blocks that require world information to determine textures. + +Build 1.8.8-11.15.0.1627-1.8.8: + AlgorithmX2: Add getHighlightTip allowing a item to override its displayed renderToolHightlight. + +Build 1.8.8-11.15.0.1626-1.8.8: + cpw: + A test for issue #1848. Please try this with any mods you can @ 1.8.8, and see if you still get log spam of any kind (not just the + log message from the issue either). + +Build 1.8.8-11.15.0.1625-1.8.8: + minzmann: Update PotionEffect.java.patch + +Build 1.8.8-11.15.0.1624-1.8.8: + cpw: Fix derpage when loading a 1.8 world, with persistent state being entirely ignored in that case. + +Build 1.8.8-11.15.0.1623-1.8.8: + bernhard.bonigl: Add shouldRender() to Potions that allows to hide them completely in the inventory + +Build 1.8.8-11.15.0.1622-1.8.8: + minecrell: + Improve the console command completer + + - Fix space after command getting removed when completing a + subcommand together with the command prefix + - Add support for completing without input (shows command list) + - Sort command completion results + - Fix console spamming command prefixes after closing the input stream + +Build 1.8.8-11.15.0.1621-1.8.8: + cpw: Use ItemStack.hasEffect. closes #2230 + +Build 1.8.8-11.15.0.1620-1.8.8: + liach: Fix typo in `guava` + +Build 1.8.8-11.15.0.1619-1.8.8: + AlgorithmX2: + Added doesSideBlockRendering to provide finer grain face culling. + Implemented for BlockStairs and BlockSlab. + +Build 1.8.8-11.15.0.1618-1.8.8: + LexManos: Fix wrong EventType passed for Emerald ore-gen. + +Build 1.8.8-11.15.0.1617-1.8.8: + LexManos: Deprecate int IDs in FluidRegistry. Modders should only ever use the String name. Also add a 'friendly' exception when attempting to get an ID for a unregistered fluid. Closes #1374 + +Build 1.8.8-11.15.0.1616-1.8.8: + LexManos: Add EMERALD and SILVERFISH to GenerateMinable event. Closes #1158 + +Build 1.8.8-11.15.0.1615-1.8.8: + LexManos: Fixed ModList GUI rendering incorrectly. Closes #2254 + +Build 1.7.10-10.13.4.1614-1.7.10: + LexManos: Fix dispensers equipping armor on players in the wrong slot Closes #1649 + +Build 1.8.8-11.15.0.1613-1.8.8: + bx9j52xd: Fixed that oldLight is not being used. + +Build 1.8.8-11.15.0.1612-1.8.8: + fry: Workaround for https://github.com/google/guava/issues/738 + +Build 1.8.8-11.15.0.1611-1.8.8: + fry: Fixed orientations of generated item faces. Fixes #2215. + +Build 1.8.8-11.15.0.1610-1.8.8: + LexManos: Remove MCP reference patches. + LexManos: Fixed colored leather armor, and custom armor textures. + +Build 1.8.8-11.15.0.1609-1.8.8: + cpw: Add a flag to the modidremapping event. If the remapevent is because the registry is refreezing, it'll be true. + +Build 1.8.8-11.15.0.1608-1.8.8: + cpw: Clean up chunk patch. + +Build 1.8.8-11.15.0.1607-1.8.8: + mark.a.woodman: + Initialize sources list + + Fixes crash NPE thrown by addFile() + +Build 1.8.8-11.15.0.1606-1.8.8: + cpw: Most requested feature of all time? TileEntity init method called after it's ready to roll. remove all the if (firstTicks) + +Build 1.8.8-11.15.0.1605-1.8.8: + cpw: + Fix language adapter loading. + + The language adapter is now properly picked up after the mod is loaded + on the classpath, fixing the ClassNotFoundException occurring before. + Also fixed some minor formatting and made it throw a full + RuntimeException on failure. + + Fix up some formatting + +Build 1.8.8-11.15.0.1604-1.8.8: + cpw: Be noisy when API is in a coremod. It'll never work and modders should realize that fact. + +Build 1.8.8-11.15.0.1603-1.8.8: + mezz: Allow server to access Potion isBadEffect() + +Build 1.8.8-11.15.0.1602-1.8.8: + kashike: Use the FMLSecurityManager checkPermission(Permission) method for context-based permission checks. Fixes #2067 + +Build 1.8.8-11.15.0.1601-1.8.8: + cpw: Allow entity selectors to select "." in entity names. Closes #2125 + +Build 1.8.8-11.15.0.1600-1.8.8: + minecrell: Add jline-based console with colors and tab-completion + bernhard.bonigl: Add a PotionRegistry to handle dynamic distribution and remapping of Potion IDs + cpw: Some tweaks - GameRegistry is modder facing API, so avoid having MC methods there. Fix a couple of registry bugs. + cpw: Fixup Jline integration + cpw: A few fixes + +Build 1.8.8-11.15.0.1596-1.8.8: + cpw: Fix problem with spam from registry on loading a second world. Empty the staging. + +Build 1.8.8-11.15.0.1595-1.8.8: + lumien231: Fixed: The Integrated Server not being stopped when exiting a singleplayer world to the main menu + +Build 1.8.8-11.15.0.1594-1.8.8: + LexManos: Add chunk loading protection to WorldSever.getTileEntitiesIn, may prevent orphanced chunks and a CME in EntityPlayerMP. Note: The 'max' parameters are NON-inclusive. + cpw: Fix up blockstate rebuild. Closes #2221. Also fix formatting. IDEA has differences. Solved now. + +Build 1.8.8-11.15.0.1592-1.8.8: + cpw: Giant registry fixup + +Build 1.8.8-11.15.0.1591-1.8.8: + LexManos: Bump version for new Minecraft version. + LexManos: Fixed placing blocks on snow layers with more then one layer. + LexManos: Fixed Large mushrooms generating incorrectly. + LexManos: Removed IItemRenderer class, all functionality is possible with new rendering system. + LexManos: Compiler warnings pass, undeprecated SplashProgress related stuff. + +Build 1.8.8-11.14.4.1590-1.8.8: + cpw: Propogate AbortException. Closes #2206. Also fix tracing printstream when printStackTrace is called. + +Build 1.8.8-11.14.4.1589-1.8.8: + cpw: Fix up a couple of patches, affected by the recent update + cpw: + Add .exc for StatList patch + + More tweaking + +Build 1.8.8-11.14.4.1588-1.8.8: + cpw: Fix button and lever placement problem. Closes #2204 + +Build 1.8.8-11.14.4.1587-1.8.8: + lordillyohs: + Remove trailing */ in the build.gradle + + Signed-off-by: Anthony Anderson + +Build 1.8.8-11.14.4.1586-1.8.8: + cpw: Cleaning up some derpy names + cpw: More cleanups, some documentation, a bunch of deprecations. + +Build 1.8.8-11.14.4.1585-1.8.8: + cpw: Deprecate it as well, because hey, it's redundant now. + cpw: Clean up some very long dead code. Bukkit hasn't existed in a very long time now. IASM never worked, and I'm not about to implement it. + +Build 1.8.8-11.14.4.1584-1.8.8: + cpw: ONE EVENT BUS TO RULE THEM ALL AND IN THE DARKNESS FIRE THEM! + +Build 1.8.8-11.14.4.1583-1.8.8: + cpw: Fix MDK for 1.8.8 using FG2.1 snapshot + cpw: Yeah, amount is NOT deprecated. + +Build 1.8.8-11.14.4.1582-1.8.8: + cpw: + OMG! Documentation? WUT? I haz lost my mind. + Also, Functional interface for IMC. Senders can send a classname implementing Guava's function, and receivers + will be able to get that function, and do, well, whatever, really. Probably best for those callback type + scenarios, connecting up APIs and stuffs. + +Build 1.8.8-11.14.4.1581-1.8.8: + cpw: Cleanup Fluid deprecations stuff. + +Build 1.8.8-11.14.4.1580-1.8.8: + LexManos: Update universal manifest for 1.8.8's json. + +Build 1.8.8-11.14.4.1579-1.8.8: + fry: Fixed NPE is B3D loader caused by the missing vertex normal; updated the example chest model - it's now has 2 meshes; Updated ModelAnimationDebug - it now uses the new chest model, renders the base with the static world renderer, and only the lid with the TESR. + LexManos: Fix incorrect position passes to Block.getExplosionResistance from entities. + LexManos: Moved client side Block.onBlockDestroyed to after Item.onBlockDestroyed to match server order. + LexManos: Enable the normal ModList GUI in game. Use GL_SCISSOR to support the transparent in-game GUI. + Choonster.2010: BiomeManager: Fix off-by-one errors + LexManos: Fix bold font rendering, Unicode is 2x pixel density of normal. + LexManos: Fix invalid position passed to isAir/getLight in World.playAmbientSound + fry: Fixed forge lighting working incorrectly outside 0x1000000 coordinates. + fry: Implemented interpolation of TRSR transformations; B3D: added interpolation capabilities to B3DState, animated TESR example in ModelAnimationTest (pure TESR right now, no separation inside the example model between the static and dynamic parts right now). + fry: B3D loader: removed 2 redundand null checks, changed constructor args to final to fix (java6?) inner arg error. + fry: Fix holes in generated item models. + fry: Removed face doubles from item models. + fry: Fixed forge lighting working incorrectly outside 0x1000000 coordinates. + cpw: Update mappings to 20151122. + +Build 1.8-11.14.4.1577: + fry: Implemented interpolation of TRSR transformations; B3D: added interpolation capabilities to B3DState, animated TESR example in ModelAnimationTest (pure TESR right now, no separation inside the example model between the static and dynamic parts right now). + fry: B3D loader: removed 2 redundand null checks, changed constructor args to final to fix (java6?) inner arg error. + fry: Fix holes in generated item models. + fry: Removed face doubles from item models. + fry: Fixed forge lighting working incorrectly outside 0x1000000 coordinates. + +Build 1.8.8-11.14.4.1576-1.8.8: + cpw: Fix derpy fir trees in the taiga. So many patches. See if we can find any more mistakes?! + +Build 1.8.8-11.14.4.1575-1.8.8: + cpw: Small tweak to the OUT/ERR logger - should skip the Throwable stuffs now. + cpw: + Fix weird patch issue where the this FG commit: https://github.com/MinecraftForge/ForgeGradle/commit/2f0ca9921b961133689d29b807333241010a802d + breaks if the exact end of a line is a srgname. Not ideal, but should work. + +Build 1.8-11.14.4.1572: + LexManos: Fix invalid position passed to isAir/getLight in World.playAmbientSound + +Build 1.8-11.14.4.1571: + Choonster.2010: BiomeManager: Fix off-by-one errors + +Build 1.8-11.14.4.1570: + LexManos: Fix bold font rendering, Unicode is 2x pixel density of normal. + +Build 1.8-11.14.4.1569: + LexManos: Enable the normal ModList GUI in game. Use GL_SCISSOR to support the transparent in-game GUI. + +Build 1.8-11.14.4.1568: + LexManos: Fix incorrect position passes to Block.getExplosionResistance from entities. + LexManos: Moved client side Block.onBlockDestroyed to after Item.onBlockDestroyed to match server order. + +Build 1.7.10-10.13.4.1566-1.7.10: + scott: Add an event hook to allow overriding of fuels recognized by vanilla fuel handling. + +Build 1.8-11.14.4.1565: + lumien231: Fix Client Login Issue when logging into a non existent dimension + +Build 1.7.10-10.13.4.1564-1.7.10: + LexManos: Fixed skulls not placing on fences like vanilla {Vanilla is buggy -.-} Closes #2185 + +Build 1.8-11.14.4.1563: + LexManos: Bump version for Recomended Build. + +Build 1.8-11.14.3.1562: + LexManos: + Merge pull request #2179 from arideus101/patch-1 + + Fixed issue where custom colored armor wouldn't be colored. (reverted from commit dee0b2084b519419bbf97d8ad177204830ea2b07) + +Build 1.8-11.14.3.1561: + jasondoyle528: Allows Custom Armor Coloring to be done easily + +Build 1.8-11.14.3.1560: + gabizou: + Fix a possible NPE when checking supertypes of interfaces. Closes #2176. + + Signed-off-by: Gabriel Harris-Rouquette + +Build 1.8-11.14.3.1559: + bjoern: + Fix possible crash in EventBus + + There is currently no way to check if an event handler has been registered or not. + But when trying to unregister a not-registered event handler, Minecraft crashes with a NullPointerException. + This is a simple fix to prevent such crashes. + cpw: Fix substitutions for recipes and oredict recipes. Should mean that substitutions start working properly. + cpw: + OreDictionary will warn if there's an invalid ore being registered now, rather than just + using -1 and doing weird things with the list as a result. + cpw: Two more corner cases in the oredictionary. Should work for all cases now. + cpw: + Fix firing the remap event. It always fires now, and additionally fires when the registry reverts to frozen. + Most mods refer to the gameregistry for ids they care about, so this shouldn't affect anything significantly, + but if your mod was dependent on their being content in the remap event, and only acting on that content, + empty content means it's "reverted to frozen" state - the state at the start of the game. + +Build 1.7.10-10.13.4.1558-1.7.10: + cpw: + Fix firing the remap event. It always fires now, and additionally fires when the registry reverts to frozen. + Most mods refer to the gameregistry for ids they care about, so this shouldn't affect anything significantly, + but if your mod was dependent on their being content in the remap event, and only acting on that content, + empty content means it's "reverted to frozen" state - the state at the start of the game. + +Build 1.7.10-10.13.4.1557-1.7.10: + cpw: Two more corner cases in the oredictionary. Should work for all cases now. + +Build 1.8-11.14.3.1556: + LexManos: Fixed Open url confirm screen not showing URL. + LexManos: Fixed Stronghold Library not having anything in it's chests. + +Build 1.8-11.14.3.1555: + diesieben07: Fix GameData.findBlock + +Build 1.8-11.14.3.1554: + fry: Fixed anaglyph transformation not being applied in the forge lighting fully. + +Build 1.8-11.14.3.1553: + fry: Provide ItemCameraTransforms for vanilla models when possible. + +Build 1.8-11.14.3.1552: + fry: OBJ loader: reworked texture resolution: keys now have to start with #, like every other model loader; models without explicit library now work, remapping is possible by using the key "#OBJModel.Default.Texture.Name"; in addition to remapping by material name, remapping by texture name works too, like in other model formats. + +Build 1.8-11.14.3.1551: + fry: Performace fix for item rendering. + +Build 1.8-11.14.3.1550: + Choonster.2010: + Fix texture error message for broken textures + + -- Fixes #2100 + -- Iterates over badTextureDomains instead of missingTextures.keySet() + as a domain can have broken textures without any missing textures + +Build 1.8-11.14.3.1549: + fry: Obj loader: fix vertices shared between faces having the same attributed (uvs/normals). + the.f1repl4ce: Fixed a bug that caused the config option name to overlap with the selectable values when using GuiConfigEntries.SelectValueEntry, fixes #2114 + fry: OBJ model: use original vertex material when defining face. + fry: Fixed block color multiplier not being cached properly in the forge renderer, performance improvement. + LexManos: Merge FML and Forge lang file, and update crowdin project. + LexManos: + Redesign the ModList GUI to use a scrolling list for the main body content. + Allowing for larger information to be displayed. + URLs are auto-detected and now clickable. + Mod Logos are now centered, it looks better. + LexManos: + Introduce a new centralized version checking system. + Using the @Mod annotation mods can opt-in to a centrally controlled update system. + This is PURELY a notification system and will NOT automatically download any updates. + The End User can control which mods check for updates and disabel the system entirely using the Forge Config and GUI. + Format for the json the URL must point to is described here: https://gist.github.com/LexManos/7aacb9aa991330523884 + +Build 1.8-11.14.3.1543: + fry: Fix color multiplier applied incorrectly for items. + fry: OBJ loader: fixed another whitespace-related issue; removed unused "modifyUVs" property for now; added the "flip-v" property to switch between OpenGL-style and DirextX-style model UVs; fixed normals - they are now correct in-world, still a bit strange for the items; fixed normals a little bit for B3D models too. + +Build 1.7.10-10.13.4.1541-1.7.10: + cpw: + OreDictionary will warn if there's an invalid ore being registered now, rather than just + using -1 and doing weird things with the list as a result. + +Build 1.7.10-10.13.4.1539-1.7.10: + diesieben07: Fix CME when entities are spawned from EntityJoinWorldEvent + bernhard.bonigl: Fix Potion IDs above 127 + Abrar Syed: Update FG version to 2.0.2 + fry: Changed how the forge lighting system handles holey models for opaque blocks; it now mimics vanilla behaviour, which allows light to pass through them. + fry: Fix for the previous commit - transparent blocks were handled improperly. + glstillman: OBJLoader: Quick bandages to support/fix the new way that face/vertex normals are calculated, a very quick bandage to patch TextureCoordinates for the time being, and the Parser now uses a Pattern to split strings on whitespace instead of only splitting on " ". + cpw: Fix substitutions for recipes and oredict recipes. Should mean that substitutions start working properly. + +Build 1.8-11.14.3.1532: + fry: Fixed normal calculation for vanilla models, fixed the grass darkening and simular issues. + fry: More lighting fixes, flat lighting now works correctly for grass and torches. + +Build 1.8-11.14.3.1530: + fry: Fixed piston rendering (WorldRenderer offset wasn't applied); fixed TESR being registered too early in one of the debug mods. + +Build 1.8-11.14.3.1529: + glstillman: Fixed a bug with item model loading that would occur if ModelBakery.addVariantName() was called with the same string location parameter for 2 different items, and the string pointed to a location that didn't exist, where ModelLoader.loadAnyModel() would substitute the blockdefinition in for the item model, but wouldn't remove the original input location from the loadingModels list, which would cause the location from the second call to throw an IllegalStateException even though that location now has a model. + fry: + Perspective awareness for vanilla and multi models, fixes #2148. + Improved error handling in MultiModel. + fry: Fixed generic bug in MultiModel + fry: Fixed AO being applied to OBJ model transparency, and OBJ loader trying to force the loading of the builtin white texture. + fry: Provide a IModel for "builtin/generated", fixes #2147 + fry: Fixed another generic issue in MultiModel. + +Build 1.8-11.14.3.1525: + fry: Small fix for reworked classic lighting + +Build 1.8-11.14.3.1524: + fry: Added OBJ loader for the ModelLoaderRegistry system. + +Build 1.8-11.14.3.1523: + fry: + Model pipeline system. + Should replace all ad-hoc quad generation methods in forge, and make IBakedModel -> WorldRenderer data transfer faster. Added IVertexConsumer + helper classes; lighting that works correctly for non-axis-aligned faces using the new infrastructure. Changed smooth lighting algorithm, now it should work correctly for everything. + New block lighter can be disabled in the forge config options. + fry: Added back in the lost class + +Build 1.8-11.14.3.1521: + simonbarnes1: + Add Guava and Apache to LaunchClassLoader exclusion list on server + + Move exclusions to common place. Less likely to get out of sync + +Build 1.8-11.14.3.1520: + bk1325: Add PlayerSetSpawnEvent + +Build 1.8-11.14.3.1519: + fry: '#' is now added automatically to the beginning of the texture names in B3D models, and the remapping is expected via the blockstate JSON, since it's more reasonable than adding it to the file name in the modelling program or matching the resource location with the filename. + +Build 1.8-11.14.3.1518: + fry: Fixes Attributes.transform affecting only 1 vertex. + +Build 1.7.10-10.13.4.1517-1.7.10: + bjoern: + Fix possible crash in EventBus + + There is currently no way to check if an event handler has been registered or not. + But when trying to unregister a not-registered event handler, Minecraft crashes with a NullPointerException. + This is a simple fix to prevent such crashes. + +Build 1.8-11.14.3.1516: + luacs1998: Fix a possible crash in EventBus + +Build 1.8-11.14.3.1515: + rubensworks: Fix dispenser action for modded spawn eggs + +Build 1.8-11.14.3.1514: + LexManos: Update Gradle wrapper to 2.7 + LexManos: Fix entity count being incorrect for spawning logic. Now filter out 'persistant' entities. + +Build 1.8-11.14.3.1513: + foka_12: Disallow conflicting furnace recipes + +Build 1.8-11.14.3.1512: + fry: Workaround for MinecraftForge/ForgeGradle#256 + +Build 1.8-11.14.3.1511: + cpw: + FMLNetworkHandler.openGui should not try and open a GUI on a FakePlayer. + Fixes #2082 and probably dozens of mod errors. Also, side benefit of the + merged codebase! FML code can ref Forge code! + +Build 1.8-11.14.3.1510: + laci200270: Update FMLSecurityManager.java + cpw: Format a bit better + +Build 1.8-11.14.3.1509: + fry: Much requested temporary hack for items and TESRs. Context: #1582, #1597, #1713, #2058 and others. + +Build 1.8-11.14.3.1508: + vorquel: Fix faulty Channel name + +Build 1.8-11.14.3.1507: + simonbarnes1: Use already provided profile for the player's own skin + +Build 1.8-11.14.3.1506: + cpw: + More cleanup of the default eclipse workspace. The project is now called "MDKExample" not "Minecraft". + The project tree is now contemporary, instead of a copy from 1.5.x era MC. The launches are cleaned up, and refer to + a better default "runDir" of "run" rather than "eclipse".. Updating to FG2.0.1 which will contain relevant binary fixes. + +Build 1.8-11.14.3.1505: + cpw: Fix eclipse workspace inside the mdk - don't run it through the tokenconverter. Also add in CREDITS-fml.txt to the MDK - it's still required. + +Build 1.8-11.14.3.1504: + LexManos: + Fixed issue where config folder would not be created before SplashProgress tried to read from it. + Default macs to disable the new loading screen due to to many macs having issues. + Users can enable it again by editing their config. + Catch and gracefully handle more errors when starting up the Splash Screen. + +Build 1.8-11.14.3.1503: + diesieben07: Re-introduce RenderBlockOverlayEvent, seems to have been missed during 1.8 update + Abrar Syed: removed broken and duplicate AT lines + Abrar Syed: added hardcoded fml version file + Abrar Syed: DeobfuscationData no longer required at dev time + Abrar Syed: removed old unnecessary stuff + Abrar Syed: Added FG2 buildscript + updated for Gradle 2.4 + Abrar Syed: added jenkins compat tasks + Abrar Syed: fixed local-building fail with changelog + Abrar Syed: updated installed gradle. not finished + Abrar Syed: fixed deployment credentials + cpw: FML is no more. FML has ceased to be. FML's expired and gone to meet its maker. FML's a stiff! Bereft of life, FML rests in peace. + cpw: Vestigal fml-ectomy. + cpw: + FML's metabolic processes are now history. FML's off the twig. FML's kicked the bucket, FML's shuffled off this mortal coil, + run down the curtain and joined the bleedin' choir invisible!! THIS IS AN EX-PROJECT! + Abrar Syed: added MDK package + cpw: Fix MDK task - it now runs. + cpw: The final nail in the coffin. BYE! + cpw: + Trying to fix the MDK to include gradle wrapper, but the gradle-wrapper.jar is + corrupted. @AbrarSyed can you take a look? + cpw: + Fix packaging the gradle wrapper properly. There is still a problem with + the MDK- it fails to run setupDecompWorkspace. + + Filed an issue at ForgeGradle, since this seems to be something FG2 shouldn't + be doing, but is? + + https://github.com/MinecraftForge/ForgeGradle/issues/235 + cpw: Remove patches + cpw: Fix ciWriteBuildNumber task. Ugly, but it works. + cpw: Fix crowdin task. Good luck jenkins, lets roll! + cpw: Fix crowdin again. Run, jenkins, for god's sake, run! + LexManos: Update gradle wrapper and fix changelog task. + +Build 1.8-11.14.3.1502: + cpw: ObjectHolder works great, but it should be a lot less spammy about failed lookups. They're usually mod options. + cpw: Actually rebuild the fluidNames each rebuild, don't just try and force changes in. Should fix #1973 + cpw: + Wake up the FluidRegistry before any mods start loading. Should stop mods claiming to own water or lava (depending on who accessed + FluidRegistry first) + cpw: Be a little bit more helpful when the ObjectHolder misses. Should help figure out what is going in in #2006 + cpw: Cherry pick some changes from 1.8 for inner class discovery, also fix the negativecache. Closes #1872 + +Build 1.8-11.14.3.1501: + LexManos: Fix placing skulls on fence posts. Closes #2055 + +Build 1.8-11.14.3.1500: + starbuck: Fix harvest logic running in addition to shearable logic + +Build 1.8-11.14.3.1499: + glstillman: Fixed a bug with ExtendedBlockStates containing at least one IProperty and one IUnlistedProperty not allowing blocks to be placed. + +Build 1.8-11.14.3.1498: + liach: Add an EnumHelper hook and fixed an issue + +Build 1.8-11.14.3.1497: + simonbarnes1: Fix placing signs with NBT prompting for text + +Build 1.8-11.14.3.1496: + Zaggy1024: + Fixed a Forge blockstates json removing models causing an NPE in the loader. + Fixed the deep clone of a V1 Variant not cloning the submodels properly. + +Build 1.8-11.14.3.1495: + clienthax: Signed-off-by: Clienthax + +Build 1.8-11.14.3.1494: + rubensworks: Make EnumFacing events available server-side + +Build 1.8-11.14.3.1493: + rubensworks: Fix source block check for BlockFluidClassic + +Build 1.7.10-10.13.4.1492-1.7.10: + cpw: Cherry pick some changes from 1.8 for inner class discovery, also fix the negativecache. Closes #1872 + +Build 1.8-11.14.3.1491: + diesieben07: Allow the new entity eggs to be created via middle-click + +Build 1.7.10-10.13.4.1490-1.7.10: + cpw: Actually rebuild the fluidNames each rebuild, don't just try and force changes in. Should fix #1973 + cpw: + Wake up the FluidRegistry before any mods start loading. Should stop mods claiming to own water or lava (depending on who accessed + FluidRegistry first) + cpw: Be a little bit more helpful when the ObjectHolder misses. Should help figure out what is going in in #2006 + +Build 1.8-11.14.3.1487: + fry: Custom transformations in forge blockstate json. + +Build 1.8-11.14.3.1486: + LexManos: Fixed ItemMonsterPlacer.getEggInfo missing return. Closes #1975 + +Build 1.8-11.14.3.1485: + jadran.kotnik: Fixed error GUIs showing a white screen and replaced a rogue direct GL call. + +Build 1.8-11.14.3.1484: + izooDee5: Fix particle texture of the generated item models. + +Build 1.8-11.14.3.1483: + bernhard.bonigl: Fix StateMap always mapping properties to the "minecraft" domain instead of the mods, causing it to not find BlockState definitions. + +Build 1.8-11.14.3.1482: + LexManos: Add debug for max texture size and output when Texture Atlas can not stitch all textures. + +Build 1.7.10-10.13.4.1481-1.7.10: + cpw: ObjectHolder works great, but it should be a lot less spammy about failed lookups. They're usually mod options. + +Build 1.8-11.14.3.1480: + LexManos: More descripotive error if Patcher is passed invalid data for vanilla classes. + +Build 1.8-11.14.3.1479: + fry: Fixed perspective transformations for item models. + fry: Vanilla models can now use custom textures. Fixes #1962 + fry: There's no Map.getOrDefault in java6. + +Build 1.8-11.14.3.1476: + LexManos: Fix AT for Block constructor. + +Build 1.8-11.14.3.1475: + fry: Added ItemLayerModel - less awkward, simpler and faster version of ItemModelGenerator. + +Build 1.8-11.14.3.1474: + LexManos: Throw more descriptive errors when mods attempt to register invalid global entity IDs. + LexManos: Include the thread state in the potential error handleing for SplashProgress. + LexManos: Fixed Wavefront Object Importer reading files with integer values. Closes #1651, #1654 + LexManos: Create config folder in SplashProgress if it does not exist. + LexManos: Add the stitching allocation stage to loading screen. + LexManos: + Make TextureMap for items and blocks skip the first pass of loading/stitching textures. + Should decrease loading times for large packs. + May cause issues with some mods so use -Dfml.skipFirstTextureLoad=false to disable. + LexManos: Add TextureManager to loading screen. + LexManos: Time each bar in the loading screen and print it to the log, useful information to see where most time is spent in loading. + cpw: + Mods that are extracted to the mods dir by unzipping or whatever will now cause the game to crash. Too much info is in the META-INF now, + and more will be being added. Extracting to the mods dir just completely breaks that. + +Build 1.8-11.14.3.1473: + jamioflan: + Added CameraSetup sub-event for camera angles + + Allows players to alter yaw and pitch of renderViewEntity, but more importantly, adds the ability to roll the view. + + Added camera roll hook + +Build 1.7.10-10.13.4.1472-1.7.10: + michafla: fix logic for guessing mesa tag in biome dict + cpw: + Mods that are extracted to the mods dir by unzipping or whatever will now cause the game to crash. Too much info is in the META-INF now, + and more will be being added. Extracting to the mods dir just completely breaks that. + +Build 1.7.10-10.13.4.1470-1.7.10: + LexManos: Add TextureManager to loading screen. + LexManos: Time each bar in the loading screen and print it to the log, useful information to see where most time is spent in loading. + +Build 1.7.10-10.13.4.1469-1.7.10: + LexManos: Create config folder in SplashProgress if it does not exist. + LexManos: Add the stitching allocation stage to loading screen. + LexManos: + Make TextureMap for items and blocks skip the first pass of loading/stitching textures. + Should decrease loading times for large packs. + May cause issues with some mods so use -Dfml.skipFirstTextureLoad=false to disable. + +Build 1.8-11.14.3.1468: + LexManos: Patch line number update. Ignore this. + LexManos: + New system in EntityRegistry to allow modders to register spawn eggs. + For entites that do not use the global ID system. + {Which no mod entity should} + Vanilla spawn eggs will now detect a 'entity_name' entry in it's NBT data and use that for spawning/rendering. + +Build 1.8-11.14.3.1467: + foka_12: Change permission levels on ore recipes parameters + +Build 1.8-11.14.3.1466: + foka_12: + Fixed NPE when calling canBrew + + Oversight on my part, + + If the ingredient doesn't return true in Item.isPotionIngredient, Items.potionitem.getEffects(stack) returns null, causing an NPE to be thrown later on. + + This invalidates #1947. + +Build 1.8-11.14.3.1465: + LexManos: Use Guava instead of Nio for J6 compatibility. + +Build 1.8-11.14.3.1464: + fry: Added fluid renderer. + +Build 1.8-11.14.3.1463: + LexManos: Make Item.shouldCauseReequipAnimation is bit more precise and copy over the new item for rendering even if the animation is diabled. + +Build 1.8-11.14.3.1462: + LexManos: Add vanilla block rotation support back in for certain blocks that were missed in 1.8 update. Closes #1903 + +Build 1.8-11.14.3.1461: + xxmicloxx: Bugfix for B3DLoader + +Build 1.8-11.14.3.1460: + Daniel: + Fix incorrect block position in BlockReed canPlaceBlockAt + + block.canSustainPlant is called on the wrong block position. It should be called on the block below (the 'soil' block). + +Build 1.8-11.14.3.1459: + mezz: Add GuiScreenEvents for keyboard and mouse input + +Build 1.8-11.14.3.1458: + t.tomkins: + Player sensitive version of Block.getPickBlock + + Block.getPickBlock was patched in 1.7 but was overlooked in 1.8. + + Closes: https://github.com/MinecraftForge/MinecraftForge/issues/1709 + LexManos: Add Item.shouldCauseReequipAnimation to allow modders more control over the 'Reequip' animation. + +Build 1.8-11.14.3.1457: + LexManos: Fixed compile issues with irtimaled's PR. + +Build 1.7.10-10.13.4.1456-1.7.10: + irtimaled: + Copy fortress.dat from vanilla location + + Fixes #1747 + + If the dat file isn't in the dimension specific folder but is present in the vanilla data folder then copy it over. + LexManos: Make FML Gui classes use GlStateManager. Closes FML#615 + LexManos: Fixed Wavefront Object Importer reading files with integer values. Closes #1651, #1654 + +Build 1.8-11.14.3.1453: + LexManos: Cleanup code format in LayerBreakingTest. + LexManos: Fixup model loading errors not being printed by making ICustomModelLoader.loadModel propogate IOExceptions as needed. + +Build 1.7.10-10.13.4.1452-1.7.10: + LexManos: Include the thread state in the potential error handleing for SplashProgress. + +Build 1.7.10-10.13.4.1451-1.7.10: + LexManos: Throw more descriptive errors when mods attempt to register invalid global entity IDs. + +Build 1.8-11.14.3.1450: + LexManos: Bump version for new RB. + LexManos: Cleanup some spammy output. + LexManos: Quiet ClassPatchManager debug spam by default. Reenable using -Dfml.debugClassPatchManager=true. + LexManos: Quiet FMLControlledNamespacedRegistry debug spam by default. Reenable using -Dfml.debugRegistryEntries=true. + LexManos: Quiet CrashReport class pre-loading debug, no flag to re-enable. + LexManos: Cleanup mod signature data table. Easily seperating those mods with signatures vs those with none. + LexManos: Cleanup mod state dump to be easier to read by displaying the states in abreviation and placing them before the mod info. + +Build 1.8-11.14.3.1449: + clarsson: Fixing two IndexOutBoundsExceptions from the BiomeDictionary + +Build 1.7.10-10.13.4.1448-1.7.10: + LexManos: Cleanup mod state dump to be easier to read by displaying the states in abreviation and placing them before the mod info. + +Build 1.7.10-10.13.4.1447-1.7.10: + LexManos: Cleanup some spammy output. + LexManos: Quiet ClassPatchManager debug spam by default. Reenable using -Dfml.debugClassPatchManager=true. + LexManos: Quiet FMLControlledNamespacedRegistry debug spam by default. Reenable using -Dfml.debugRegistryEntries=true. + LexManos: Quiet CrashReport class pre-loading debug, no flag to re-enable. + LexManos: Cleanup mod signature data table. Easily seperating those mods with signatures vs those with none. + +Build 1.8-11.14.3.1446: + LexManos: Copy over parent's modelSet value in variants as well. + LexManos: Bump version for new RB + +Build 1.7.10-10.13.4.1445-1.7.10: + LexManos: Bump version for new RB. + +Build 1.8-11.14.2.1444: + cpw: + Fix up the client/server fluid race condition that could cause the game to bail when an SSP game connects. + There's still a teeny gap, but it's MUCH less prominent than it was before. + +Build 1.8-11.14.2.1443: + lumien231: Added LivingExperienceDropsEvent to change the amount of experience an entity drops + +Build 1.8-11.14.2.1442: + jcoleman350: Added ItemMap type check to item frames and ItemRenderer, enabling vanilla style rendering for custom maps + +Build 1.8-11.14.2.1441: + LexManos: Redefine removal value in IRetextureableModel from null to empty string {""} due to ImmutibleMap not allowing null Values. Closes #1927 + +Build 1.8-11.14.2.1440: + foka_12: Added a brewing registry system + +Build 1.8-11.14.2.1439: + LexManos: Limit Sign text to 384 json characters and strip control codes. This is 1.8.7's Sign fix. Thanks Searge. + LexManos: Remove worlds from WorldBorder when unloaded tol prevent memory leak, Closes #1923 + LexManos: Missed patch for sign fix. + +Build 1.8-11.14.2.1437: + cpw: + Attempt to synchronize the state for vanilla client completions and quit the handler if the vanilla + thread has already setup the connection. Should fix #1924 + +Build 1.8-11.14.2.1436: + LexManos: Change custom payload lock to be buffer itself incase multiple packets use the same backend buffer. Closes #1908 + +Build 1.8-11.14.2.1435: + Fuami.cake: + Added Breaking Animation for Smart Models, Checking each layer. + Added Layered Smart Render Test. + +Build 1.8-11.14.2.1434: + LexManos: Update README.txt + +Build 1.8-11.14.2.1433: + fry: Fixed missing variant logging; added the possibility to specify the item variant in the blockstate json. + fry: fixed AT missing for getModelBlockDefinition + fry: + B3D Improvements + - fixed keyframe transformation application + - textures are now resolved the same way as in vanilla models + - added the ability to use forge blockstate texture information + - removed unused code from the B3D example + +Build 1.8-11.14.2.1431: + fry: Fixed partial variant detection in the forge blockstate loader. + +Build 1.8-11.14.2.1430: + LexManos: Mitigate potential issue with users requesting lots of server status information by caching ServerStatus json. + +Build 1.8-11.14.2.1429: + clienthax: + Add missing forge patch from 1.8 port + https://github.com/MinecraftForge/MinecraftForge/blob/1.7.10/patches/minecraft/net/minecraft/client/Minecraft.java.patch#L88 + +Build 1.7.10-10.13.3.1428-1.7.10: + cpw: + Fix up the client/server fluid race condition that could cause the game to bail when an SSP game connects. + There's still a teeny gap, but it's MUCH less prominent than it was before. + +Build 1.8-11.14.2.1427: + LexManos: + Hook BlockState's Json loading to add support for simplified Forge format. + See https://github.com/MinecraftForge/MinecraftForge/pull/1885 for more details. + +Build 1.8-11.14.2.1426: + cpw: + Attempt to disable the new splash screen if there are errors detected finishing up. Print a slightly more helpful error message. + + (cherry picked from commit e3211eec0469dc6717943010d584207b7abdb1e0) + + Conflicts: + fml/src/main/java/cpw/mods/fml/client/SplashProgress.java + cpw: + Finish loading screen before going fullscreen. Closes MinecraftForge/FML#662 + + (cherry picked from commit 19d7e16fa6a28c5665de1ed6e50d8699e865bff2) + + Conflicts: + fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch + cpw: So we can't print a lot of unicode in the splash screen, so restrict to a hard subset we know we CAN print, closes #1910 + LexManos: Fixed missing import in last merge. + +Build 1.7.10-10.13.3.1424-1.7.10: + cpw: So we can't print a lot of unicode in the splash screen, so restrict to a hard subset we know we CAN print, closes #1910 + +Build 1.8-11.14.2.1423: + AlgorithmX2: Allow placing item frames on Solid Block Faces (isSideSolid) + +Build 1.7.10-10.13.3.1422-1.7.10: + cpw: + Attempt to disable the new splash screen if there are errors detected finishing up. Print a slightly more helpful error message. + + (cherry picked from commit e3211eec0469dc6717943010d584207b7abdb1e0) + + Conflicts: + fml/src/main/java/cpw/mods/fml/client/SplashProgress.java + cpw: + Finish loading screen before going fullscreen. Closes MinecraftForge/FML#662 + + (cherry picked from commit 19d7e16fa6a28c5665de1ed6e50d8699e865bff2) + + Conflicts: + fml/patches/minecraft/net/minecraft/client/Minecraft.java.patch + +Build 1.8-11.14.2.1421: + cpw: + MinecraftForge/FML@12ccf9cf49b76140841cdc5a459422ae4781de1a Rather than try to fall back to the backup level.dat in case of weirdness in the ID map, just fail hard. There is probably a serious modder derp in this case and there's nothing FML can do to recover the situation except avoid making it worse. + MinecraftForge/FML@e8cd368da30661ed2898fff232e2db787edcbdcc It's an IllegalState not an IllegalArgument *sigh* + MinecraftForge/FML@2be9c743424c92f8799a6af1d59d60edd65e6bf0 And fix itemblocks being removed, leaving behind a residual block. This is a legitimate action - use the missing mapping event to let the mod tell us about it + MinecraftForge/FML@7d8804cf656081d1570068f52e9bfc7140b21a65 You can't setAction to BLOCKONLY + MinecraftForge/FML@c73861efe67594ee9995bc93744cab06bd6647d1 Cherry-pick 01aaa7dc97480b381ca0d192ec65016d7baeb747 Fix mods defined via --mods or --modListFile launch args not being searched for coremods. #560 + MinecraftForge/FML@94c45b48c1265e7c4f60f591d413fa545787d354 Fix json cache crash, handle the file much more cleanly. Probably an MC JIRA since it's a vanilla bug. Closes #619 + cpw: + Forge really should have always supported the concept of an "exact spawn". Individual world providers can still + change this behaviour of course, but for default maps it makes sense to support it as a config option. + cpw: + Removed fluidID from ItemStack. + + This fixes a rather huge issue where FluidStacks on the client could be desynced if a modder was unaware of it. + + This is a breaking change but can be mitigated with a transformer to the getter getFluidID(). + + Signed-off-by: King Lemming + cpw: Add in a fluidid transformer + cpw: Fix formatting + cpw: + Allow for duplicate Fluid Blocks. It's annoying to be sure but just as with the OreDictionary, we'll have to handle it. + + Signed-off-by: King Lemming + cpw: + You shouldn't be creating FluidStacks from unregistered Fluids. Warn clearly on failed registrations, and make a useful log message for failed fluidstack + creations. Should help a lot with tracking down broken mods that are doing this wrongly. + LexManos: MinecraftForge/FML@31cf2a9cab6d1977d31436220d9612eaa13d4e0f Remove J7 only constructor in EnhancedRuntimeException, J6 compiling compatibility restored. + LexManos: Restore binary compatibility issues in FluidRegistry caused by recent changes. + me: + Fix FluidRegsitry.registerFluid + + FluidRegistry: + ```java + static BiMap fluids = HashBiMap.create(); + static BiMap fluidIDs = HashBiMap.create(); + ... + public static boolean registerFluid(Fluid fluid) + { + if (fluidIDs.containsKey(fluid.getName())) + ^^^^^^^ + ``` + There is definitely should be fluids instead fluidIDs. This mistake broke many mods. + kinglemming: + Fixes #1782 + + Signed-off-by: King Lemming + kinglemming: + Fixes FluidContainerRegistry properly - no more corner case where client/server mods disagree. + + Also clarifies the 2x Fluid registration error message somewhat. + + Signed-off-by: King Lemming + kinglemming: + Adds a warning to the FluidContainerRegistry when a mod does something stupid! Also denies the registration. + + Signed-off-by: King Lemming + cpw: + MinecraftForge/FML@ce791cb1f2cf983ef77b1e5c4028ddefab394062 Rework EventSubscriptionTransformer to bake @Cancelable and @HasResult values, should increase EventBus performance even more by removing logic from Event constructors. + MinecraftForge/FML@852710962a9b6d7c8e2ca188c715eebb2da44c2a Clean up some dead code + cpw: MinecraftForge/FML@be5ec06e3144d55a03d125f3ce364eade3771f4f Cleaning up the missing resource stack spam, and condensing the information into a usefully understandable format. + cpw: MinecraftForge/FML@0da1263ff9ede99267c03728a1c823b8056d5e44 Enhance error output for bad textures a bit more and try and capture more types of error.. + cpw: + Fluids are now tracked internally by mod. This allows for the server and the world to specify a "default" + in the case of a possible alternative fluid implementation. If you always called registerFluid, things + should work pretty seamlessly, but if you didn't (gating with an isFluidRegistered check for example) + you should change to register anyway. This way, even if you're not default in the overall instance, you may + become default if you're the only mod present on a server, for example, or in a world save. + + This should radically decrease the mixups caused by mod load ordering problems, and other issues around fluid + tracking. + cpw: Fix NPE - Closes #1794 + cpw: And handle the null case in the constructor itself. Closes #1794 (again) + cpw: + MinecraftForge/FML@dfce4cd8d023a546c4c21405db182b8ddcd38633 Allow registering custom language adapters. + MinecraftForge/FML@9fecd72cf0bd483ae7bc2ce821ae6b2f5e5b9c65 Some tidyup of the PR + MinecraftForge/FML@10ac2a4fd972e923a60d23d10e8f297b8584f565 Fix itemCtorArgs javadoc in registerBlock + MinecraftForge/FML@86f70d37a40bbeaf7c389a14adcd8311ba5584df Patch TracingPrintStream to handle Kotlin IO. + kinglemming: + Adjusts OreDictionary to prevent invalid registrations. + Getting Ore Names for a non-existent ore will no longer automatically add that Name to the list nor generate an ID. + + Tweaks a warning message in the FluidContainerRegistry. No functionality change. + + Signed-off-by: King Lemming + LexManos: + Revert KL's change, requesting a ore WILL register it. + + Registering like this and returning a new empty list allows for modders to register their recipes and such without requiring to be executed after someone actually adds an item. If handled properly this allows for more flexible load orders, and more responsive code. + kinglemming: + Adds some new Ore querying functionality. + + Also attempts to size initial Hashmaps in a logical manner. + + Signed-off-by: King Lemming + cpw: + Fixed NBTSizeTracker missing a lot of data being read. Also made new NBT object allocation claim 32-bits in the size tracker. + + (cherry picked from commit de066a86da281d381b0e3ab9e83682720327049c) + + Conflicts: + patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch + patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch + cpw: Verify that the fluid registry doesn't contain "junk" fluids thru reflection. + cpw: MinecraftForge/FML@8f9e3a7e30c8cc436dcb8d94b18b4634e0376339 Exceptions during construction phase should not propogate and cause an immediate crash. Closes #638 + cpw: Change logging to avoid the String.format bug. Closes #1809 + cpw: Actually use the override constraint in ticket requests. Closes #1802 + cpw: + Reformat ItemArmor$ArmorMaterial.getBaseItem to use an if/then/else structure. The switch + causes the generation of an internal class which may derp custom armor addition. + Closes #1799 + cpw: Make FluidStack hold a delegate for the fluid. This can then float based on what is "live" at present. + cpw: Fix static initializer derp. + cpw: Replace the OLD fluid in the fluidID map, not the new one.. + cpw: + Expose the fluid that a block was constructed with, useful for 'non-default' + configuration of fluidblocks. Shouldn't be used outside of this purpose. + cpw: MinecraftForge/FML@d14d1a8fea4c9242c944079ab8e4cdd516dfce4c Update to use the inherited jar format. Simplifies a lot.. + cpw: + MinecraftForge/FML@a39482c4b7ac2883f821619b47ff31e0b6e74b29 Splash screen implementation + MinecraftForge/FML@01fea095cdcd80c2ae9f0ebfd1c72242b3f2dbf8 Merge branch '1.7.10-load-progress' of github.com:RainWarrior/FML into 1.7.10 + MinecraftForge/FML@364b4bbbb0d4d168f9a63fa62a09e4e2fa213039 Call some loader stuffs + MinecraftForge/FML@61a891280d15f9f17e28bf86a427f32de5a8983e Make sure to close the splash screen if there's gonna be an error display + fry: + MinecraftForge/FML@5785a9c9e8d76b91a03ed1f9791aeee1cb7ea00b Fix up multiple injections of cmdline files via versionspecificmoddir. Closes #645 + MinecraftForge/FML@bd117be9c3e3919f3c29538cde80e3eb8fa48368 Correctly track exceptions thrown in the loading screen rendering thread + cpw: + MinecraftForge/FML@36688e781aae67fb1e4e7047acf689edeeac7ddb Add in resource reloading to the bar. Tidy up some of the labels a bit. + MinecraftForge/FML@a1dc465a55612ecdd44e6cde3adc0f1d53c6d97b More progress bar action! + MinecraftForge/FML@bfcbf4ef4366fd3d8bfd20adafb63a857bb0dd53 More progress bar hooks + MinecraftForge/FML@a6670c415ee97e771020921e00773c4c15e7512e Thread errors should be correctly displayed in the crash report now + MinecraftForge/FML@9a16d26186d27029cae32a19c09ddf48f7cba22e fixed bar text positioning + MinecraftForge/FML@0059c630281b7105c0532d2dba1bec27cf0323b2 Track mipmaps and texture upload + MinecraftForge/FML@ef5f809752e87e369235e98a63027e9347185cd9 Fix broken log message in vanilla. + cpw: + MinecraftForge/FML@4fe7b469b5ba156d4a786cd9e105b18cca7c271a Loading screen: logo rotation is now optional; initial support for animated textures - animation rate is fixed for now. + MinecraftForge/FML@31ae43590a2ba771d69b6c6513bcd5fe87ae8f8f Fix trying to close the screen during error. + cpw: MinecraftForge/FML@94821fac98e64d9b8ad7434ed23a621850a8e11c Add a config file that lets you add additional soft dependencies at runtime - injectedDependencies.json + cpw: MinecraftForge/FML@2ed00c4da0ee76eb15e28eb8ee2c07a3096155c2 Splash progress screen will not load in the presence of optifine anymore. + cpw: MinecraftForge/FML@dda431353953457608c38aacb060ef82ddc88883 Revert "Merge pull request #650 from luacs1998/1.7.10" This undoes the seriously broken change from Sponge to support Mixins, that breaks a wide variety of coremods. Given the widespread incompatibility it introduces, it won't be re-added at 1.7.10. + fry: + Updated FML: + MinecraftForge/FML@2ed00c4da0ee76eb15e28eb8ee2c07a3096155c2 Splash progress screen will not load in the presence of optifine anymore. + MinecraftForge/FML@adcf2247c69f68415033a3c0b2c527053733514c Loading screen: moved config file to the standard config directory; added the option to load textures from the custom resource pack + MinecraftForge/FML@91338433fa74e782e237643632de2cc5e17ee280 Add classloader exclusion for ASM + MinecraftForge/FML@7c10b93a2ded2799d41b73b67a2766c31e992d8a Synchronize the available libraries. Turns out we've been forcing a newer apache commons-lang(3.2.1) for a long time, also sync the dev guava - we've been forcing 17 for a long time too. Bumping commons-lang to 3.3.2 since that's what Mojang are shipping with 1.8. It has no observable ill effects Closes MinecraftForge/FML#651 + MinecraftForge/FML@8ccfa24764a3f4854f5334c0da1224286175e13b Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10 + MinecraftForge/FML@b2650a0bdb7d69010a55de518e76591a6c417e87 Optifine can tell us when they're ready for the new splash screen. + MinecraftForge/FML@02a5a58a1cbb25cd3baecf1535950e4780b7810f Fix the ordering of the messages, so they make sense now. + MinecraftForge/FML@dda431353953457608c38aacb060ef82ddc88883 Revert "Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10" This undoes the seriously broken change from Sponge to support Mixins, that breaks a wide variety of coremods. Given the widespread incompatibility it introduces, it won't be re-added at 1.7.10. + MinecraftForge/FML@5dbb481732bf4bcf8b0c5c02806051a933e6587e Eliminated texture name allocation race condition + MinecraftForge/FML@450b82ca0e13cf889a42eeb198b67115a4851031 Updated default forge logo to animated gif; reverted config folder resolution to Minecraft class due to Loader not being initialized at the point it's needed + cpw: MinecraftForge/FML@0b84b6aa297bdf6ab9f010e340f286442cb242dc Expose the state of the loader + cpw: + Attempt to fix the slow loading problem. Instead of forcing the main thread to wait around + on every call to processWindowMessages, we will simply skip it, if the mutex is already + claimed by the display thread. This should fix slow loading issues seen by some with + the new loading screen. + cpw: Hardcode the FML version in-game as a specific value. + cpw: Strip control codes in progress bar messages. They cause crashes sometimes. + cpw: + Clean up transformers a bit. Can't use COMPUTE_FRAMES even though it's required - the game refuses to even + run if I do. Note for j8: when we force Java8 classes, all coremods will need a thorough overhaul - the + current way we do things is not sustainable when Java8 becomes the universal norm. + cpw: + Add in an ItemStackHolder - a way to inject ItemStacks without having to have complex lookup code everywhere. + + Example: https://gist.github.com/cpw/9af398451a20459ac263 + cpw: Bump minor version # to 2 because of the fluid changes (mirroring what happening in 1.7.10) + +Build 1.7.10-10.13.3.1420-1.7.10: + cpw: + Add in an ItemStackHolder - a way to inject ItemStacks without having to have complex lookup code everywhere. + + Example: https://gist.github.com/cpw/9af398451a20459ac263 + +Build 1.8-11.14.1.1419: + LexManos: Fixed damage reduction rate of vanilla armor incorrectly scaling with armor's current durability. + +Build 1.8-11.14.1.1418: + AlgorithmX2: Fix Partial Face Lighting on Top/Bottom Faces ; Vanilla MC-80148 + +Build 1.8-11.14.1.1417: + LexManos: Force netty downgrade on dedicated server to match client. Netty bug: https://github.com/netty/netty/issues/2302 Closes #1848 + +Build 1.8-11.14.1.1416: + LexManos: Fixed command exploit with C12 + +Build 1.8-11.14.1.1415: + LexManos: Fixes MC-75630 - Exploit with signs and command blocks + +Build 1.8-11.14.1.1414: + LexManos: Finish loading screen before going fullscreen. Closes MinecraftForge/FML#662 + +Build 1.8-11.14.1.1413: + LexManos: Loosen up ServerChatEvent to support IChatComponent Closes #1893 + LexManos: Cleanup a lot of spammy output. Everything hidden behind environment flags now. Scale anvil image down 50% + LexManos: Attempt to disable the new splash screen if there are errors detected finishing up. Print a slightly more helpful error message. + +Build 1.8-11.14.1.1412: + me: Add true support for unicode fonts + +Build 1.8-11.14.1.1411: + diesieben07: Fix crash when texture loading throws RuntimeException without message + +Build 1.8-11.14.1.1410: + xxt1g3lxx.xxt1g3lxx: Changed forge command tab completion to use getListOfStringsMatchingLastWord() + +Build 1.8-11.14.1.1409: + xxt1g3lxx.xxt1g3lxx: Added tab completion + +Build 1.7.10-10.13.3.1408-1.7.10: + cpw: Strip control codes in progress bar messages. They cause crashes sometimes. + cpw: + Clean up transformers a bit. Can't use COMPUTE_FRAMES even though it's required - the game refuses to even + run if I do. Note for j8: when we force Java8 classes, all coremods will need a thorough overhaul - the + current way we do things is not sustainable when Java8 becomes the universal norm. + +Build 1.7.10-10.13.3.1407-1.7.10: + cpw: Hardcode the FML version in-game as a specific value. + +Build 1.7.10-10.13.3.1406-1.7.10: + cpw: Merged FML into Forge's repo. FML is no longer developed seperatly. + +Build 1.8-11.14.1.1405: + cpw: Merged FML into Forge's repo. FML is no longer developed seperatly. + +Build 1.8-11.14.1.1404: + tmtravlrsmail: + Initialized the Nether Fortress chest loot + + Forced the nether fortress chest loot to initialize in ChestGenHooks + like the other types. + + Changed tabs to spaces. Silly Eclipse. + +Build 1.7.10-10.13.3.1403-1.7.10: + fry: + Updated FML: + MinecraftForge/FML@2ed00c4da0ee76eb15e28eb8ee2c07a3096155c2 Splash progress screen will not load in the presence of optifine anymore. + MinecraftForge/FML@adcf2247c69f68415033a3c0b2c527053733514c Loading screen: moved config file to the standard config directory; added the option to load textures from the custom resource pack + MinecraftForge/FML@91338433fa74e782e237643632de2cc5e17ee280 Add classloader exclusion for ASM + MinecraftForge/FML@7c10b93a2ded2799d41b73b67a2766c31e992d8a Synchronize the available libraries. Turns out we've been forcing a newer apache commons-lang(3.2.1) for a long time, also sync the dev guava - we've been forcing 17 for a long time too. Bumping commons-lang to 3.3.2 since that's what Mojang are shipping with 1.8. It has no observable ill effects Closes MinecraftForge/FML#651 + MinecraftForge/FML@8ccfa24764a3f4854f5334c0da1224286175e13b Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10 + MinecraftForge/FML@b2650a0bdb7d69010a55de518e76591a6c417e87 Optifine can tell us when they're ready for the new splash screen. + MinecraftForge/FML@02a5a58a1cbb25cd3baecf1535950e4780b7810f Fix the ordering of the messages, so they make sense now. + MinecraftForge/FML@dda431353953457608c38aacb060ef82ddc88883 Revert "Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10" This undoes the seriously broken change from Sponge to support Mixins, that breaks a wide variety of coremods. Given the widespread incompatibility it introduces, it won't be re-added at 1.7.10. + MinecraftForge/FML@5dbb481732bf4bcf8b0c5c02806051a933e6587e Eliminated texture name allocation race condition + MinecraftForge/FML@450b82ca0e13cf889a42eeb198b67115a4851031 Updated default forge logo to animated gif; reverted config folder resolution to Minecraft class due to Loader not being initialized at the point it's needed + cpw: MinecraftForge/FML@0b84b6aa297bdf6ab9f010e340f286442cb242dc Expose the state of the loader + +Build 1.8-11.14.1.1402: + silfadur: Added hook for IPerspectiveAwareModel in RenderItem.renderItemIntoGUI for ItemCameraTransforms.TransformType.GUI + +Build 1.7.10-10.13.3.1401-1710ls: + fry: + Updated FML: + MinecraftForge/FML@2ed00c4da0ee76eb15e28eb8ee2c07a3096155c2 Splash progress screen will not load in the presence of optifine anymore. + MinecraftForge/FML@adcf2247c69f68415033a3c0b2c527053733514c Loading screen: moved config file to the standard config directory; added the option to load textures from the custom resource pack + MinecraftForge/FML@91338433fa74e782e237643632de2cc5e17ee280 Add classloader exclusion for ASM + MinecraftForge/FML@7c10b93a2ded2799d41b73b67a2766c31e992d8a Synchronize the available libraries. Turns out we've been forcing a newer apache commons-lang(3.2.1) for a long time, also sync the dev guava - we've been forcing 17 for a long time too. Bumping commons-lang to 3.3.2 since that's what Mojang are shipping with 1.8. It has no observable ill effects Closes MinecraftForge/FML#651 + MinecraftForge/FML@8ccfa24764a3f4854f5334c0da1224286175e13b Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10 + MinecraftForge/FML@b2650a0bdb7d69010a55de518e76591a6c417e87 Optifine can tell us when they're ready for the new splash screen. + MinecraftForge/FML@02a5a58a1cbb25cd3baecf1535950e4780b7810f Fix the ordering of the messages, so they make sense now. + MinecraftForge/FML@dda431353953457608c38aacb060ef82ddc88883 Revert "Merge pull request MinecraftForge/FML#650 from luacs1998/1.7.10" This undoes the seriously broken change from Sponge to support Mixins, that breaks a wide variety of coremods. Given the widespread incompatibility it introduces, it won't be re-added at 1.7.10. + MinecraftForge/FML@5dbb481732bf4bcf8b0c5c02806051a933e6587e Eliminated texture name allocation race condition + MinecraftForge/FML@450b82ca0e13cf889a42eeb198b67115a4851031 Updated default forge logo to animated gif; reverted config folder resolution to Minecraft class due to Loader not being initialized at the point it's needed + +Build 1.7.10-10.13.3.1400-1.7.10: + cpw: MinecraftForge/FML@dda431353953457608c38aacb060ef82ddc88883 Revert "Merge pull request #650 from luacs1998/1.7.10" This undoes the seriously broken change from Sponge to support Mixins, that breaks a wide variety of coremods. Given the widespread incompatibility it introduces, it won't be re-added at 1.7.10. + +Build 1.7.10-10.13.3.1399-1.7.10: + cpw: + MinecraftForge/FML@a39482c4b7ac2883f821619b47ff31e0b6e74b29 Splash screen implementation + MinecraftForge/FML@01fea095cdcd80c2ae9f0ebfd1c72242b3f2dbf8 Merge branch '1.7.10-load-progress' of github.com:RainWarrior/FML into 1.7.10 + MinecraftForge/FML@364b4bbbb0d4d168f9a63fa62a09e4e2fa213039 Call some loader stuffs + MinecraftForge/FML@61a891280d15f9f17e28bf86a427f32de5a8983e Make sure to close the splash screen if there's gonna be an error display + fry: + MinecraftForge/FML@5785a9c9e8d76b91a03ed1f9791aeee1cb7ea00b Fix up multiple injections of cmdline files via versionspecificmoddir. Closes #645 + MinecraftForge/FML@bd117be9c3e3919f3c29538cde80e3eb8fa48368 Correctly track exceptions thrown in the loading screen rendering thread + cpw: + MinecraftForge/FML@36688e781aae67fb1e4e7047acf689edeeac7ddb Add in resource reloading to the bar. Tidy up some of the labels a bit. + MinecraftForge/FML@a1dc465a55612ecdd44e6cde3adc0f1d53c6d97b More progress bar action! + MinecraftForge/FML@bfcbf4ef4366fd3d8bfd20adafb63a857bb0dd53 More progress bar hooks + MinecraftForge/FML@a6670c415ee97e771020921e00773c4c15e7512e Thread errors should be correctly displayed in the crash report now + MinecraftForge/FML@9a16d26186d27029cae32a19c09ddf48f7cba22e fixed bar text positioning + MinecraftForge/FML@0059c630281b7105c0532d2dba1bec27cf0323b2 Track mipmaps and texture upload + MinecraftForge/FML@ef5f809752e87e369235e98a63027e9347185cd9 Fix broken log message in vanilla. + cpw: + MinecraftForge/FML@4fe7b469b5ba156d4a786cd9e105b18cca7c271a Loading screen: logo rotation is now optional; initial support for animated textures - animation rate is fixed for now. + MinecraftForge/FML@31ae43590a2ba771d69b6c6513bcd5fe87ae8f8f Fix trying to close the screen during error. + cpw: MinecraftForge/FML@94821fac98e64d9b8ad7434ed23a621850a8e11c Add a config file that lets you add additional soft dependencies at runtime - injectedDependencies.json + cpw: MinecraftForge/FML@2ed00c4da0ee76eb15e28eb8ee2c07a3096155c2 Splash progress screen will not load in the presence of optifine anymore. + +Build 1.8-11.14.1.1398: + Zaggy1024: Fixed a bug which caused the light level not to update when a block implements Block.getLightValue(IBlockAccess, BlockPos) to change the light value for different block states. + +Build 1.8-11.14.1.1397: + Parker Young: Fixes MC-52974: Host's skin doesn't load in LAN + +Build 1.8-11.14.1.1396: + Zaggy1024: Removed @SideOnly(Side.CLIENT) from EnumWorldBlockLayer. + +Build 1.7.10-10.13.3.1395-1710ls: + cpw: MinecraftForge/FML@94821fac98e64d9b8ad7434ed23a621850a8e11c Add a config file that lets you add additional soft dependencies at runtime - injectedDependencies.json + +Build 1.7.10-10.13.3.1394-1710ls: + cpw: + MinecraftForge/FML@4fe7b469b5ba156d4a786cd9e105b18cca7c271a Loading screen: logo rotation is now optional; initial support for animated textures - animation rate is fixed for now. + MinecraftForge/FML@31ae43590a2ba771d69b6c6513bcd5fe87ae8f8f Fix trying to close the screen during error. + +Build 1.7.10-10.13.3.1393-1710ls: + cpw: + MinecraftForge/FML@36688e781aae67fb1e4e7047acf689edeeac7ddb Add in resource reloading to the bar. Tidy up some of the labels a bit. + MinecraftForge/FML@a1dc465a55612ecdd44e6cde3adc0f1d53c6d97b More progress bar action! + MinecraftForge/FML@bfcbf4ef4366fd3d8bfd20adafb63a857bb0dd53 More progress bar hooks + MinecraftForge/FML@a6670c415ee97e771020921e00773c4c15e7512e Thread errors should be correctly displayed in the crash report now + MinecraftForge/FML@9a16d26186d27029cae32a19c09ddf48f7cba22e fixed bar text positioning + MinecraftForge/FML@0059c630281b7105c0532d2dba1bec27cf0323b2 Track mipmaps and texture upload + MinecraftForge/FML@ef5f809752e87e369235e98a63027e9347185cd9 Fix broken log message in vanilla. + +Build 1.8-11.14.1.1392: + LexManos: Cleanup RenderEntityItem patch, fixes Z-fighting issue in EntityItems. Closes #1824 + +Build 1.7.10-10.13.3.1391-1710ls: + fry: + MinecraftForge/FML@5785a9c9e8d76b91a03ed1f9791aeee1cb7ea00b Fix up multiple injections of cmdline files via versionspecificmoddir. Closes #645 + MinecraftForge/FML@bd117be9c3e3919f3c29538cde80e3eb8fa48368 Correctly track exceptions thrown in the loading screen rendering thread + +Build 1.8-11.14.1.1390: + jadran.kotnik: + Extracted the creation of RegionRenderCache into a method. + Classes extending RegionRenderCache can change the behavior of the cache, allowing to visually change blocks (schematics etc). + +Build 1.7.10-10.13.3.1388-1.7.10: + cpw: MinecraftForge/FML@d14d1a8fea4c9242c944079ab8e4cdd516dfce4c Update to use the inherited jar format. Simplifies a lot.. + +Build 1.7.10-10.13.3.1385-1.7.10: + cpw: + Expose the fluid that a block was constructed with, useful for 'non-default' + configuration of fluidblocks. Shouldn't be used outside of this purpose. + +Build 1.7.10-10.13.3.1384-1.7.10: + cpw: Replace the OLD fluid in the fluidID map, not the new one.. + +Build 1.7.10-10.13.3.1383-1.7.10: + cpw: Fix static initializer derp. + +Build 1.7.10-10.13.3.1382-1.7.10: + cpw: Make FluidStack hold a delegate for the fluid. This can then float based on what is "live" at present. + +Build 1.7.10-10.13.3.1381-1.7.10: + cpw: + Reformat ItemArmor$ArmorMaterial.getBaseItem to use an if/then/else structure. The switch + causes the generation of an internal class which may derp custom armor addition. + Closes #1799 + +Build 1.7.10-10.13.3.1380-1.7.10: + cpw: Actually use the override constraint in ticket requests. Closes #1802 + +Build 1.7.10-10.13.3.1379-1.7.10: + cpw: Change logging to avoid the String.format bug. Closes #1809 + +Build 1.7.10-10.13.3.1378-1.7.10: + cpw: MinecraftForge/FML@8f9e3a7e30c8cc436dcb8d94b18b4634e0376339 Exceptions during construction phase should not propogate and cause an immediate crash. Closes #638 + +Build 1.7.10-10.13.3.1377-1.7.10: + cpw: Verify that the fluid registry doesn't contain "junk" fluids thru reflection. + +Build 1.7.10-10.13.3.1376-1.7.10: + cpw: + Fixed NBTSizeTracker missing a lot of data being read. Also made new NBT object allocation claim 32-bits in the size tracker. + + (cherry picked from commit de066a86da281d381b0e3ab9e83682720327049c) + + Conflicts: + patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch + patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch + +Build 1.8-11.14.1.1375: + LexManos: Fixed NBTSizeTracker missing a lot of data being read. Also made new NBT object allocation claim 32-bits in the size tracker. + +Build 1.7.10-10.13.3.1374-1.7.10: + kinglemming: + Adds some new Ore querying functionality. + + Also attempts to size initial Hashmaps in a logical manner. + + Signed-off-by: King Lemming + +Build 1.7.10-10.13.3.1373-1.7.10: + LexManos: + Revert KL's change, requesting a ore WILL register it. + + Registering like this and returning a new empty list allows for modders to register their recipes and such without requiring to be executed after someone actually adds an item. If handled properly this allows for more flexible load orders, and more responsive code. + +Build 1.7.10-10.13.3.1372-1.7.10: + kinglemming: + Adjusts OreDictionary to prevent invalid registrations. + Getting Ore Names for a non-existent ore will no longer automatically add that Name to the list nor generate an ID. + + Tweaks a warning message in the FluidContainerRegistry. No functionality change. + + Signed-off-by: King Lemming + +Build 1.8-11.14.1.1371: + cpw: + MinecraftForge/FML@888e489394e52abdfb349fbfbd7f8e153b5af124 Allow registering custom language adapters. + MinecraftForge/FML@906f94ca143f756f40404fde38af32b2481d0673 Some tidyup of the PR + MinecraftForge/FML@1c025f18433df868859022eea8e6d198444736de Patch TracingPrintStream to handle Kotlin IO. + +Build 1.7.10-10.13.3.1370-1.7.10: + cpw: + MinecraftForge/FML@dfce4cd8d023a546c4c21405db182b8ddcd38633 Allow registering custom language adapters. + MinecraftForge/FML@9fecd72cf0bd483ae7bc2ce821ae6b2f5e5b9c65 Some tidyup of the PR + MinecraftForge/FML@10ac2a4fd972e923a60d23d10e8f297b8584f565 Fix itemCtorArgs javadoc in registerBlock + MinecraftForge/FML@86f70d37a40bbeaf7c389a14adcd8311ba5584df Patch TracingPrintStream to handle Kotlin IO. + +Build 1.7.10-10.13.3.1369-1.7.10: + cpw: And handle the null case in the constructor itself. Closes #1794 (again) + +Build 1.7.10-10.13.3.1368-1.7.10: + cpw: Fix NPE - Closes #1794 + +Build 1.7.10-10.13.3.1367-1.7.10: + cpw: + Fluids are now tracked internally by mod. This allows for the server and the world to specify a "default" + in the case of a possible alternative fluid implementation. If you always called registerFluid, things + should work pretty seamlessly, but if you didn't (gating with an isFluidRegistered check for example) + you should change to register anyway. This way, even if you're not default in the overall instance, you may + become default if you're the only mod present on a server, for example, or in a world save. + + This should radically decrease the mixups caused by mod load ordering problems, and other issues around fluid + tracking. + +Build 1.7.10-10.13.3.1366-1.7.10: + cpw: MinecraftForge/FML@0da1263ff9ede99267c03728a1c823b8056d5e44 Enhance error output for bad textures a bit more and try and capture more types of error.. + +Build 1.7.10-10.13.3.1365-1.7.10: + cpw: MinecraftForge/FML@be5ec06e3144d55a03d125f3ce364eade3771f4f Cleaning up the missing resource stack spam, and condensing the information into a usefully understandable format. + +Build 1.7.10-10.13.3.1364-1.7.10: + cpw: + MinecraftForge/FML@ce791cb1f2cf983ef77b1e5c4028ddefab394062 Rework EventSubscriptionTransformer to bake @Cancelable and @HasResult values, should increase EventBus performance even more by removing logic from Event constructors. + MinecraftForge/FML@852710962a9b6d7c8e2ca188c715eebb2da44c2a Clean up some dead code + +Build 1.7.10-10.13.3.1363-1.7.10: + kinglemming: + Adds a warning to the FluidContainerRegistry when a mod does something stupid! Also denies the registration. + + Signed-off-by: King Lemming + +Build 1.7.10-10.13.3.1362-1.7.10: + kinglemming: + Fixes FluidContainerRegistry properly - no more corner case where client/server mods disagree. + + Also clarifies the 2x Fluid registration error message somewhat. + + Signed-off-by: King Lemming + +Build 1.8-11.14.1.1361: + LexManos: MinecraftForge/FML@4a753227adb805d29f3bf245c3f8427193c35544 Rework EventSubscriptionTransformer to bake @Cancelable and @HasResult values, should increase EventBus performance even more by removing logic from Event constructors. + +Build 1.7.10-10.13.3.1360-1.7.10: + kinglemming: + Fixes #1782 + + Signed-off-by: King Lemming + +Build 1.8-11.14.1.1359: + Abrar Syed: changed run configs to GradleStarts + +Build 1.7.10-10.13.3.1358-1.7.10: + me: + Fix FluidRegsitry.registerFluid + + FluidRegistry: + ```java + static BiMap fluids = HashBiMap.create(); + static BiMap fluidIDs = HashBiMap.create(); + ... + public static boolean registerFluid(Fluid fluid) + { + if (fluidIDs.containsKey(fluid.getName())) + ^^^^^^^ + ``` + There is definitely should be fluids instead fluidIDs. This mistake broke many mods. + +Build 1.8-11.14.1.1357: + LexManos: + Updated FML: + MinecraftForge/FML@c8160311d580f2dfccdf796a5243e16844787cb6 Stop IllegalFormatConversionException thrown if @Mod has flagged client-only or server-only + MinecraftForge/FML@9a894952afb526436649f608f7af5992b97f044c Merge pull request #627 from GotoLink/patch-1 + MinecraftForge/FML@40faac64520d1a197f08eaa9a0f850e7df43359a Remove J7 only constructor in EnhancedRuntimeException, J6 compiling compatibility restored. + +Build 1.7.10-10.13.3.1356-1.7.10: + LexManos: MinecraftForge/FML@31cf2a9cab6d1977d31436220d9612eaa13d4e0f Remove J7 only constructor in EnhancedRuntimeException, J6 compiling compatibility restored. + LexManos: Restore binary compatibility issues in FluidRegistry caused by recent changes. + +Build 1.7.10-10.13.3.1355-1.7.10: + cpw: + Removed fluidID from ItemStack. + + This fixes a rather huge issue where FluidStacks on the client could be desynced if a modder was unaware of it. + + This is a breaking change but can be mitigated with a transformer to the getter getFluidID(). + + Signed-off-by: King Lemming + cpw: Add in a fluidid transformer + cpw: Fix formatting + cpw: + Allow for duplicate Fluid Blocks. It's annoying to be sure but just as with the OreDictionary, we'll have to handle it. + + Signed-off-by: King Lemming + cpw: + You shouldn't be creating FluidStacks from unregistered Fluids. Warn clearly on failed registrations, and make a useful log message for failed fluidstack + creations. Should help a lot with tracking down broken mods that are doing this wrongly. + +Build 1.8-11.14.1.1354: + ohai.iChun: Readded but deprecated the old RenderPlayerEvent that were deleted. Sorry, Lex. + +Build 1.8-11.14.1.1353: + ohai.iChun: + Reimplement RenderPlayerEvent that was removed in the port to 1.8 from 1.7.10. + RenderPlayerEvent.Specials was removed because the special effects are done in the LayerRenderer now. + +Build 1.7.10-10.13.2.1352-1.7.10: + cpw: + Forge really should have always supported the concept of an "exact spawn". Individual world providers can still + change this behaviour of course, but for default maps it makes sense to support it as a config option. + +Build 1.7.10-10.13.2.1351-1.7.10: + cpw: + MinecraftForge/FML@12ccf9cf49b76140841cdc5a459422ae4781de1a Rather than try to fall back to the backup level.dat in case of weirdness in the ID map, just fail hard. There is probably a serious modder derp in this case and there's nothing FML can do to recover the situation except avoid making it worse. + MinecraftForge/FML@e8cd368da30661ed2898fff232e2db787edcbdcc It's an IllegalState not an IllegalArgument *sigh* + MinecraftForge/FML@2be9c743424c92f8799a6af1d59d60edd65e6bf0 And fix itemblocks being removed, leaving behind a residual block. This is a legitimate action - use the missing mapping event to let the mod tell us about it + MinecraftForge/FML@7d8804cf656081d1570068f52e9bfc7140b21a65 You can't setAction to BLOCKONLY + MinecraftForge/FML@c73861efe67594ee9995bc93744cab06bd6647d1 Cherry-pick 01aaa7dc97480b381ca0d192ec65016d7baeb747 Fix mods defined via --mods or --modListFile launch args not being searched for coremods. #560 + MinecraftForge/FML@94c45b48c1265e7c4f60f591d413fa545787d354 Fix json cache crash, handle the file much more cleanly. Probably an MC JIRA since it's a vanilla bug. Closes #619 + +Build 1.8-11.14.1.1350: + LexManos: + Updated FML: + MinecraftForge/FML@1de3bf733aef754f15de55006b1750376871feb0 Fix FML's package for net.miencraftforge on maven. Fixes uploading of new builds. Note: 1.7.10 builds are bug fixes only while FML/Forge for 1.8 stabelizes. + MinecraftForge/FML@05ecefb53857ecc1dc52d4a577ed593c26da9659 Update to ASM5 for Java 8 support + MinecraftForge/FML@1112c455b9758c38eab385f48578bad17c0180f9 Merge pull request #595 from Grinch/master + LexManos: Fixed potential NPEs in Structure code caused by componenets not being able to load. + cpw: + MinecraftForge/FML@6b0ae369eb9b8cf89eb9d53fe997a6e5ef222093 Try and improve performance of the registry by avoiding superType.cast. + MinecraftForge/FML@dfebcafd49550b8c3f90c6c028ef0d7f3a13e607 Something I meant to add a long time ago, but it got overlooked. My apologies. Presend the (int) dimension ID in the serverhello packet. This should be 100% backward compatible with existing servers but bumping a server to this version will allow clients with this version as well to now login in dimensions outside the byte range. Probably fixes a bunch of mods that add dimensions. + MinecraftForge/FML@6011419fa055c1375d05189f9bf0d86705c9c0ec Clean up my patch. Terrible person I am.. + MinecraftForge/FML@c6bbd0e82de3d8f7993d70aa7be3f883b3afbc47 Forgot that I need a noarg ctor. I'm so rusty. + MinecraftForge/FML@6edc1635de163c41b6b5dfe02bee13d6a9c5aa4d Need to load the dimension from disk - do it without filling out the player so that the normal player loading (including events) works properly + cpw: + MinecraftForge/FML@4ca6f6e19f3c3147fcf48c58669f55478a9a1345 What a dumb oversight. One needs to copy the active substitution set to the active gamedata. Doesn't work well otherwise. + MinecraftForge/FML@6f6cec96be73b4c94999cf60dc00741f3f3c2cc2 Substitutions need to be activated when they're registered, otherwise they won't appear in world, ever. + MinecraftForge/FML@13ac015f0c36b8e2091ae332c556be315429f4c8 Change iterator behaviour for the registry - include substitutions in the standard iterator, so that vanilla MC methods visit them (so they can get textures etc). The fml special one only visits the absolute set, used mostly for sanity checking and serialization. + LexManos: + MinecraftForge/FML@24cb4a42c4e4bddde95c0e49d1f8b8bcc20c626d Enhance output of common FML errors in crash reports and server GUI. + Force load anonymous minecraft classes used in crash reports. This prevents some crashes being hiddedn behind class definiton exceptions. + cpw: Experimental "fix" for the weird rendering in the Acheivements screen. Thanks skyboy for spotting this. + cpw: + Comment on previous commit fix - it worked. Thanks to skyboy and tterrag for investigating and verifying. + A chest as an acheivement icon will recreate the original problem, for note. + cpw: + Update FML - merge the 1.7.10 changes in to forge @ 1.8. Wow git is (sorta) AWESOME! + + MinecraftForge/FML@6b0ae369eb9b8cf89eb9d53fe997a6e5ef222093 Try and improve performance of the registry by avoiding superType.cast. + MinecraftForge/FML@dfebcafd49550b8c3f90c6c028ef0d7f3a13e607 Something I meant to add a long time ago, but it got overlooked. My apologies. Presend the (int) dimension ID in the serverhello packet. This should be 100% backward compatible with existing servers but bumping a server to this version will allow clients with this version as well to now login in dimensions outside the byte range. Probably fixes a bunch of mods that add dimensions. + MinecraftForge/FML@6011419fa055c1375d05189f9bf0d86705c9c0ec Clean up my patch. Terrible person I am.. + MinecraftForge/FML@c6bbd0e82de3d8f7993d70aa7be3f883b3afbc47 Forgot that I need a noarg ctor. I'm so rusty. + MinecraftForge/FML@6edc1635de163c41b6b5dfe02bee13d6a9c5aa4d Need to load the dimension from disk - do it without filling out the player so that the normal player loading (including events) works properly + MinecraftForge/FML@4ca6f6e19f3c3147fcf48c58669f55478a9a1345 What a dumb oversight. One needs to copy the active substitution set to the active gamedata. Doesn't work well otherwise. + MinecraftForge/FML@6f6cec96be73b4c94999cf60dc00741f3f3c2cc2 Substitutions need to be activated when they're registered, otherwise they won't appear in world, ever. + MinecraftForge/FML@13ac015f0c36b8e2091ae332c556be315429f4c8 Change iterator behaviour for the registry - include substitutions in the standard iterator, so that vanilla MC methods visit them (so they can get textures etc). The fml special one only visits the absolute set, used mostly for sanity checking and serialization. + MinecraftForge/FML@24cb4a42c4e4bddde95c0e49d1f8b8bcc20c626d Enhance output of common FML errors in crash reports and server GUI. + MinecraftForge/FML@12ccf9cf49b76140841cdc5a459422ae4781de1a Rather than try to fall back to the backup level.dat in case of weirdness in the ID map, just fail hard. There is probably a serious modder derp in this case and there's nothing FML can do to recover the situation except avoid making it worse. + MinecraftForge/FML@e8cd368da30661ed2898fff232e2db787edcbdcc It's an IllegalState not an IllegalArgument *sigh* + MinecraftForge/FML@2be9c743424c92f8799a6af1d59d60edd65e6bf0 And fix itemblocks being removed, leaving behind a residual block. This is a legitimate action - use the missing mapping event to let the mod tell us about it + MinecraftForge/FML@7d8804cf656081d1570068f52e9bfc7140b21a65 You can't setAction to BLOCKONLY + MinecraftForge/FML@13df640d9d4516219b07778edd76efd2643019f6 Pull in a lot of the FML tweaks from 1.7 to 1.8 + MinecraftForge/FML@447beaa99ec828fb83796185d07c72ea28b056c9 Merge remote-tracking branch 'origin/1.7.10' + +Build 1.8-11.14.1.1349: + cpw: + MinecraftForge/FML@2afd55ab825fad3b07073c474cdb96b348701084 Fix scala mods, Closes #621 + MinecraftForge/FML@c541b08ef68161f437eeb7b22eabe27b20eebf55 Merge pull request #622 from diesieben07/scala-fix + MinecraftForge/FML@d5021417dd10f36dc3d1b68e4975eb91f7f46e68 Forgot the register handling bit. Registration should work now.. + MinecraftForge/FML@5a65c6568699acaade8243040d8552b1f2e2e28f OK, this is finally actually working, I think... + +Build 1.8-11.14.1.1348: + fry: Fixed mipmapping not being enabled by expanding 1x1 texture + +Build 1.7.10-10.13.2.1347-1.7.10: + cpw: + Comment on previous commit fix - it worked. Thanks to skyboy and tterrag for investigating and verifying. + A chest as an acheivement icon will recreate the original problem, for note. + +Build 1.7.10-10.13.2.1346-1.7.10: + cpw: Experimental "fix" for the weird rendering in the Acheivements screen. Thanks skyboy for spotting this. + +Build 1.8-11.14.1.1344: + LexManos: + Updated FML: + MinecraftForge/FML@2a268cd5664b6562a4bf2a953a6a93fd8e111bd2 Improve mod list GUI, add sort and search + MinecraftForge/FML@951fc2d9fd7e7970c86accb1be095a24f7bfaf18 First attempt at making FMLControlledRegistry something a bit more generic than just blocks/items. + MinecraftForge/FML@410582222d9ba15d42dc47db0d3d6a84aeac2d22 Merge pull request #614 from tterrag1098/betterModList + MinecraftForge/FML@ba0b176430cdbc3573643a6e21d47013cfd1f0e0 Fix ModDiscoverer ignoring inner classes. + MinecraftForge/FML@9cc313eab9939724786f833f511a87c9957dbc72 Merge pull request #617 from diesieben07/innerclass-disc + MinecraftForge/FML@01aaa7dc97480b381ca0d192ec65016d7baeb747 Fix mods defined via --mods or --modListFile launch args not being searched for coremods. #560 + MinecraftForge/FML@8cecc47b85db68e8e69f45641b1d843509dbe71d Merge pull request #620 from killjoy1221/extra-coremod-fix + MinecraftForge/FML@38d9a5f444815810dec3607f5b3b7ff1ac513d4c Enhance output of common FML errors in crash reports and server + + Force load anonymous minecraft classes used in crash reports. This prevents some crashes being hiddedn behind class definiton exceptions.GUI. + +Build 1.7.10-10.13.2.1343-1.7.10: + LexManos: + MinecraftForge/FML@24cb4a42c4e4bddde95c0e49d1f8b8bcc20c626d Enhance output of common FML errors in crash reports and server GUI. + Force load anonymous minecraft classes used in crash reports. This prevents some crashes being hiddedn behind class definiton exceptions. + +Build 1.7.10-10.13.2.1342-1.7.10: + cpw: + MinecraftForge/FML@4ca6f6e19f3c3147fcf48c58669f55478a9a1345 What a dumb oversight. One needs to copy the active substitution set to the active gamedata. Doesn't work well otherwise. + MinecraftForge/FML@6f6cec96be73b4c94999cf60dc00741f3f3c2cc2 Substitutions need to be activated when they're registered, otherwise they won't appear in world, ever. + MinecraftForge/FML@13ac015f0c36b8e2091ae332c556be315429f4c8 Change iterator behaviour for the registry - include substitutions in the standard iterator, so that vanilla MC methods visit them (so they can get textures etc). The fml special one only visits the absolute set, used mostly for sanity checking and serialization. + +Build 1.8-11.14.1.1341: + simonbarnes1: + Add getTileData() to TileEntity + + - The same idea as Entity.getEntityData() + +Build 1.7.10-10.13.2.1340-1.7.10: + cpw: + MinecraftForge/FML@6b0ae369eb9b8cf89eb9d53fe997a6e5ef222093 Try and improve performance of the registry by avoiding superType.cast. + MinecraftForge/FML@dfebcafd49550b8c3f90c6c028ef0d7f3a13e607 Something I meant to add a long time ago, but it got overlooked. My apologies. Presend the (int) dimension ID in the serverhello packet. This should be 100% backward compatible with existing servers but bumping a server to this version will allow clients with this version as well to now login in dimensions outside the byte range. Probably fixes a bunch of mods that add dimensions. + MinecraftForge/FML@6011419fa055c1375d05189f9bf0d86705c9c0ec Clean up my patch. Terrible person I am.. + MinecraftForge/FML@c6bbd0e82de3d8f7993d70aa7be3f883b3afbc47 Forgot that I need a noarg ctor. I'm so rusty. + MinecraftForge/FML@6edc1635de163c41b6b5dfe02bee13d6a9c5aa4d Need to load the dimension from disk - do it without filling out the player so that the normal player loading (including events) works properly + +Build 1.8-11.14.1.1339: + erlend: Added newVolume and newPitch to PlaySoundAtEntityEvent. Deprecated ForgeEventFactory.onPlaySoundAt, added replacement ForgeEventFactory.onPlaySoundAtEntity. + +Build 1.8-11.14.1.1338: + Geforce132: -Added EntityMountEvent. + +Build 1.8-11.14.1.1337: + diesieben07: Fix jukebox message being too low with forge + +Build 1.8-11.14.1.1336: + LexManos: + Updated FML: + MinecraftForge/FML@3e7ae47f8f5d642b256adbe8b3395bb40daf85da Fix Event Bus Access Issues + MinecraftForge/FML@c8e2a5f377ddf8a35cceda6a14697dbe8cad4ca8 Fixed WorldInfo properties not loaded + MinecraftForge/FML@7f96b2c69ab8a2ed07b5b786b3d679ea4c509121 Fix Debug packet logger on local memory connections. + +Build 1.8-11.14.1.1335: + robin: remove translation and add a note for contributors + +Build 1.8-11.14.1.1334: + erju01: Fixed enchanting table applying secondary enchs. + +Build 1.8-11.14.1.1333: + mnmiller1: Add NeighborNotiftyEvent. + +Build 1.8-11.14.1.1332: + tmtravlrsmail: + Added Nether Fortress chest to the ChestGenHooks + + I tried to follow the directions on + + https://github.com/MinecraftForge/MinecraftForge/wiki/If-you-want-to-contribute-to-Forge + + as best as I could. =) + + If anything is wrong, let me know and I'll change it! + clienthax: + Current spawner implementation checks the EntitySpawnPlacementRegistry hashmap to check where a entity should spawn + as there is no way to modify this without the use of reflection or a AT, you can not specify where you want your entity to spawn + adding this helper method will allow developers to specify where they want their entity to spawn. + + Signed-off-by: Clienthax + + Update EntitySpawnPlacementRegistry.java.patch + LexManos: Fix compile error in ClientHax's PR. + +Build 1.8-11.14.1.1329: + fry: Hopefully fix NPE during baking of empty vanilla item models + +Build 1.8-11.14.1.1328: + LexManos: Fire WorldEvent.Load for Client worlds. Closes #1719 + +Build 1.8-11.14.1.1327: + LexManos: Make Container.mergeItemStack respect Slot.isValidItem Closes #1630 + +Build 1.8-11.14.1.1326: + LexManos: Fix JukeBoxes not storing the inserted record. All TE's in minecraft are in net.minecraft.tileentity EXCEPT JukeBoxes. Closes #1633 Closes #1714 + +Build 1.8-11.14.1.1325: + LexManos: Fix NPEs in last commit. + +Build 1.8-11.14.1.1324: + LexManos: + Updated FML: + MinecraftForge/FML@c9cf3136c265b2e8e46eab102b2310a9312b8cfb New @Mod properties to define which environment to load the mod on. + clientSideOnly will only be loaded in the Client environment. + serverSideOnly will only be loaded in the Dedicated server environment. + Combine with acceptedMinecraftVersions to prevent users from loading the mod in the incorrect environment. + +Build 1.8-11.14.1.1323: + LexManos: + Updated FML: + MinecraftForge/FML@5eff40897545c9e6f597a202bc9e86c3b07761ad Filter more known libraries from potential mod canidates. + MinecraftForge/FML@feb4c436db27a249dd5190023edd38cb5884e90b Quiet ClassPatchManager debug spam by default. Reenable using -Dfml.debugClassPatchManager=true. + MinecraftForge/FML@41e806fa950839bf901ebf9c18d0c632a7c5538c Fix double decoding of UTF8 characters in lang files. + +Build 1.8-11.14.1.1322: + LexManos: Fixed using items on the wrong block client side caused by iChuns eyeheight update. + +Build 1.8-11.14.1.1321: + ohai.iChun: Reimplement variable eyeHeight for players which was removed in the 1.7 to 1.8 port. + +Build 1.8-11.14.1.1320: + fry: Removed event bus call from the ModelLoader + +Build 1.8-11.14.1.1319: + matthewprenger: Add the ability to add prefixes and suffixes to the player's display name. + LexManos: Add safty to URL detection in chat. Closes #1712 + +Build 1.8-11.14.1.1318: + fry: Added a default white texture; Fixed B3DLoader crashing when the brush has empty texture specified + fry: RenderItem can now use baked quad color + +Build 1.8-11.14.1.1317: + Parker Young: + Added ATs for EnumFacing + + This publics the VALUES array and HORIZONTALS array in EnumFacing, thus giving modders access to these arrays, much like ForgeDirection had. + +Build 1.8-11.14.1.1316: + fry: Attributes.put (de)normalization now works as intended + +Build 1.8-11.14.1.1315: + LexManos: Hold a weak reference to the Minecraft fake player object. Closes #1705 + +Build 1.8-11.14.1.1314: + matthewprenger: Minor tweak to UsernameCache to also cache usernames of offline players. + +Build 1.8-11.14.1.1313: + fry: Updated FML + +Build 1.8-11.14.1.1312: + fry: ModelRotation.getMatrix() now returns the correct matrix; fixed the application of custom transformations to vanilla models; fixed application of transformations to B3D models; fixed the culling of rotated vanilla models + +Build 1.8-11.14.1.1311: + fry: Alternative models work once again + +Build 1.8-11.14.1.1310: + fry: Updated FML + +Build 1.8-11.14.1.1309: + fry: fix ModelLoader.setCustomModelResourceLocation not storing same item with different metadata values + +Build 1.8-11.14.1.1308: + LexManos: Fixed debugging Dedicated server in Forge Dev workspace. + LexManos: Fixed being kicked from the server while swimming. + fry: + fixed NPE during loading of B3D models without textures/brushes. + changed default B3D color to have full opacity. + fry: Reworked vanilla texture resolution, hopefully fixes NPE bug in FaceBakery + fry: made renderLayer ThreadLocal, now it should hold correct value for use inside custom baked models + LexManos: Try a maven mirrior to fix build issues. + +Build 1.7.10-10.13.2.1307-1.7.10: + LexManos: Fixed potential NPEs in Structure code caused by componenets not being able to load. + +Build 1.8-11.14.1.1306: + LexManos: Fixed potential NPEs in Structure code caused by componenets not being able to load. Closes #1686 + +Build 1.8-11.14.1.1305: + LexManos: Fixed InitMapGenEvent's fire order so values are used. And added OCEAN_MONUMENT type. Closes #1681 + LexManos: Fixed BlockBush and BlockCrops not respecting custom soils. Closes #1683 + +Build 1.8-11.14.1.1303: + fry: Restore binary backwards compatibility + +Build 1.8-11.14.1.1302: + fry: ModelBakeEvent now has ModelLoader as an argument instead of ModelBakery; Added various static hooks to ModelLoader to allow registering model-related information before it's needed (prevents file-not-found errors on first baking pass); ModelLoader waits until ModelBakeEvent is done before showing any missing model exceptions; It's now possible to define models completely in-code (as illustrated by ModelBakeEventDebug). + +Build 1.8-11.14.1.1301: + LexManos: Bump version to 11.14.1 for next development cycle. + +Build 1.8-11.14.0.1299: + fry: Fixed tracking of UV locking state. Closes #1679 + +Build 1.8-11.14.0.1298: + LexManos: Fixed ItemFrames not having a model. Closes #1678 + LexManos: Updated FML: MinecraftForge/FML@22c9656196dbbea8ed983663d536c3ca272d7282 Reset S->C CustomPayload data after Write, allowing the same packet to be written multiple times. + +Build 1.8-11.14.0.1297: + LexManos: Fixed domain support in ArmorMaterial texture name. Closes #1675 + LexManos: Fixed Buttons not dropping anything when broken. Closes #1676 + +Build 1.8-11.14.0.1296: + LexManos: + Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8. + + Some notes: + Almost all int x, int y, int z parameters have been changed to BlockPos class + ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing. + All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml + Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it. + Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated. + As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format. + Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata. + Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits. + LexManos: Fix local variable conflict in Forge patch and latest MCP mappings. + LexManos: Fix fog colors, Closes #1524 + LexManos: Fix acedential inversion causing some tress to not have leaves. Closes #1522 + LexManos: Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 + LexManos: Fixed crash with caomparators due to wrong position. Closes #1512 + LexManos: Fix inverted logic preventing blocks from breaking. + LexManos: Fix Entityies not taking damage correctly. Closes #1511 + LexManos: Fix wrong state being passed to Block.getDrops + LexManos: Fix potential NPE in Block.isToolEffective + LexManos: Update RecipeSorter for new 1.8 recipies. + LexManos: Fix destroy particles not being added. Closes #1528 + LexManos: Fix debug screen not showing grey background. Closes #1529 + LexManos: Fix not being able to place blocks in liquids, and related issues. + LexManos: + Updated FML: + MinecraftForge/FML@36644e97714b46dbbb24416febdde1332a3e753c Finalize modded handshakes in the World tick thread. Prevents potential CMEs when login event takes to long to fire. + LexManos: Fix interacting with entities. + LexManos: Fixed Entity extended properties init order. Closes #1532 + LexManos: Fixed Entities not being able to climb ladders, Closes #1535 + LexManos: Fixed snow layers not being able to stack more then twice. Closes #1534 + LexManos: Fix BlockPane's connection detection. + LexManos: Fixed vanilla bug where top part of double plants would flicker a tifferent texture before dissapearing. + LexManos: Fix NPE with BlockSnapshots that caused items with TileEntities to be used up in creative mode. + LexManos: Fixed vanilla issue where exceptions in World tasks would not be logged. + LexManos: Fixed blocks not breaking properly when instantly destroied. + LexManos: Fix stickey pistons not retracting properly. + LexManos: + Updated FML: + MinecraftForge/FML@9c8ca4a4e3c4acc4980535e5c60da169b75a7810 Unlink banner block and item id. Mojang should of matched these up but they didn't -.- + MinecraftForge/FML@84a101f344b8fc21de1201fde717fbcbcba2aa79 Update Dev mcp mappings to 11-30 snapshot. + LexManos: Remove debug patch I left in. + LexManos: Fix finding of spawn location for mobs. Closes #1546 + LexManos: Only call blockBreak when block itself changes, not just meta. Fixes bottles poping out of brewing stands. + fry: Added model bake event (allows mods to insert custom baked models, much like TextureStitchEvent allows to load custom textures), ISmartBlock/ItemModel (ability form models to react to block/item states), Block.getExtendedState, support for unlisted properties in block states. Includes example implementation of http://imgur.com/a/FyyJX + LexManos: Added Explosion Start and Detonate events to control explosion. + LexManos: Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. + LexManos: Add "sand" to the OreDictionary + LexManos: Cleanup deprecated code, and TODOs in OreDictionary. Down-typed things from ArrayList to List. Asking for the ores with a null stack will now throw an Exception. + LexManos: Added CreateSpawnPosition event. + LexManos: Add LivingHealEvent called from EntityLivingBase.heal() + LexManos: Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. + LexManos: Add quartz_ore tool init, more mojang special casing -.- + LexManos: Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. + LexManos: Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. + LexManos: Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. + LexManos: Unbind Shaped/Shapeless Ore Recipies from Array list to normal List. + LexManos: Fixed NPE thrown when brewing event is fired and not all slots are filled. Closes #1564 + LexManos: Make daylight sensor recipe use ore dictionary wooden slabs Closes #1565 + LexManos: Fix missed patch causing Dispensed Armor to go into the wrong slot. Closes #1560 + LexManos: Fixed log spam when breaking DoublePlants. Closes #1555 + LexManos: Fix texture stitcher not using all avalible spaces. + LexManos: Fix EnumHelper for new ArmorTexture argument. + LexManos: Untie ItemModelMesher from using Item Ids internally by implementing our own simple mechanics using Trove. + LexManos: Fix userdev for new BlockState change. + LexManos: MinecraftForge/FML@e3785c28930a218cf9374458c67c34e7fba17922 Ensure that EntitySpawn and OpenGUI packets are handled in the world thread. Also log all errors that are thrown in FutureTasks. + LexManos: Remove our changes to Stitcher slot allocation. + LexManos: Fix incorrect logic in world change clumping. + LexManos: MinecraftForge/FML@5a4d362293fe70e1421d1f22c4a195944731d6ba Finish removing marker in mapping entry names. FMLMissingMappingsEvent/FMLModIdMappingEvent should fire with correct names now. + jadran.kotnik: Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. + LexManos: Fix BlockSnapshots not firing correctly due to patch mixup in 1.8 update. Closes #1591 + palechip: Fix Scoreboard rendering for the sidebar. + LexManos: Removed exclusion of white stained glass recipes in ore dictionary. + LexManos: Added chests to the ore dictionary. + LexManos: Fix crafting of non-oak fences/gates. + LexManos: Fix MC-30864 (sending web links in chat) + LexManos: Fix recipies for stone variants. + Chicken-Bones: Allow blocks to render in multiple layers + lumien231: Fixes #1603: Moving the start of the update thread to the pre init of the forge mod container + LexManos: Fix potential NPE when loading a single player world where you were saved in a unloaded dimension. Closes #1575 + LexManos: Call World.init from DimensionManager.initDimension Closes #1551 + LexManos: Made Chunk.fillBlock respect TileEntity.shouldRefresh. + LexManos: Fix value passed for Item.getModel useRemaining argument. Closes #1623 + LexManos: Silently eat exceptions when getting a TE's rendering bounding box, this 'fixes' Bukkit servers screwing up world data and causing clients to crash. + jadran.kotnik: Fixed NPE when canceling ClientChatRecievedEvent. Fixes #1644 + Parker Young: Re-enabled Icon setting for Fluids + LexManos: + Updated FML: + MinecraftForge/FML@a55e4124531119f1c9c023cff74cfa09b49ef0e0 Save the mod list of players in their NetworkDispatcher (Make it accessable for mods) + MinecraftForge/FML@69d479d46ae658c5a5c2c00081be3df38e38c748 Fixed getEffectiveSide() for Netty Server threads + MinecraftForge/FML@0f9a33cf14165ddd424a7d82c2178cf5854bf32f Exclude only log4j2 queue from class loader + jadran.kotnik: Don't skip the first line when rendering (debug) text. + fry: + Added model loader registry + + Entry point: ModelLoaderRegistry + loader interface: ICustomModelLoader + custom model: IModel + + ModelLoader is responsible for splicing into vanilla model system. + (you probably don't need to use it directly) + + Interop with vanilla models isn't great yet + (vanilla models can't refer to custom ones as parents), will improve in + the future. + + Includes loader for B3D models, with animation support + (net.minecraftforge.client.model.b3d). + Blender export plugin with compatible coordinate system: + https://github.com/RainWarrior/B3DExport + + OBJ loader is being written, will be included at some point in the + future. For now you can convert OBJ to B3D via blender, or wait. + techStackLp: + Closes #1552 + + Set the destination block the to the fluid. + In the previous code the destination block was still Air and would would + cause a crash because air doesn't have a property for LEVEL + fry: Removed leftover debug messages + LexManos: + Updated FML: + MinecraftForge/FML@d00feb58c762b0bbc506d79faf1ce40bc96732e9 Remove debug code that was causing console spam in Forge. + MinecraftForge/FML@1de3bf733aef754f15de55006b1750376871feb0 Fix FML's package for net.miencraftforge on maven. Fixes uploading of new builds. Note: 1.7.10 builds are bug fixes only while FML/Forge for 1.8 stabelizes. + MinecraftForge/FML@05ecefb53857ecc1dc52d4a577ed593c26da9659 Update to ASM5 for Java 8 support + MinecraftForge/FML@1112c455b9758c38eab385f48578bad17c0180f9 Merge pull request #595 from Grinch/master + MinecraftForge/FML@9c3013e02af1bd2f724d34a30e0b880b6e131645 Merge remote-tracking branch 'origin/1.8' + +Build 1.8-11.14.0.1295-1.8: + fry: Removed leftover debug messages + +Build 1.8-11.14.0.1294-1.8: + techStackLp: + Closes #1552 + + Set the destination block the to the fluid. + In the previous code the destination block was still Air and would would + cause a crash because air doesn't have a property for LEVEL + +Build 1.8-11.14.0.1293-1.8: + jadran.kotnik: Don't skip the first line when rendering (debug) text. + +Build 1.8-11.14.0.1292-1.8: + fry: + Added model loader registry + + Entry point: ModelLoaderRegistry + loader interface: ICustomModelLoader + custom model: IModel + + ModelLoader is responsible for splicing into vanilla model system. + (you probably don't need to use it directly) + + Interop with vanilla models isn't great yet + (vanilla models can't refer to custom ones as parents), will improve in + the future. + + Includes loader for B3D models, with animation support + (net.minecraftforge.client.model.b3d). + Blender export plugin with compatible coordinate system: + https://github.com/RainWarrior/B3DExport + + OBJ loader is being written, will be included at some point in the + future. For now you can convert OBJ to B3D via blender, or wait. + +Build 1.7.10-10.13.2.1291: + lukastenbrink: + Fix fluid tanks incorrectly reading NBT when empty + + If the Empty flag was set, the tank would not correctly read the data, keeping the outdated FluidStack instead. This is especially relevant with updatable TileFluidHandler TEs. + +Build 1.8-11.14.0.1290-1.8: + LexManos: + Updated FML: + MinecraftForge/FML@a55e4124531119f1c9c023cff74cfa09b49ef0e0 Save the mod list of players in their NetworkDispatcher (Make it accessable for mods) + MinecraftForge/FML@69d479d46ae658c5a5c2c00081be3df38e38c748 Fixed getEffectiveSide() for Netty Server threads + MinecraftForge/FML@0f9a33cf14165ddd424a7d82c2178cf5854bf32f Exclude only log4j2 queue from class loader + +Build 1.8-11.14.0.1289-1.8: + Parker Young: Re-enabled Icon setting for Fluids + +Build 1.8-11.14.0.1288-1.8: + jadran.kotnik: Fixed NPE when canceling ClientChatRecievedEvent. Fixes #1644 + +Build 1.8-11.14.0.1287-1.8: + LexManos: Silently eat exceptions when getting a TE's rendering bounding box, this 'fixes' Bukkit servers screwing up world data and causing clients to crash. + +Build 1.7.10-10.13.2.1286: + asiekierka: fix shouldRefresh being too broad in tile entity update + +Build 1.8-11.14.0.1285-1.8: + Chicken-Bones: Allow blocks to render in multiple layers + +Build 1.7.10-10.13.2.1284: + lumien231: Fix versionCheck config option + +Build 1.7.10-10.13.2.1283: + CovertJaguar: Bulk Chunk Data packets should also check TileEntity.shouldRefresh(). + +Build 1.8-11.14.0.1282-1.8: + LexManos: Fix potential NPE when loading a single player world where you were saved in a unloaded dimension. Closes #1575 + LexManos: Call World.init from DimensionManager.initDimension Closes #1551 + LexManos: Made Chunk.fillBlock respect TileEntity.shouldRefresh. + LexManos: Fix value passed for Item.getModel useRemaining argument. Closes #1623 + +Build 1.8-11.14.0.1281-1.8: + lumien231: Fixes #1603: Moving the start of the update thread to the pre init of the forge mod container + +Build 1.8-11.14.0.1280-1.8: + LexManos: Fix recipies for stone variants. + +Build 1.8-11.14.0.1279-1.8: + palechip: Fix Scoreboard rendering for the sidebar. + +Build 1.8-11.14.0.1278-1.8: + LexManos: Removed exclusion of white stained glass recipes in ore dictionary. + LexManos: Added chests to the ore dictionary. + LexManos: Fix crafting of non-oak fences/gates. + LexManos: Fix MC-30864 (sending web links in chat) + +Build 1.7.10-10.13.2.1277: + mattmess1221: Fix MC-30864 (sending web links in chat) + +Build 1.7.10-10.13.2.1276: + clashsoft: Fix Stained Glass pane rendering issues + +Build 1.7.10-10.13.2.1275: + Kittychanley: Removed exclusion of white stained glass recipes in ore dictionary. Closes #1502 & #1481 + +Build 1.8-11.14.0.1274-1.8: + LexManos: Fix BlockSnapshots not firing correctly due to patch mixup in 1.8 update. Closes #1591 + +Build 1.8-11.14.0.1273-1.8: + jadran.kotnik: Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. + +Build 1.7.10-10.13.2.1272: + jadran.kotnik: Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. + +Build 1.8-11.14.0.1271-1.8: + LexManos: Fix incorrect logic in world change clumping. + LexManos: MinecraftForge/FML@5a4d362293fe70e1421d1f22c4a195944731d6ba Finish removing marker in mapping entry names. FMLMissingMappingsEvent/FMLModIdMappingEvent should fire with correct names now. + +Build 1.7.10-10.13.2.1270: + LexManos: Remove our changes to Stitcher slot allocation. + LexManos: Fix incorrect logic in world change clumping. + +Build 1.8-11.14.0.1269-1.8: + LexManos: MinecraftForge/FML@e3785c28930a218cf9374458c67c34e7fba17922 Ensure that EntitySpawn and OpenGUI packets are handled in the world thread. Also log all errors that are thrown in FutureTasks. + LexManos: Remove our changes to Stitcher slot allocation. + +Build 1.8-11.14.0.1268-1.8: + LexManos: Fix userdev for new BlockState change. + +Build 1.8-11.14.0.1267-1.8: + fry: Added model bake event (allows mods to insert custom baked models, much like TextureStitchEvent allows to load custom textures), ISmartBlock/ItemModel (ability form models to react to block/item states), Block.getExtendedState, support for unlisted properties in block states. Includes example implementation of http://imgur.com/a/FyyJX + +Build 1.8-11.14.0.1266-1.8: + LexManos: Untie ItemModelMesher from using Item Ids internally by implementing our own simple mechanics using Trove. + +Build 1.8-11.14.0.1265-1.8: + LexManos: Fix texture stitcher not using all avalible spaces. + LexManos: Fix EnumHelper for new ArmorTexture argument. + +Build 1.7.10-10.13.2.1264: + LexManos: Fix texture stitcher not using all avalible spaces. Closes #1557 + +Build 1.7.10-10.13.2.1263: + LexManos: Fixed NPE thrown when brewing event is fired and not all slots are filled. + +Build 1.8-11.14.0.1262-1.8: + LexManos: Fixed NPE thrown when brewing event is fired and not all slots are filled. Closes #1564 + LexManos: Make daylight sensor recipe use ore dictionary wooden slabs Closes #1565 + LexManos: Fix missed patch causing Dispensed Armor to go into the wrong slot. Closes #1560 + LexManos: Fixed log spam when breaking DoublePlants. Closes #1555 + +Build 1.8-11.14.0.1261-1.8: + LexManos: Unbind Shaped/Shapeless Ore Recipies from Array list to normal List. + +Build 1.8-11.14.0.1259-1.8: + LexManos: Add quartz_ore tool init, more mojang special casing -.- + LexManos: Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. + LexManos: Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. + LexManos: Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. + +Build 1.7.10-10.13.2.1258: + LexManos: Add quartz_ore tool init, more mojang special casing -.- Closes #1333 and Closes #1335 + LexManos: Fix invalid argument being passed to Block.isNormalCube from World.updateNeighbors. Closes #1339 and Closes #1346 + LexManos: Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. Closes #1355 + LexManos: Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. Closes #1434 + LexManos: Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. Closes #1486 + +Build 1.8-11.14.0.1257-1.8: + LexManos: Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. + LexManos: Add "sand" to the OreDictionary + LexManos: Cleanup deprecated code, and TODOs in OreDictionary. Down-typed things from ArrayList to List. Asking for the ores with a null stack will now throw an Exception. + LexManos: Added CreateSpawnPosition event. + LexManos: Add LivingHealEvent called from EntityLivingBase.heal() + LexManos: Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. + +Build 1.7.10-10.13.2.1256: + LexManos: Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. Closes #1548 + LexManos: Add "sand" to the OreDictionary Closes #1487 + LexManos: Added CreateSpawnPosition event Closes #1053 + LexManos: Add LivingHealEvent called from EntityLivingBase.heal() Closes #1282 + LexManos: Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. Closes #1248 + +Build 1.8-11.14.0.1255-1.8: + LexManos: Added Explosion Start and Detonate events to control explosion. + +Build 1.7.10-10.13.2.1254: + LexManos: Added Explosion Start and Detonate events to control explosion. Closes #1469 + +Build 1.7.10-10.13.2.1253: + draco18s: + Update RenderBlockFluid.java + + Added tessellator calls to render the block's back faces, so that the liquid properly renders when the player is immersed in the fluid. + +Build 1.8-11.14.0.1252-1.8: + LexManos: Fix finding of spawn location for mobs. Closes #1546 + LexManos: Only call blockBreak when block itself changes, not just meta. Fixes bottles poping out of brewing stands. + +Build 1.8-11.14.0.1251-1.8: + LexManos: + Updated FML: + MinecraftForge/FML@9c8ca4a4e3c4acc4980535e5c60da169b75a7810 Unlink banner block and item id. Mojang should of matched these up but they didn't -.- + MinecraftForge/FML@84a101f344b8fc21de1201fde717fbcbcba2aa79 Update Dev mcp mappings to 11-30 snapshot. + LexManos: Remove debug patch I left in. + +Build 1.8-11.14.0.1249-1.8: + LexManos: Fix stickey pistons not retracting properly. + +Build 1.8-11.14.0.1248-1.8: + LexManos: Fixed vanilla bug where top part of double plants would flicker a tifferent texture before dissapearing. + LexManos: Fix NPE with BlockSnapshots that caused items with TileEntities to be used up in creative mode. + LexManos: Fixed vanilla issue where exceptions in World tasks would not be logged. + LexManos: Fixed blocks not breaking properly when instantly destroied. + +Build 1.8-11.14.0.1247-1.8: + LexManos: Fix BlockPane's connection detection. + +Build 1.8-11.14.0.1246-1.8: + LexManos: Fixed Entity extended properties init order. Closes #1532 + LexManos: Fixed Entities not being able to climb ladders, Closes #1535 + LexManos: Fixed snow layers not being able to stack more then twice. Closes #1534 + +Build 1.8-11.14.0.1245-1.8: + LexManos: Fix interacting with entities. + +Build 1.8-11.14.0.1244-1.8: + LexManos: Fix debug screen not showing grey background. Closes #1529 + LexManos: Fix not being able to place blocks in liquids, and related issues. + LexManos: + Updated FML: + MinecraftForge/FML@36644e97714b46dbbb24416febdde1332a3e753c Finalize modded handshakes in the World tick thread. Prevents potential CMEs when login event takes to long to fire. + +Build 1.8-11.14.0.1243-1.8: + LexManos: Fix potential NPE in Block.isToolEffective + LexManos: Update RecipeSorter for new 1.8 recipies. + LexManos: Fix destroy particles not being added. Closes #1528 + +Build 1.8-11.14.0.1242-1.8: + LexManos: Fixed crash with caomparators due to wrong position. Closes #1512 + LexManos: Fix inverted logic preventing blocks from breaking. + LexManos: Fix Entityies not taking damage correctly. Closes #1511 + LexManos: Fix wrong state being passed to Block.getDrops + +Build 1.8-11.14.0.1241-1.8: + LexManos: Fix fog colors, Closes #1524 + LexManos: Fix acedential inversion causing some tress to not have leaves. Closes #1522 + LexManos: Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 + +Build 1.7.10-10.13.2.1240: + LexManos: Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 + +Build 1.8-11.14.0.1239-1.8: + LexManos: Fix local variable conflict in Forge patch and latest MCP mappings. + +Build 1.7.10-10.13.2.1236: + xcompwiz: + Fixes client-side fake rain + + Changes the updateWeather function in WorldServer to only send the + weather info to players in the correct dimension, rather than all + players on the server. This is what causes the client-side rain, as the + client believes that it has started raining locally, rather than in + another dimension. + +Build 1.7.10-10.13.2.1235: + oliver.kahrmann: + Modify WavefrontObject to allow '.' in group object names + + Blender names objects with .001 ir .002 when separating vertices or duplicating objects and the importer would crash on them. This fixes the regex to allow dots in the name. + +Build 1.7.10-10.13.2.1234: + LexManos: Player sensitive version of Block.getPickBlock Closes #1348 + +Build 1.7.10-10.13.2.1233: + LexManos: Fix slots being black due to vanilla blending leakage Forge fixes. Closes #1325 & #1242 + +Build 1.7.10-10.13.2.1232: + luacs1998: + Create CONTRIBUTING.md + + Simple file (which github will show for those making PRs) containing guidelines for making PRs. + Feel free to comment if you want/need anything added. I can pull the same thing to FML too if you'd like, Lex. + luacs1998: + Update CONTRIBUTING.md + + Add link to wiki page on contributing + +Build 1.7.10-10.13.2.1231: + Adubbz: Fixed desert list initialization. Fixes #1447 + +Build 1.7.10-10.13.2.1230: + LexManos: Fix logic error in Blodd's Snapshot capture that caused blocks to not be updated to the client. Closes #1451 + LexManos: Bump version for new RB. + +Build 1.7.10-10.13.1.1229: + Abrar Syed: implemented crowdin support + matthewprenger: Add username cache for determining a player's last known username + azanor1: + Fix for biome weights under 10 + + This solves the problem where custom mod biomes with weights under 10 + not being generated in the world. + + Cleaned up the code and made the patch smaller + +Build 1.7.10-10.13.1.1226: + LexManos: Compleetly disable stencil bits unless told not to by using the -Dforge.forceDisplayStencil=true flag. Should solve the 'menu in bottom corner' issue with Intel Integrated graphics cards. + +Build 1.7.10-10.13.1.1225: + Parker Young: Added PlayerWakeUpEvent + +Build 1.7.10-10.13.1.1224: + Adubbz: Fixed biome weights not working with non multiples of 10 + +Build 1.7.10-10.13.1.1223: + LexManos: Fix vanilla lighting issue and blending issues in achievements gui. Closes #1445 + +Build 1.7.10-10.13.1.1222: + LexManos: MinecraftForge/FML@d00feb58c762b0bbc506d79faf1ce40bc96732e9 Remove debug code that was causing console spam in Forge. + +Build 1.7.10-10.13.1.1221: + LexManos: Disable by default the Display Stencil bits. Keep FBO bits. Acording to Mumfery and ChickenBones, it should not be nessasary and should solve the 1/4 main menu issue. Use -Dforge.forceDisplayStencil=true to enable old behavior. + +Build 1.7.10-10.13.1.1220: + jadran.kotnik: Prevent client only commands from bleeding through to the server. + +Build 1.7.10-10.13.1.1219: + bloodshot: + Added PlaceEvent and MultiPlaceEvent which fires before placing a block. + + Before calling "ItemStack.tryPlaceItemInWorld", a recording flag is turned on for + setBlock to capture a blocksnapshot for each block that attempts to be placed. + + If 1 block is captured, a "BlockEvent.PlaceEvent" is fired to notify mods. + If 2 or more blocks are captured, a "BlockEvent.PlaceEvent" is fired first with the first block + captured followed by a "BlockEvent.MultiPlaceEvent" with all captured blocks. This extra event + is required for items that have the ability to place 2 or more blocks such as a BlockBed. + + If either event is cancelled, the recorded block snapshot(s), item stacksize, and item meta will + revert back to the captured snapshot(s). + If the events are not cancelled, a notification will be sent to clients and block physics will be updated. + + What this means for mods is Forge will be able to capture all player block placement automatically and fire + a PlaceEvent and/or MultiPlaceEvent. + If for whatever reason your mod does not use the standard placement methods then you will need to fire the + appropriate placement events in order to notify mods/servers. + + This commit also includes a new utility class called BlockSnapshot which is serializable. This new class is used in conjunction with + both PlaceEvent and MultiPlaceEvent in order to record a snapshot of block space before it is altered. This + allows us to restore the block(s) if an event is cancelled. The class also provides the ability to restore a snapshot + to any location using the restoreToLocation method. This should be helpful to many mods that are looking to be able + to capture block data then restore it to back to any location required. + +Build 1.7.10-10.13.1.1217: + cpw: + GIANT FML UPDATE! Bump forge revision number, and fix patches for ItemStack changes. More to come on this branch I expect. + + MinecraftForge/FML@7c5cf219042581545b6073de4e947448ffa10879 Implement STDOUT/STDERR redirection. + MinecraftForge/FML@bc78e31cb7ad4eda6e5faa173cd6b21e70a2c444 added support for \n in tooltip strings added \n test tooltip localization fixed int/double conversion error in slider entry added test slider scenario that highlighted conversion error + MinecraftForge/FML@a2908e5c596bb5502bf455d468d2b1ead0520f55 Clean up a bunch of compiler warnings. + MinecraftForge/FML@7f67523d870ae150071c67b002597542eb206725 Update realms to 1.3.2 + MinecraftForge/FML@73f23c24b85240458f352f248e885684aaff4743 Merge branch 'std-redir' of github.com:Emberwalker/FML + MinecraftForge/FML@1c6b25df740a64c94d9ba05dd7e4412515abf5bb If an IO exception comes from the datawatcher, spew it all over the console don't discard it silently. Should stop pixelmon blaming forge for their mistakes. + MinecraftForge/FML@e77da9eb2f5c58a494ed100dd4c1dd1a0c341dbf And fix the read side too, incase someone is trying to bitbang and failing. + MinecraftForge/FML@305d8950c9332c7a7f290db05e6f18ef328016e2 Make LogContext optional. This can be useful for debugging mod issues, but Apache's implementation in log4j2 is responsible for a very significant % of the overall runtime. Quite frankly this is shockingly bad performance from what is supposed to be a high performance logging framework. Anyway, until we can figure out if we can fix it, we're turning it off by default. + MinecraftForge/FML@bdfca1c8ed463a6053526c7a46a990007711e3d0 Make more noise when people screw up mod downloading and put .jar.zip in their mod folders. + MinecraftForge/FML@21084941127fc882d9968316a8f0669531e484df Add a custom version range factory method. Should hush skyboy's complaints. Closes #486 + MinecraftForge/FML@7c1e6aaa40704001231e602ceaedfa21a5df1edf Add a delegate to every item and block. this should help with renaming fun stuffs. Also, fix all the tabs from my previous commits. *sigh* + MinecraftForge/FML@61fcb4df06dc968fcc31d3e4e524e574acfdbb3b Tweak Itemstack patch to always delegate to the method call. Set the field, so it's in sync. + MinecraftForge/FML@eb8c5ab146f2eb3ad3833d40607da97831278ffb Fix nested directory for language resources. Closes MinecraftForge#1264 + MinecraftForge/FML@7c05e5f70d5387512d0bee33ef99510ee5aac739 Default collections, so that we don't crash if useDependencyInfo is true. Closes #485 + MinecraftForge/FML@9729fe23326a3d4f6b03e60b5cdaf78a484b3657 Kill net.minecraft.src warning. It hasn't served a purpose in a long time now. Closes #313 + MinecraftForge/FML@21e875ef22eef6068ccd6df1bd71cf58cba48eed AllowPlayerLogins only after the server has completed the core init tasks. Closes #372 + MinecraftForge/FML@46cfeade80ae60ad2d8cdb40c5fdfdaeeaf16d00 Add a constructor to CustomModLoadingDisplayException. Closes #387 + MinecraftForge/FML@a6eab2683a15a0cceca7a0ded6095b746cdd017b Update README.txt + MinecraftForge/FML@f75838461cf6d9c5010cbfd2d9ef5ceec03268d7 Last part is the itemstack transformer. Itemstacks should now only be loosely coupled with the items within. + MinecraftForge/FML@51f24e9e6d1bee371cf23cdfd0071de7c5175417 First draft of add alias. It is probably not properly persistent atm. + MinecraftForge/FML@2a4c6424709b20ce1e9bda0d85ce7fac47d157c2 Finally fix stupid NPE error caused by FML trying to parse the super of Object in IDEA envs. + MinecraftForge/FML@c1b1417ee168523154a0edae68c3180814eab1c7 FML now supports passing a json formatted modlist as an argument, as well as a comma separated argument list. These facilitate modpacks mostly, by meaning you don't need to duplicate mods. The modlist is arranged in the maven style, with mods referenced maven-like. + MinecraftForge/FML@3d42cda2a2cf5b24e7a25537d883260857b2107a Build.Gradle Patch + MinecraftForge/FML@20c7add8455cd16a4551ed13336a9ad4f9770cd1 Merge pull request #484 from bspkrs/master + MinecraftForge/FML@26ed4b992eb6341d52d12fb6735415ab8e3c501d Clear button list on FML fatal error screens. The hidden cancel button should not be there. Closes #497 + MinecraftForge/FML@ebe4f5c5e297d5d59ce57138810627a9c7a1b412 Merge pull request #494 from AntonBoch1244/patch-1 + MinecraftForge/FML@ad0da05f5c78d7f3c35a331e993dd6e679fc7ac9 Fix the ItemStack transformer to find the method and field so it works with srg and mcp naming. + MinecraftForge/FML@65d380181a84d35a78791e1bc3c7712cd90506f6 Extend timeout for client to 5 seconds. Should fix Forge #1322 + MinecraftForge/FML@45486a0b6dfca65c4d1dd23176d4c9d13d46b6f5 Fix almost invisible NPE in TerminalTransformer when loading a non-existant class + MinecraftForge/FML@13da3efce07653732971837709ccf4de7e4c5c8e Allow a clean way to exit the game without big ugly warnings, but with logging information available if needed. Closes #496 + MinecraftForge/FML@fda305edfea15ba2015cede72327703f273f74e3 Some more tidying up of the exit handling + MinecraftForge/FML@b087f60c3379d0767247e51cbc3f7c631fe97a08 More cleanup of exit handling, also add a couple more noise classes to the list of things ignored. + MinecraftForge/FML@d6358a466b4614cfc35b403d756fe3ef550ebf50 Cleanup override warnings + MinecraftForge/FML@af7a58b9e50dbacf63cf4b5009abc52301609e1f Update to legacylauncher 1.10 and asm 5.0.3 + MinecraftForge/FML@e6d00440a612c235013f3f92f1756811139a6de0 ItemStack swapping + MinecraftForge/FML@8597e45a0e417948db483006aa54e899f28b05ac Fix NPE from a boolean + MinecraftForge/FML@b9b9daa8a9d1cac8550561f31f118589abc0c30a Fix ups from feedback. + MinecraftForge/FML@d89165021f33fbffb4563d86b30bd261506c6ea6 Mark the promise a success in the outbound handler. + MinecraftForge/FML@2e5ccf7988385d38b964c615776f23a1718f5c27 Update for launchwrapper 1.11. Fixes java 6 compatibility. + MinecraftForge/FML@641250d8536bad3af5a036b70dae94097176b420 Fix java 8u20. Closes #501 and a bunch of other bugs too. + MinecraftForge/FML@292be72639feded03ced26d9a06a98159f7a95b7 Allow client handshake to be reset by server to support BungeeCord. + MinecraftForge/FML@092873fbe5baaee53bee67d26d2fc6d3d003f095 Merge branch 'bungeecord' of github.com:bloodmc/FML + MinecraftForge/FML@134f2f8e8865a91292386a3738bb45bad0477a4b Fix bug with entityspawn - if the entity doesn't extend livingbase, it fails to write a headyaw byte, and everything will be derped for that packet. + MinecraftForge/FML@4852de81e02e2b6c6d006abe20d8497499fdf51f Wrap the server description box a little bit shorter. Stops the overlapping. Closes #489 + cpw: + MinecraftForge/FML@4ce3e73bfe36c02b10f504f93eff1bc94d640e32 Add overloaded version of SimpleNetworkWrapper#registerMessage that takes the MessageHandler instance directly, allowing to specify the same handler for multiple messages. + MinecraftForge/FML@cbe2ccbda461ec0ecf4d776fcd19ab31930cc3f1 Add in ModType to the jar manifest. If it's present, and doesn't have value "FML" it will be skipped from the modloading cycle. This should let liteloader mods have a .jar extension. + MinecraftForge/FML@37cf0174fc62a842d132b2c2cc31e477acfba205 OK, lets make that a csv list. It'll let you be liteloader and fml in one jar file! + MinecraftForge/FML@0475b15eb1a7c35bf4959f1af40606e6ee8a9d03 Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch. + MinecraftForge/FML@abeac06a2e9bf8825b058fa35291165b4d1f1fb3 Two new features. ModLists can have a "parent" mod list. Circularity will result in a crash, so be careful. Mods specified in a child will override ones from a parent (using the maven group:name:classifier triple to identify - ignoring the version component) + MinecraftForge/FML@7fcfedcfef9b5fd85cd1c17aa2013fca1bacd871 Canonicalized file paths in modListFile handling with the minecraftDirectory. + MinecraftForge/FML@633fce19d4b367aed56d79e916f17296842f675c Make Keyevent also fire for key releases + MinecraftForge/FML@57ba2339b630afa22c0fdf060bf28edbf7b34d0f Merge branch 'keyup-event' of github.com:diesieben07/FML + MinecraftForge/FML@1ff048062c7f122731619258a9e5a68a6111d5dd Merge branch 'simple-netw-improve' of github.com:diesieben07/FML + cpw: MinecraftForge/FML@dc02d56195606d3ba2f1c5036fc8c0ddb67c843f Fix derp with ModType annotation. mods should load again now.. + diesieben07: Added Item#isBeaconpayment + cpw: + MinecraftForge/FML@7ab69aff2e19b349e457c1b5fcab8b3b01d22af2 Clean up import + MinecraftForge/FML@c5a90bd456230b201522c268dd9bc5e80a0b57be Is vanilla possible with this mod load, side tests. + MinecraftForge/FML@cad11f3165505e6d725411a9fc2c2ee8362f5827 Allow injecting alternative container types. This is the core support code for allowing sponge plugins! + michafla: + check for IFluidBlock (in addition to Material.liquid) when + determining render height so that non-liquids (gases) render correctly + kat.swales: Fixed Clientside GameProfile UUID being null on offline mode + cpw: + MinecraftForge/FML@63b64482e6dd4c3e2226ec002ceee549045c35ed Add jsr305 dev-time dependancy for Nullable/Nonnull annotations. Unneeded at runtime. + MinecraftForge/FML@5365f5ea3e90ec85552bdb7f1f1237c51b4ea493 Add IEventExceptionHandler for EventBus to allow special handeling exceptions that are fired while running an event. Events now track what 'phase' they are in during the execution process. Each EventPriority is a 'phase'. An exception is thrown if the event attempts to set its phase to a previous one. + +Build 1.7.10-10.13.1.1216-new: + kat.swales: Fixed Clientside GameProfile UUID being null on offline mode + +Build 1.7.10-10.13.1.1215-new: + michafla: + check for IFluidBlock (in addition to Material.liquid) when + determining render height so that non-liquids (gases) render correctly + +Build 1.7.10-10.13.1.1214-new: + cpw: + MinecraftForge/FML@7ab69aff2e19b349e457c1b5fcab8b3b01d22af2 Clean up import + MinecraftForge/FML@c5a90bd456230b201522c268dd9bc5e80a0b57be Is vanilla possible with this mod load, side tests. + MinecraftForge/FML@cad11f3165505e6d725411a9fc2c2ee8362f5827 Allow injecting alternative container types. This is the core support code for allowing sponge plugins! + +Build 1.7.10-10.13.1.1213-new: + diesieben07: Added Item#isBeaconpayment + +Build 1.7.10-10.13.1.1212-new: + cpw: MinecraftForge/FML@dc02d56195606d3ba2f1c5036fc8c0ddb67c843f Fix derp with ModType annotation. mods should load again now.. + +Build 1.7.10-10.13.1.1211-new: + cpw: + MinecraftForge/FML@4ce3e73bfe36c02b10f504f93eff1bc94d640e32 Add overloaded version of SimpleNetworkWrapper#registerMessage that takes the MessageHandler instance directly, allowing to specify the same handler for multiple messages. + MinecraftForge/FML@cbe2ccbda461ec0ecf4d776fcd19ab31930cc3f1 Add in ModType to the jar manifest. If it's present, and doesn't have value "FML" it will be skipped from the modloading cycle. This should let liteloader mods have a .jar extension. + MinecraftForge/FML@37cf0174fc62a842d132b2c2cc31e477acfba205 OK, lets make that a csv list. It'll let you be liteloader and fml in one jar file! + MinecraftForge/FML@0475b15eb1a7c35bf4959f1af40606e6ee8a9d03 Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch. + MinecraftForge/FML@abeac06a2e9bf8825b058fa35291165b4d1f1fb3 Two new features. ModLists can have a "parent" mod list. Circularity will result in a crash, so be careful. Mods specified in a child will override ones from a parent (using the maven group:name:classifier triple to identify - ignoring the version component) + MinecraftForge/FML@7fcfedcfef9b5fd85cd1c17aa2013fca1bacd871 Canonicalized file paths in modListFile handling with the minecraftDirectory. + MinecraftForge/FML@633fce19d4b367aed56d79e916f17296842f675c Make Keyevent also fire for key releases + MinecraftForge/FML@57ba2339b630afa22c0fdf060bf28edbf7b34d0f Merge branch 'keyup-event' of github.com:diesieben07/FML + MinecraftForge/FML@1ff048062c7f122731619258a9e5a68a6111d5dd Merge branch 'simple-netw-improve' of github.com:diesieben07/FML + +Build 1.7.10-10.13.0.1208: + zlyfire.martin: + Update README.txt + + Add in reference to running setupDecompWorkspace to get decompiled classes + +Build 1.7.10-10.13.0.1207: + bernhard.bonigl: Write the correct default value for StringList comments in the config + +Build 1.7.10-10.13.0.1206: + LexManos: Fix AIOOB in BiomeDictionary. Closes #1326 + +Build 1.7.10-10.13.0.1205: + cpw: + Attempt to properly resolve this daft metadata and TE nonsense. This might be mod impacting, if you maintain a reference to a TE via neighbour update calls - you + might see two TEs for a single setblock where previously you saw one. This is a phantom TE being created by badly written neighbour triggers - I'm looking at you + redstone. + + Anyway, with luck, this'll close a slew of bugs across Forge, IC2, MFR, TE, RC. Yeah, fun times. Thanks to LexManos, skyboy and KingLemming for helping figure this + issue out. Quite frankly, from now on, issues with phantom TEs will be mods behaving badly. Modders will need to adapt. + +Build 1.7.10-10.13.0.1204: + LexManos: Fix invalid math in GuiContainerCreative. + +Build 1.7.10-10.13.0.1203: + porcariadagata: Add ItemStack sensitive version of getItemEnchantability + +Build 1.7.10-10.13.0.1202: + LexManos: Add ability for creative tabs that have search bars to customize the text box's width, and prevent the default set of enchanted books from being displayed in those tabs. Closes #1303 Closes #1301 + +Build 1.7.10-10.13.0.1201: + abab9579: + Skylight Hooks for Minecraft Forge + + Mainly for solar/lunar eclipse. + +Build 1.7.10-10.13.0.1200: + JeanGlassmaker: Adds getLocalizedName and getUnlocalizedName to FluidStack + +Build 1.7.10-10.13.0.1199: + vazkii: Fixed items with more than 2 render passes rendering weird in first person + LexManos: Fix patch screwup in Skyboy's Fishing PR -.- + LexManos: Fix metadata for every permutation -.- Closes #1294 + t.tomkins: + Legacy Liquid Load Fix + + nbt.getString("FluidName") no longer returns null, it returns an empty string. + + This patch allows legacy liquids to be resolved once again. + +Build 1.7.10-10.13.0.1198: + DemoXin: + * Added AT for ContainerRepair.stackSizeToBeUsedInRepair (Now public) + * Added ability to AnvilUpdateEvent to alter stackSizeToBeUsedInRepair (vanilla behavior is now reproducable) + * Added AnvilRepairEvent, fired when the player removes an ItemStack from the output slot of ContainerRepair, and allows the chance to damage the anvil to be altered. + +Build 1.7.10-10.13.0.1197: + skyboy026: Add FishingHooks + skyboy026: Update FishingHooks + skyboy026: Add EntityFishHook AT + +Build 1.7.10-10.13.0.1195: + rwtema: Fixed ItemFluidContainer always draining the maximum amount, regardless of the amount remaining. + +Build 1.7.10-10.13.0.1194: + LexManos: Closes #1280 + +Build 1.7.10-10.13.0.1191: + LexManos: Fixed bug that allowed duplication of Fluids with redstone dust. Closes #1279 + +Build 1.7.10-10.13.0.1190: + idont: - Added drainFluidContainer() and getContainerCapacity() helper methods. + +Build 1.7.10-10.13.0.1189: + Adubbz: Added an event for fog rendering + +Build 1.7.10-10.13.0.1188: + cpw: + Revert old light amortization patch. It seems to be breaking chunk sending pretty badly when more + than a couple of people are online. Tests indicate it is not useful anymore. + cpw: MinecraftForge/FML@3231db9376766d619f942b6a526718daa3c68038 Sorta revert 908491d5e7ac26becdac938f38cc90d6b9d73ce1 but merge assets into the map, rather than force overwriting. Fixes skyboy's comment. + +Build 1.7.10-10.13.0.1187: + LexManos: + Updated FML: + MinecraftForge/FML@53887ac59cec8f747e21fd251f94d5a438a69114 Hacky interm solution to #1207 to buy me time to re-write FML's network protocol. + +Build 1.7.10-10.13.0.1186: + LexManos: Fixed NPE that happens sometimes when exiting the game witout fully loading a world {main a dev-time thing} + LexManos: Made skulls respect Block.isReplaceable when placing, also prevented them from deleting blocks when placed at certain angels. Closes #1233 + +Build 1.7.10-10.13.0.1185: + LexManos: + Updated FML: + MinecraftForge/FML@9d40b761974f10ec2b5868a992260792f8a98e5d Don't scan ObjectHolders if there was an error already, derpitude will ensure. + MinecraftForge/FML@76538c1781d6d6a1e4134fb317af99e6f13b46cc Add a terminal transformer and tweaker. + MinecraftForge/FML@aec9228845e50107112bd1f8693f9b4729694c8b Add ExitVisitor to the TerminalTransformer that finds and intercepts any calls to Runtime.exit or System.exit. + MinecraftForge/FML@908491d5e7ac26becdac938f38cc90d6b9d73ce1 Move LaunguageRegistry call above normal asset loading to allow resource packs to override mod's language systems. + MinecraftForge/FML@d13295e28113a1c310d5bbb90ebfe241fefabe02 Fix FMLAT manifest AccessTransformers, class loader fun! + +Build 1.7.10-10.13.0.1184: + Tyler Hancock: + Changed exception message for duplicate enchantment ids to contain the + class path for both enchantments along with the enchantmnet id that has + been duplicated. + +Build 1.7.10-10.13.0.1183: + bspkrs: + Fixed missing assignment of constructor arg (thanks @Lunatrius) + + I must have edited this out when I was cleaning up my formatting commit spam. + +Build 1.7.10-10.13.0.1182: + vincent_a_lee: + Fix comment derp (+1 squashed commits) + + Squashed commits: + + [52c40bc] Fix experience orbs spawning at 32x coordinates clientside + + Add // FORGE comment + + Add // FORGE comment to clarify the purpose of the change + +Build 1.7.10-10.13.0.1181: + vincent_a_lee: + Fix chat opacity + + Add // FORGE comment + + As per convention, add // FORGE comment to clarify the purpose of the change + +Build 1.7.10-10.13.0.1180: + LexManos: + Updated FML: + MinecraftForge/FML@ab52901b8b47a525e2719cf280327e97bad7f91e Force preferIPv4Stack to true early in the load chain to combat netty loopback issues. + MinecraftForge/FML@11893fbbb76569417a415ae794494b8c1150a716 Add system property to skip doing world backups when game registry changes. This is SEVERLY ill-advised, if you do this DO NOT ask for any support. + MinecraftForge/FML@fdb6b34b8fc3f1e0c6beb7bfb940a01a309f1603 Update authlib and realms to latest json data. + MinecraftForge/FML@b3a74882b4d0d704d7061b9d896febb59ab0c269 added slider controls for numerics. default control is textbox, but slider can be used as a custom list entry class. fixed constructor javadocs in GuiConfig + MinecraftForge/FML@7c6d1f7568885ff677e34692ff87b1f0826dfd48 Merge pull request #468 from bspkrs/master + MinecraftForge/FML@692d955c1a5b6d0b8601ae88632ef42136d37393 Update tweaker login to use authlib. + MinecraftForge/FML@c2119eb1c1246ba37304d9e565b4430ed7056db1 Update realms library to 1.3.1, and implement network latch when connecting to Realms. Tested and working. + +Build 1.7.10-10.13.0.1179: + cpw: Add a system property for the stencil, in case config is not available.. + +Build 1.7.10-10.13.0.1178: + the.country.gamer: + RenderBlockOverlayEvent patch + + Fixes skewed XYZ parameters + +Build 1.7.10-10.13.0.1177: + LexManos: Fixed Enchantment.addToBookList Closes #1160 + +Build 1.7.10-10.13.0.1176: + LexManos: Add ability for modders to designate custom biome types. And remove note about automatically registering. Closes #1167 + +Build 1.7.10-10.13.0.1175: + diesieben07: Added hook for custom PotionEffect rendering in the inventory + +Build 1.7.10-10.13.0.1174: + the.country.gamer: + Added RenderBlockOverlayEvent.java + + Adds a Forge event which controls whether an overlay is rendered. + Overlays include: First-person fire, Block (when inside a block) + and water when a player is inside a water block. + + Patched for easier manipulation of event + + Fixed for Lex + + To be squashed + + Removed Contructor + + Added block XYZ parameters + + TODO, the second block overlay event’s XYZ might not be correct + Adubbz: Enhanced the Biome Dictionary with tags based on temperature, vegetation, moisture, trees and others + +Build 1.7.10-10.13.0.1172: + LexManos: Made EmeraldOre respect isReplaceableOreGen. Closes #1157 + LexManos: Added World to ChunkProviderEvent.ReplaceBiomeBlocks, and exposed metadata to End and Nether generation events. Close #1201 + +Build 1.7.10-10.13.0.1171: + tterrag1098: + Add AchievementEvent + + Allows modders to react to players receiving achievements, and cancel + them. + + Fix indentation + + More shortening + + Down to one line... + + Remove newline + +Build 1.7.10-10.13.0.1170: + LexManos: STENCIL buffer and DEPTH buffer, attempt a fix for GL errors. + +Build 1.7.10-10.13.0.1169: + alex grabriel: Added Javadoc comments for Forge Event documentation. + +Build 1.7.10-10.13.0.1168: + LexManos: MinecraftForge/FML@ac994e178a3533aa3c2ad8359aef9e5852c27a72 Scala people test your shit. + +Build 1.7.10-10.13.0.1167: + LexManos: Remove the BLEND enable in rendering damage bars. And exclicitly fix blend states in some GUI elements. + +Build 1.7.10-10.13.0.1166: + cpw: + MinecraftForge/FML@3ee86d0f3e47249030ba2309386f9120025e95c1 updated gradle wrapper to gradle 2.0 + MinecraftForge/FML@627ae73ea655277617912df48b03288ecc79ffea Merge pull request #464 from AbrarSyed/upgradle + MinecraftForge/FML@ee38c1b3f4642c567612f88070d7f9d651994aab Fix unneeded cast causing crash in new Config GUI system. + MinecraftForge/FML@eb92c35a2fa49a0fbe35a33e31cfb58e0674f78e updated run configs for GradleStart/Server classes + MinecraftForge/FML@70dcf80410a6d12c00300c00522582ee49ac4cc8 Merge pull request #465 from AbrarSyed/upgradle + MinecraftForge/FML@0ebdbe77a2b3503db43d36aec50c98ffb8366e20 Updated Scala to latest stable + MinecraftForge/FML@ddba18e6e33a9d9c5b113b1bfc0bfc82803b2607 Merge branch 'patch-1' of github.com:Soaryn/FML into scalaupdate + MinecraftForge/FML@220a37660b2656136c634b435afee6a915fc88fe Update realms to 1.2.9 + MinecraftForge/FML@abd7d0969bed5ce3d766f52b921c2b44e8ba87d2 Merge branch 'scalaupdate' + +Build 1.7.10-10.13.0.1162: + foka_12: + Added FluidStack sensitive version for Fluid's localised name + + Would be helpful for determining names for more complex FluidStacks (with tag compounds for example) + +Build 1.7.2-10.12.2.1161-mc172: + bspkrs: dupe quotes fix for category names + +Build 1.7.10-10.13.0.1160: + Gerard Bruwn: Add RenderItemInFrameEvent + +Build 1.7.10-10.13.0.1159: + LexManos: Fixed issue where Fire's 'fizz' would not play for the person who extinguished the fire. + +Build 1.7.10-10.13.0.1158: + ohai.iChun: Fixed inverted params in FogDensity use + +Build 1.7.10-10.13.0.1157: + LexManos: Add config option to disable attempting to creat screen with Stencil Bits. + LexManos: Add config option to specify the default spawn fuzz factor for the overworld. Closes #1190 + +Build 1.7.10-10.13.0.1156: + LexManos: Fix creative inventory tabs not blending base don items rendered. Closes #1179 + +Build 1.7.10-10.13.0.1153: + bloodshot: + Fixed wrong method call in ChunkIOProvider. + + When a chunk fails to load async, we fallback to the original sync method. + In this case, it was calling the async method twice which ended up causing + a stackoverflow. + +Build 1.7.10-10.13.0.1152: + cpw: MinecraftForge/FML@db219fb287b14fea5148ecdbf07d8ff08704c66a API is now able to "provide" and "own" itself. Useful for libraries without a Mod in them. To go along with this, you can now require an API, with a version, in your mod dependency string + +Build 1.7.10-10.13.0.1151: + bspkrs: fixed compounding quotes issue with category names that require quotes when save is called more than once + +Build 1.7.10-10.13.0.1150: + LexManos: Update to 1.7.10-pre4. + LexManos: Fix flower pots not droping the items that are inside them. + cpw: MinecraftForge/FML@06ab104c9ab798af6d2726e02a238211ff8124e1 Force the descriptors to the right type for the field they're referencing. Fixes the sand issue + cpw: MinecraftForge/FML@e1529845384f4935b7c11d4d36d25db51c0b9a31 Add support for mod access transformers without a coremod requirement. Use the "FMLAT" manifest attribute, with a space separate list of files that live in the 'META-INF' directory. They should conform to standard AT formatting. + cpw: + MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + MinecraftForge/FML@8a240ec3c7e4cf4c57beabdfe9bd408e57de1bdc Merge branch 'master' into mc179 + MinecraftForge/FML@0cd5ef6bb71cda1ef6add892d1247148bf1ecc15 Fix NPE when no FMLAT is defined + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + MinecraftForge/FML@96a7e14a45404449fb72af6d2d5e1efd30003318 Merge branch 'master' into mc179 + MinecraftForge/FML@f45f18b1d71e1c1d12582faa337a19e73ed5fb18 Fix accessing guava from transformers + MinecraftForge/FML@8f7adced471951c798cfa6844b0abc176c93d19b Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are available at mojang, so we can update the json. + cpw: Fix new method with Side.CLIENT when it shouldn't have it. Closes a bunch of reports of problems. + cpw: Clean patch cruft. + cpw: Fix mcp release number + luacs1998: + Update mc version string + + Or was I not supposed to? + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + cpw: + Update to MC 1.7.10, bump to 10.13.0 + + MinecraftForge/FML@bc420dcb0b086899e2aaa218a6f5bd7e91091a90 Fix Eclipse launching attribute + MinecraftForge/FML@1e0134a1ca97a1107ebbe604e5318e6f350fe9c4 Merge pull request #455 from rumickon/feature + MinecraftForge/FML@1c5db211afc9962fedb7fd8450abc45d07807634 Update for release 1.7.10 + MinecraftForge/FML@79a0c5e55905f0f08471d026b744a563ea421236 Merge branch 'mc179' + +Build 1.7.10_pre4-10.12.2.1149-prerelease: + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + +Build 1.7.10_pre4-10.12.2.1148-prerelease: + luacs1998: + Update mc version string + + Or was I not supposed to? + +Build 1.7.2-10.12.2.1147: + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + +Build 1.7.10_pre4-10.12.2.1146-prerelease: + bspkrs: + Added support for new FML config GUI classes + refactored lots of stuff based on comments + + added Configuration.load() exception handling and logging + cpw: MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + cpw: Fix mcp release number + +Build 1.7.2-10.12.2.1145: + bspkrs: + Added support for new FML config GUI classes + refactored lots of stuff based on comments + + added Configuration.load() exception handling and logging + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + +Build 1.7.10_pre4-10.12.2.1144-prerelease: + cpw: Clean patch cruft. + +Build 1.7.10_pre4-10.12.2.1143-prerelease: + cpw: Fix new method with Side.CLIENT when it shouldn't have it. Closes a bunch of reports of problems. + +Build 1.7.10_pre4-10.12.2.1142-prerelease: + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + MinecraftForge/FML@96a7e14a45404449fb72af6d2d5e1efd30003318 Merge branch 'master' into mc179 + MinecraftForge/FML@f45f18b1d71e1c1d12582faa337a19e73ed5fb18 Fix accessing guava from transformers + MinecraftForge/FML@8f7adced471951c798cfa6844b0abc176c93d19b Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are available at mojang, so we can update the json. + +Build 1.7.10_pre4-10.12.2.1141-prerelease: + cpw: + MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + MinecraftForge/FML@8a240ec3c7e4cf4c57beabdfe9bd408e57de1bdc Merge branch 'master' into mc179 + MinecraftForge/FML@0cd5ef6bb71cda1ef6add892d1247148bf1ecc15 Fix NPE when no FMLAT is defined + +Build 1.7.10_pre4-10.12.2.1139-prerelease: + cpw: MinecraftForge/FML@e1529845384f4935b7c11d4d36d25db51c0b9a31 Add support for mod access transformers without a coremod requirement. Use the "FMLAT" manifest attribute, with a space separate list of files that live in the 'META-INF' directory. They should conform to standard AT formatting. + +Build 1.7.10_pre4-10.12.2.1138-prerelease: + cpw: MinecraftForge/FML@06ab104c9ab798af6d2726e02a238211ff8124e1 Force the descriptors to the right type for the field they're referencing. Fixes the sand issue + +Build 1.7.10-pre4-10.12.2.1135-prerelease: + LexManos: Fix flower pots not droping the items that are inside them. + +Build 1.7.2-10.12.2.1133: + Christian: Null check the Item in the supplied stack as well as the stack itself. + +Build 1.7.2-10.12.2.1132: + Christian: And fix firing for single player loading. + +Build 1.7.2-10.12.2.1131: + Christian: Fix derpity derp. + +Build 1.7.2-10.12.2.1130: + Christian: + Fire an event when a player loads or saves from disk. Mods that want to load an additional + player related file from the players dir can now do so in that event. + +Build 1.7.2-10.12.2.1129: + Christian: + Some patch offsets + MinecraftForge/FML@7219061b05db73d245405ef777b412d0787398b6 Also patch in warnings for Vec3Pool - similarly removed. + MinecraftForge/FML@dff22045587b37282adeb2167486a572f51f1f16 FML now sets a security manager (FINALLY!). It's primary purpose at this point is to catch rogue calls to System.exit so that they can cause a proper crash report, rather than silently abandoning the game. + +Build 1.7.2-10.12.2.1128: + lumien231: Fixes a server crash caused by a player joining that is in a non existent dimension + +Build 1.7.2-10.12.2.1127: + thog92: Add missing 1.7 biomes to BiomeDictionary + +Build 1.7.2-10.12.2.1126: + nemesis: + Fixed ArrayIndexOutOfBoundsException in getOreName + + Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids. + +Build 1.7.2-10.12.2.1125: + LexManos: Fixed vines generation for hanging off of trees. + +Build 1.7.2-10.12.2.1124: + bloodshot: + Don't call ChunkDataEvent.Load async + + ChunkDataEvent.Load must be called after TE's are loaded since this is + what mods expect. The event is handled by ChunkIOProvider during + callStage2. + +Build 1.7.2-10.12.2.1123: + bloodshot: + Load chunks asynchronously for players. + + When a player triggers a chunk load via walking around or teleporting + there is no need to stop everything and get this chunk on the main thread. + The client is used to having to wait some time for this chunk and the + server doesn't immediately do anything with it except send it to the + player. At the same time chunk loading is the last major source of file IO + that still runs on the main thread. + + These two facts make it possible to offload chunks loaded for this reason + to another thread. However, not all parts of chunk loading can happen off + the main thread. For this we use the new AsynchronousExecutor system to + split chunk loading in to three pieces. The first is loading data from + disk, decompressing it, and parsing it in to an NBT structure. The second + piece is creating entities and tile entities in the chunk and adding them + to the world, this is still done on the main thread. The third piece is + informing everyone who requested a chunk load that the load is finished. + For this we register callbacks and then run them on the main thread once + the previous two stages are finished. + + There are still cases where a chunk is needed immediately and these will + still trigger chunk loading entirely on the main thread. The most obvious + case is plugins using the API to request a chunk load. We also must load + the chunk immediately when something in the world tries to access it. In + these cases we ignore any possibly pending or in progress chunk loading + that is happening asynchronously as we will have the chunk loaded by the + time they are finished. + + The hope is that overall this system will result in less CPU time and + pauses due to blocking file IO on the main thread thus giving more + consistent performance. Testing so far has shown that this also speeds up + chunk loading client side although some of this is likely to be because + we are sending less chunks at once for the client to process. + + Thanks for ammaraskar for help with the implementation of this feature. + + This commit is based off the following : + + Bukkit/CraftBukkit@b8fc6ab2c12e9b4c8d7b5370e44f23cc838014b2 + Bukkit/CraftBukkit@85f5776df2a9c827565e799f150ae8a197086a98 + Bukkit/CraftBukkit@0714971ca2a31bc729bdd78ded8c69ffb2284813 + Bukkit/CraftBukkit@7f49722f457dcc31f8cac8e011871ff1b7fd3306 + Bukkit/CraftBukkit@53ad0cf1abe9c060ef411a86e9a16352f3e5197e + +Build 1.7.2-10.12.2.1122: + antoine.lucas.33: Add missing onLivingJump calls + +Build 1.7.2-10.12.2.1121: + LexManos: Pop version for new Recomended build. + +Build 1.7.2-10.12.1.1120: + Christian: Warn when chunks are being self-recursively loaded. This can cause serious issues. Modders should watch out. + Christian: MinecraftForge/FML@1a99ec7db612f258983c6ac685da906bf7cde0a6 Deprecate getAABBPool so people can stop using it in mods. Failure to do so will result in 1.7.10 upgrade incompatibility. Use getBoundingBox instead. + +Build 1.7.2-10.12.1.1119: + LexManos: Changed dustLapis to gemLapis to make OM SHUT THE HELL UP. + +Build 1.7.2-10.12.1.1118: + LexManos: Fixed missed metadata offset, and now cache return values of getOres for speed. + +Build 1.7.2-10.12.1.1117: + cojomax99: World fog color and density can now be controlled through an event + +Build 1.7.2-10.12.1.1116: + diesieben07: Fix not being able to change target & attackDamage for EnderTeleportEvent. + +Build 1.7.2-10.12.1.1115: + LexManos: Fixed inverted player parameters in PlayerEvent.Clone, Closes #1142 Closes #1140 + +Build 1.7.2-10.12.1.1114: + LexManos: Changed EntityWolf to EntityTameable in EntityLivingBase.attackEntityFrom, to allow for more custom pets. Closes #1141 + +Build 1.7.2-10.12.1.1113: + LexManos: Rework OreDictionary's internals to be a bit more speedy to help combat modders using it inapropriatly. Closes #1022 Closes #1131 + +Build 1.7.2-10.12.1.1112: + Christian: + MinecraftForge/FML@e3ce211cc798f4d86ca6f974d9ba8b4e389b4dc9 Nullcheck the dispatchers on players. Should stop some crashes when spamming connectivity. + MinecraftForge/FML@480bf2c1d078038bb59c4254a01a5af685c7cb22 Fix REPLY handling in SimpleNetworkWrapper. Closes #440 + +Build 1.7.2-10.12.1.1111: + LexManos: + Fix inverted parameters in OreDictionary.getOreID Closes #1123 + -.- Closes #1120 + +Build 1.7.2-10.12.1.1110: + Adubbz: Greatly simplified the addition of new biomes to the default world + +Build 1.7.2-10.12.1.1109: + LexManos: Added Noteblock change and play events. Closes #1027 #1025 + +Build 1.7.2-10.12.1.1108: + LexManos: Add target world to PlayerInteractEvent for potential 'cross dimension' interaction such as LittleBlocks. Closes #1071 + +Build 1.7.2-10.12.1.1107: + LexManos: Add a couple of localizations to Forge added strings. Closes #1068 + +Build 1.7.2-10.12.1.1106: + rwtema: Fixed setBlock not using the location-specific version of getLightOpacity() + +Build 1.7.2-10.12.1.1105: + LexManos: Filter all vanilla blocks that we missed through Forge's getDrops and BlockDrops events. As well as implemented IShearable for DoublePlants and DeadBushes. Mojang really should generic out some of this stuff instead of repeating logic all over the place! + +Build 1.7.2-10.12.1.1104: + LexManos: Fix patch fuzz + LexManos: Fixed GuiContainer calling button.mouseReleased. Closes #1116 + LexManos: Add comment to RotationHelper telling modders where to actually look, closes #1115 + +Build 1.7.2-10.12.1.1101: + diesieben07: + Add PlayerEvent.StartTracking and .StopTracking & make trackedEntityIDs visible + & Update, as discussed on IRC (squash) + +Build 1.7.2-10.12.1.1100: + vilim.lendvaj: Make finite fluid blocks drainable + +Build 1.7.2-10.12.1.1099: + LexManos: Fix enum helpers for EnumRarity {moved to Commn and changed paramter} and EnumCreatureType {new parameter} and added junit test for them. Closes #1009 + +Build 1.7.2-10.12.1.1098: + Christian: MinecraftForge/FML@1d41aa978d41267e4040ec449e10f49a20edd4fa Fix the side for the compatibility check. Should result in green ticks finally! + +Build 1.7.2-10.12.1.1097: + LexManos: Change IShearable JavaDoc by one line so Anti would shut up. Closes #1054 + +Build 1.7.2-10.12.1.1096: + Christian: MinecraftForge/FML@4512f8e5e316ddaf6a4fe35470f1f88dcdddae1a Warn when the objectholder finds nothing in the registry. Helps debug mismatched names. Also, actually make the scoping thing work with objectholder + +Build 1.7.2-10.12.1.1095: + fry: Added world display list render events + +Build 1.7.2-10.12.1.1094: + foka_12: + Fix getOreIDs not using the wildcard value correctly + + You can see it's not working by requesting the ore IDs from lapis, and you'll see the name "dye" is missing (and that's the one registered using the wildcard). + + Fixed it by inverting the order of the item stack parameters. + +Build 1.7.2-10.12.1.1093: + LexManos: Prevent duplciates in registered Ores in the OreDictionary and clean up some of the code, add new function to return all ores the specified ItemStack satisfies. Closes #1102 + +Build 1.7.2-10.12.1.1092: + vilim.lendvaj: + Fix fluid blocks + For https://github.com/BuildCraft/BuildCraft/issues/1843 . + +Build 1.7.2-10.12.1.1091: + LexManos: + Updated FML: + MinecraftForge/FML@3aba56440aa7a95f6431efcdcb5c127ebafc8891 lastIndexOf, Note Don't code while sick. + +Build 1.7.2-10.12.1.1090: + LexManos: + Updated FML: + MinecraftForge/FML@c828bb63c57cb10c23d9b1c3a6934e9f9ddba37b Make AccessTransformer change INVOKESPECIAL to INVOKEVIRTUAL when making methods visible + MinecraftForge/FML@a9aa468457a1eeed3366505b93e36da654610f05 Merge pull request #431 from diesieben07/at-invokevirtual + MinecraftForge/FML@31d726abad0dec6d1b853e9adf6a01580aee2af4 Fix the null networkHandler in the MessageContext + MinecraftForge/FML@725d988e36a7b104b9f5d8ae2daf993ac12af5bd Add in the objectholder, autopopulated by FML based on simple rules. Allows for reference driven substitution of mod blocks and items based on their server running state. + MinecraftForge/FML@f07bf5cb30a20ca9f62337512e936cfefcfbf0c4 Fixed deobfusication of nested inner classes. And removed legacy ModLoader remaps. + LexManos: + Updated FML: + MinecraftForge/FML@3a687f48b9606b4f9179d63ef0b831a25821ff8f -.- Save File First. My Bad. + +Build 1.7.2-10.12.1.1088: + LexManos: Add Glass, Colored glass, ore storage blocks, alines, and a few others to ore dicitonary. Closes #1011 + +Build 1.7.2-10.12.1.1087: + clashsoft: Update GuiScreen.java.patch + LexManos: Add new PlayerEvent.Clone called when an EntityPlayer is cloned via dimension travil or respawn. + LexManos: Made WorldGenShrub respect Block.canSustainPlant, Closes #1096 + +Build 1.7.2-10.12.1.1085: + delma: + Fluid events now know how much fluid is moved + + Added amount that is being filled/drained to the FluidEvent + + Added constructors without amount to ensure backwards compability + + Added deprecation to amountless constructors + +Build 1.7.2-10.12.1.1084: + LexManos: Fixed Stems not droping a random number of seeds based on metadata, Closes #1087 + +Build 1.7.2-10.12.1.1083: + xcompwiz: + Bug Fixes to Biome Decoration and Chunk + Fixes issue with biome decoration crashing on worlds with exposed void + Fixes same issue in JungleBiome decoration + Fixes forge bug in getting lighting from a block in chunk + +Build 1.7.2-10.12.1.1082: + LexManos: In Flower Forest biome a Poppy should spawn instead of Blue Orchid Closes #1078 + LexManos: Added Farmland to PLAINS type plants as that has changed in 1.7. Also made BlockTallGrass call it's super.canBlockStay to better support custom soils. Closes #1077 + LexManos: Added accessible instance to RenderBlocks and RenderItem for modders to use who don't wish to create there own instance. Warning: Other modders may influance the transient state of the instance, BE WEARY MODDERS. + +Build 1.7.2-10.12.1.1081: + Christian: MinecraftForge/FML@43e3ee1af1cab54db238dab4994076fdbe68bc6a Swap Listenerlist constructor around. Should fix parent resizing issue? + +Build 1.7.2-10.12.1.1080: + Christian: MinecraftForge/FML@70570a863ffa6a3ba7e2dd30b471bb47615b8bf8 Fix up possible CME + +Build 1.7.2-10.12.1.1079: + Christian: MinecraftForge/FML@503da3a2577a069b7847c158a27e8316c85ed852 Don't consider null NetworkDispatchers. This should fix a bunch of fakeplayer issues. + +Build 1.7.2-10.12.1.1078: + LexManos: Fully clear DimensionManager's DimensionID bitset when world is loaded. Closes #1074 + LexManos: Fixed No Blue Orchids spawn in swamp when using bone meal Closes #1072 + +Build 1.7.2-10.12.1.1077: + Christian: Fix forge validating strict versions on remote connections. + +Build 1.7.2-10.12.1.1076: + Christian: + MinecraftForge/FML@a8cbef2321a8e1bdfac56476bdfb5b306f71d38b Finally hopefully fully kills the race condition causing a classcast on slow machines. + MinecraftForge/FML@8dbd1ae0a177a556d03630a059242a2ee7f45e55 Fix ObjectIntIdentityMap sporadically matching non-identical objects. + MinecraftForge/FML@42713c66e565a26e963099baa838800f250089c3 Merge pull request #426 from sfPlayer1/master + +Build 1.7.2-10.12.1.1075: + Christian: + MinecraftForge/FML@d8b6adb2598ce144568a0aaf26fa8b988c028b7c Add a helper for casting some common collection types into generic form + MinecraftForge/FML@5275cea844a6afacc0deb41d153f01c1c25bb924 Try and see if there is anything to the identityHashCode collision hypothesis. If you see this in your error messages, kindly let us know! + +Build 1.7.2-10.12.1.1074: + LexManos: + Updated FML: + MinecraftForge/FML@a70308ef41f1e24074ea718f64caf75b8d6acba7 Update mcmod.info + MinecraftForge/FML@8555344eb33e4f0cc676defdb7391a24ebd5677d updated wrapper to gradle 1.12 + MinecraftForge/FML@1d5fc60f82e911c1abfbebbe781316126c02c987 Merge pull request #411 from matthewprenger/master + MinecraftForge/FML@3612ad0c25d103ba9bc81b32e8ecfef2dfc1cadc Attempt to fix another race condition related to reading NetClientHandler. + MinecraftForge/FML@c73a2076e3dd5d1f60c2fe2f589109cefa2dc6ce Fix potential rance condition in connecting to vanilla servers as well. And move latch into client side only. + MinecraftForge/FML@1436ac2f14fbdb48777c90b1b93378108c9cbf36 Fine use FMLCommonHandler. + MinecraftForge/FML@542e9acec1016c950c6f80af0c9da3190691359b documented dependencies + MinecraftForge/FML@ddc2cfbe864bd377232dbd1aa65df6e710d4639d Merge pull request #402 from AbrarSyed/patch-1 + MinecraftForge/FML@362ec8dee7ed2c291a8ed287c52eacdd80582eff Merge pull request #419 from Thog92/master + MinecraftForge/FML@b9de9ebc960bbf26e7aee570701aa4c226252fee Revert "Fix refreshResources not happening if an error occurs." + MinecraftForge/FML@738ce1d7cd5575269375066586d0a37881c536e2 Re-add removed genericiterable to clean a warning + MinecraftForge/FML@b0eb1ef7c6f4a63689898bf28f28e84d2dbae6e7 Split loadmods into loadmods and preinitmods, to allow resource loading to occur *always* between the two phases. This should fix mods not being able to access resources during preinit. + MinecraftForge/FML@de546bdf6cbeadb612cd6385bac8d54480073496 Clean up some missing generic info + MinecraftForge/FML@cd43eacbb25bc9cc0e81138844fa3aa7fd133037 Ensure that the loadcontroller is ready to preinit. + MinecraftForge/FML@f2fe80dc36972fe9db57e700380b6869abbc1832 Fixed default network mod checking to allow client side mods without the server side. Mods wishing to REQUIRE server side components must specify a custom check handler using @NetworkCheckHandler + MinecraftForge/FML@0c36868f92a3516c83ae363e13e5cb1db81236d1 Fix network disconnect with message on the client side in NetworkDispatcher. + +Build 1.7.2-10.12.1.1073: + bspkrs: Fixed unforeseen NPE + +Build 1.7.2-10.12.1.1072: + LexManos: + Revert "Implemented hashCode and equals in ItemStack, Closes #986" + + This reverts commit 0b01545a03942abca7b7ea28030be81e2ebeaa59. + +Build 1.7.2-10.12.1.1071: + LexManos: Implemented hashCode and equals in ItemStack, Closes #986 + +Build 1.7.2-10.12.1.1070: + LexManos: Fix extended entity properties being lost when leaving the end, This introduces the concept of calling IExtendedEntityProperties.init when entites/worlds change. Lets see if mods explode. + +Build 1.7.2-10.12.1.1069: + bspkrs: New GuiScreen events and a new ElementType DEBUG for RenderGameOverlayEvent + +Build 1.7.2-10.12.1.1068: + LexManos: Added new hook to WeightedRandom.getItem that allows for use of custom rnadom generators, prevents redundant code in mods. + +Build 1.7.2-10.12.1.1067: + LexManos: + Updated FML: + MinecraftForge/FML@2c56c32c5aa8842cfadaf8c237396cdb75673909 Fix saving backups with the raw name. Fix air block not being assigned as the default. + MinecraftForge/FML@d0f8073fa51db7426d5ded373f3404fa60d722f0 Merge pull request #413 from sfPlayer1/master + MinecraftForge/FML@810b1f3075e6061ab189e1f6975bd77b20040d71 Clean some generic warnings up. Make a generic list handler. Helpful for others I think too. + MinecraftForge/FML@fff86ee9d35874bdf77a1eaabe77615441644064 Fix refreshResources not happening if an error occurs. + MinecraftForge/FML@76d8d0e870a4e389167634283984dc10abb08e84 Fix mod version checking + MinecraftForge/FML@b84d0760ae47832e5b1e4d50237b582b2d50d520 Fix display of mod status at the server + MinecraftForge/FML@251af1d09dfbf636e2fb3f323a5345c81cc07aea Fixed memory leak on the client caused by Netty holding references to the World. + LexManos: Fixed hard references in WorldGenBigTree and ForgeCommand that caused worlds to leak in the client. + +Build 1.7.2-10.12.1.1066: + lhb: + Fix for Block.getExplosionResistance getting passed the wrong parameters + + It is being sent the x, x, y coordinates instead of x, y, z + +Build 1.7.2-10.12.1.1065: + CovertJaguar: + Fix issue with flexible rail return value + + Between 1.6 and 1.7 the return value to BlockRailBase.isFlexibleRail() + was inverted. While this is not a huge deal and could be worked around + by simply inverting your return value, it does mean its no longer + consistent with the function name and javadocs. + bioxx2007: Adds a new ReplaceBiomeBlocks Event constructor that supplies the metadata array if applicable and updates the ChunkProviderGenerate class to pass in the metadata array. + +Build 1.7.2-10.12.1.1061: + bspkrs: get a spelling checker :P + +Build 1.7.2-10.12.1.1060: + LexManos: Bump Forge version in prep for release. + +Build 1.7.2-10.12.0.1059: + LexManos: Try and fix invalid framebuffer depth/stencil setup, Thanks Ivoforce. Closes #1032 + +Build 1.7.2-10.12.0.1058: + apricefrench2d: + Fix infinite loop in RecipeSorter + + If recipe is multiple levels of inheritance from Object and not categorized, cls=cls.getSuperclass(); needs to be repeated more than once. It must therefore be moved to inside the while loop. + +Build 1.7.2-10.12.0.1057: + ohai.iChun: Fixes stencil buffers on platforms not supporting OpenGL 3.0 or higher. + +Build 1.7.2-10.12.0.1056: + LexManos: + Small wording change in license to allow for specifc differnet licnense contributions. + + Updated FML: + MinecraftForge/FML@e58562d3edfd1cd37fdc0a9e54181aed7433fdff Fix remaining issue with autoassigned Block and Item IDs overlapping. + MinecraftForge/FML@a82195772e539437911c25508168cb607659bc71 Registry: Block IDs after failing to find a mapping for them + MinecraftForge/FML@fd9389015fd5c6150155531bf1fffb38cfe9d551 Fix FMLMissingMappingsEvent.get + MinecraftForge/FML@5eebd4df718d65ac8426deba61e1ebb6ae2fde18 Registry: Implement support for remapping blocks/items to a new name. + MinecraftForge/FML@7325aa5033e7a5b5db79340777dd7a1c763315a0 Registry: cleanup, fix missing id error GUI formatting + MinecraftForge/FML@eb29d651ebda7086fe6d1f716295b087e2c17e6f Fix old 1.7 worlds with broken ID mappings + MinecraftForge/FML@6fd3c12a4a15a5cf38c421a94576a5cacd3fb7c1 Registry: allow handling missing blocks/items regardless of the mod id + MinecraftForge/FML@038fa17ad33aeba276db84ab170504fce884c1e7 Merge branch 'master' of https://github.com/MinecraftForge/FML + MinecraftForge/FML@49c623f59c440ba177adf2d76332ecee25e12236 initial attempt at a better way to ask the user in case of startup issues + MinecraftForge/FML@9be92dcfcb1c737025397c92b18ed027a6c7f4fa Registry: Complain about bogus registrations + MinecraftForge/FML@fd6d55afcc4f4c650c143ad43e09fbdc2cb9d850 Registry: Allow ignoring missing mods from the GUI, with confirm+backup + Registry: Add confirm+backup for automated corrupted id table fixup Require the user to confirm loading from a backup level.dat + MinecraftForge/FML@c47fc3b382434d435050b4ee02a02550b81f5717 Enable custom gui rendering only as required + MinecraftForge/FML@f77632df35dbf53fb31420fa86e6792f13257020 Remove unneeded entity spawn debug logging. + MinecraftForge/FML@c7adb42199a0684d8748451d39deb8326c0a2194 Registry: Repair mismatched ItemBlocks as well Fix a few misc issues + MinecraftForge/FML@c8a245a985779fd2545ee4b58a93270973aeb435 Registry: Fix debug info + MinecraftForge/FML@c8a0b72eba9265be608670424e1bd835a9d2f1e2 Registry: Complain about missing mods when repairing broken worlds Registry: Reduce console spam + MinecraftForge/FML@8e44006f432f1b36b826ff0469d99986a6051e4b Registry: Protect against putObject misuse, handle duplicate registrations better + MinecraftForge/FML@294c93212cd9f30c50b9d1a3b048a6141c45cdea Registry: Add support for registering ItemBlocks before their Blocks + MinecraftForge/FML@3b42b33b6ec4020b5032cae06760053ed135fae8 Merge pull request #400 from sfPlayer1/master + +Build 1.7.2-10.12.0.1055: + traincrazyb: + Small Fix: Held Items & Multiple Render Passes + + Passes beyond 1 now have the correct icon. + +Build 1.7.2-10.12.0.1054: + LexManos: Fix line offset in Minecraft patch, and mix RenderPlayer looping once to many on multi-pass items. + +Build 1.7.2-10.12.0.1053: + t.tomkins: Update PlaySoundEvent17.java + +Build 1.7.2-10.12.0.1052: + LexManos: Update access transformer, Closes #951 and #1021 + LexManos: Add NPE protection to GuiingameMenu.actionPerformed, Closes #961 + LexManos: Finally do SoundSystem workup for 1.7, Closes #982 + +Build 1.7.2-10.12.0.1051: + LexManos: Use BiomeGenBase's array size instead of hardcoding it in BiomeDictionary. Closes #871 + LexManos: Fix potential threading issue if FluidRegistry.loopupFluidForBlock is called from two threads at the same time before being setup. Closes #936 + +Build 1.7.2-10.12.0.1050: + LexManos: New hook to truely seperate the display of the 'durability' bar from the current / max durability. Allowing modders to control that display easier. + LexManos: ItemStack sensitive version of Item.getAttributeModifiers, Closes #816 + LexManos: Add ANIMALS tpe to PopulateChunkEvent.Populate Custom providers should call this function if they spawn animals curing population. Closes #790 + LexManos: Add AnvilUpdateEvent which is fired when a user places a item in both input slots of a Anvil and allows modders to control the output. Closes #838 + +Build 1.7.2-10.12.0.1049: + LexManos: Add position to BreakSpeed event. Closes #621 + LexManos: Advanced Model Loader available server-side for data driven models. To be cleanuped and re-evaluated in 1.8. Closes #773 + +Build 1.7.2-10.12.0.1048: + Abrar Syed: COnverted patches to SRG names + Abrar Syed: updated for ForgeGradle 1.2 + Abrar Syed: added .exe file.. fixed a bunch of patches + Abrar Syed: updated FML to latest master + Abrar Syed: fixed remaining noop patches and exc derp + LexManos: Update patches for new Fixed FernFlower used in FG 1.2. + +Build 1.7.2-10.12.0.1047: + reflex_ion: + This correctly uses the world height less one block for placement of a + Door. + + Required for placing doors inside a littleblocks area. + +Build 1.7.2-10.12.0.1046: + LexManos: MinecraftForge/FML@ef07de4f65ea16e1db1467845e316cb4c7d01a1f Fix hard link to DedicatedSerever when opening a LAN connection causing stalls on connecting. + +Build 1.7.2-10.12.0.1045: + LexManos: -.- Both null combinations. + +Build 1.7.2-10.12.0.1044: + LexManos: properly implement equals, sod off Player. + +Build 1.7.2-10.12.0.1043: + LexManos: Implement simple hash based equals in Fluid ContainerKey. + +Build 1.7.2-10.12.0.1042: + LexManos: Make StructureVillagePieces.Village public. + +Build 1.7.2-10.12.0.1041: + ohai.iChun: Fixes stencil bits not existing in Minecraft's framebuffer causing stencil test to not work. + +Build 1.7.2-10.12.0.1040: + LexManos: + Updated FML: + MinecraftForge/FML@e8b60441ccca8cccdc130560b4c8bf400aebc605 Reload game settings after mod loading is finished to capture mod keybindings. Closes #378 + MinecraftForge/FML@399770e572c9177babfb65a27280253023db2d9e Kill the modEventTypes list, register anything that extends FMLEvent, Fixes MissingMappingEvent handler, and any futureevents added. + MinecraftForge/FML@b7ad532ab5eb3e00d77ffde946d25675c9f69cf7 Re-enable post initalize texture pack reloading to allow Icons to be registerd through any init phase. + +Build 1.7.2-10.12.0.1039: + t.tomkins: + Small Fix: Held Items & Multiple Render Passes + + Passes beyond 1 now have the correct icon. + DemoXin: * Added Ore Dictionary entries and recipe replacements for Diamond, Emerald, Crops, Redstone, and Glowstone + DemoXin: * Fixed Items.glowstone to Items.glowstone_dust + +Build 1.7.2-10.12.0.1034: + LexManos: Fixed hashcode in FluidContainerRegistry, still needs a redesign. Closes #967 + +Build 1.7.2-10.12.0.1033: + ohai.iChun: Add cancelable RenderHandEvent. + +Build 1.7.2-10.12.0.1032: + LexManos: Fix a typo in our tile entity fix causing it to be ineffective. + +Build 1.7.2-10.12.0.1031: + LexManos: Fix items with color rendering incorrectly. + +Build 1.7.2-10.12.0.1030: + Christian: + Update Forge for patch changes + + MinecraftForge/FML@064b66af3d6c92b19821b88ec26cbb59577d68b4 Prevent players from logging in until server has finished starting. + MinecraftForge/FML@2aa73afa15908dadb0a033c49deb0ffefad2f265 Fix ExampleMod.java for build #1024+ + MinecraftForge/FML@c890206268da3c594d97198f5426b52ff6b8460c Try and handle removal of mods a bit better. Currently no way to allow a world which has missing blocks to load - but i have the code in place to allow it i think. + MinecraftForge/FML@995c204338cd601e118396d4b4ef8feb6e759037 Fix failing to load a world with missing mod blocks and items. There will be a way to force worlds to load when stuff is missing, but for right now, it will fail as this is "world safe". + MinecraftForge/FML@fa5f4c884272f415933329a9e914e0b7d052e31a Some argumentation + MinecraftForge/FML@45409bfa0c136078823a1aef1358396d92a269ee Prevent player dat files getting reset during disconnects. + MinecraftForge/FML@33100d6bab654a4bd59701b1ec2bf91caa3399da Merge pull request #371 from bl4ckscor3/patch-1 + MinecraftForge/FML@572d32358ab11e5916d91c4c7b9c04a70cfed2f6 Merge pull request #373 from bloodmc/master + MinecraftForge/FML@d0dd05a15c2eca9eabd308319c2ed85cb632922b FML expands S3F to support payloads up to 2 megs in size. Should be transparent + +Build 1.7.2-10.12.0.1029: + LexManos: Fixeed a missed -1 in SpawnerAnimals patch. Thanks Blood. + +Build 1.7.2-10.12.0.1028: + LexManos: Cull FakePlayers when worlds are unloaded. + +Build 1.7.2-10.12.0.1027: + LexManos: Use correct tag types when reading Forced Chunk data. Fixes ticket loading. Closes #964 + +Build 1.7.2-10.12.0.1026: + LexManos: Fixed FluidContainerRegisry.contansFluid closes #845 + +Build 1.7.2-10.12.0.1025: + LexManos: Fix AIOOB error with Endermen and blocks >256. Also better support for ID remapping. More to come later. + +Build 1.7.2-10.12.0.1024: + LexManos: + Updated FML: + MinecraftForge/FML@03fb1879d72fbd347badc140fed6c2c3191d2990 Fix obf error when right clicking a Empty Map. + MinecraftForge/FML@6bb9b8b9532b276450d03a3419e0da016aecead8 Clean up FMLEventChannel. Closes #367. + MinecraftForge/FML@b7b3450dcd123ab5df6b3693c9c2123bc3846b88 Update MCP mapping snapshot to latest crowdsourced names. + MinecraftForge/FML@8c9e8b52708bd0630303f8b5dc184ab60e2553a1 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it. + LexManos: Add the beginnings of a Constants class, to document/clean some of the magic numbers that are in the MC code base. + +Build 1.7.2-10.12.0.1023: + Christian: + MinecraftForge/FML@d87822ad8519da1c808e48bcc0a1bf8eb15c0095 Bump gradle wrapper to 1.10 + MinecraftForge/FML@359ac3ca2a941d70709168fbbbc0725c861668dd Ensure we check both item and block registries when finding valid IDs. Should fix #365 + MinecraftForge/FML@cee0f0b81179d307059843f08401f8700fb3ddb2 Tweak so that writing to the context will automatically send a message back to the originator in handshakeestablished. + Christian: Add a discriminator for fluididspacket. remove extraneous channel handler. + Christian: Fix up the event handler so it knows it's owned by forge + +Build 1.7.2-10.12.0.1022: + LexManos: Uncomment aa few FluidRegistry entries. + LexManos: Fixed issue where enchantment effects caused slight rendeirng issue. + LexManos: Fixed missed parens causing trapdoors to fall off incorrectly. + +Build 1.7.2-10.12.0.1021: + LexManos: Inital Fluid system update, untested. Still in progress. + +Build 1.7.2-10.12.0.1020: + LexManos: Fix NPE when breaking ice. + LexManos: Attempt a AIOOB error fix in tesselator when there are alot of transparent blocks in the rendering range. + +Build 1.7.2-10.12.0.1019: + Christian: + MinecraftForge/FML@544320b8d239df4a5ee2b3a7ec331ce2ec0a2c09 Beginning of a saveinspectionhandler. + MinecraftForge/FML@ab199c5811fe2d831592601d4f77691fbf82d1b8 Try harder to find a mod container. + MinecraftForge/FML@8633d780c925ebb719c37ac52e2f3db5f9957895 And make a loud message if there isn't a modcontainer found, substitute Minecraft. In general, this can only happen for coremods not properly registering their code. Closes #363 + +Build 1.7.2-10.12.0.1018: + LexManos: Fix imporerly efficient tools breaking blocks to fast. + +Build 1.7.2-10.12.0.1017: + LexManos: Fixed potential NPE in SlotCrafting, and added ItemStack sensitive version fo hasContainerItem. Closes #854 + LexManos: Adds a WeatherRender in the style of SkyRender, Closes #844 + +Build 1.7.2-10.12.0.1016: + LexManos: Move change of metadata to immediatly after change of Block, should prevent any 'invalid' tile entities from breaking created. Reference: #897 + +Build 1.7.2-10.12.0.1015: + LexManos: New PlayerUseItemEvents, Start, Stop, Tick and Finish. See PlayerUseItemEvent.java for more details. Closes #924 + +Build 1.7.2-10.12.0.1014: + LexManos: Make ItemBlock.field_150939_a public, closes #945 + LexManos: Missing EntityAITasks.tasks and MapgGenStructreIO register ATs, Closes #949 + LexManos: Implement PlayerPickupXpEvent, fired when a player aquires XP from a EntityXPOrb. Closes #942 + LexManos: Exclude cobblestone slab recipe from ore dictification, closes #940 + LexManos: Add the ability for custom records to have finer control over there sound resource location. Closes #933 + LexManos: Don't short circuit item icons for multiple render passes while being used. Closes #929 + +Build 1.7.2-10.12.0.1013: + LexManos: Fix Furnace stopping on 63rd Item, Closes #947 + +Build 1.7.2-10.12.0.1012: + Christian: + MinecraftForge/FML@b6d95d704b65dd8232ec8ddd333de378db8fe161 Name the log files properly. fml-junk is an early startup annoyance I can't kill because log4j2. + MinecraftForge/FML@8692ca17d13eda036b5ef996ec8e8706e7707d80 Log4j2 logging context for things. This should help add context when things go wrong in mods. + MinecraftForge/FML@a7ca131a337b5f0d4fc6f438626ac2d5b7771b3c And don't spam NONE everywhere + MinecraftForge/FML@741e172ffe163f0dd3018e1474af46ef0696396a Log4j2 doesn't need debug level logging for itself anymore + +Build 1.7.2-10.12.0.1011: + Christian: MinecraftForge/FML@458b0620b43116c943549a0f060c7e8830c2d77a Log the bad packet in a prettier way. Also, don't show the authlib debug data in the log file. + +Build 1.7.2-10.12.0.1010: + LexManos: Add BookCloning to the recipe sorter. + +Build 1.7.2-10.12.0.1009: + Christian: + MinecraftForge/FML@9a8d16b66e67691a4c83a9e1e236304e9f6d5139 Fix log4j2 config. Fix server gui to *show* logging. Fix log spamminess in the console. Fix bug in servergui that can cause deadlock. + MinecraftForge/FML@a355eecb2c14123964c6ae2402a0933d57ae9736 Add in error logging for outbound messages. Fix bug with indexedcodec NPE + MinecraftForge/FML@1c793abe0eef6846f681c9673019b0ebc49caaaf Fix derp with networkcheck + MinecraftForge/FML@675b5a07788ada17bc26a9c4f26598e77d2098cf And turn down some more logging, now we have useful logging back again.. + +Build 1.7.2-10.12.0.1008: + Christian: + MinecraftForge/FML@4aa2416ce5dcd8e77761703c018d1e7d08464025 Propagate Optional method removal to trait implementation classes + MinecraftForge/FML@fc025a7b73d9b3f46ecf2257227657592f5506b5 Logging Changes + MinecraftForge/FML@f0132a6f3b47e746a1a7df3ef84f4be989f140dd changed fml log level to all + MinecraftForge/FML@f23eba4352c38fd21e04e81f3db72c6cafe65a36 put max number of FML log files to 3 + MinecraftForge/FML@449ac98b77025eba38a75d0242113fffe26a8cf9 SSP Worlds updating from 1.6 will now pop a warning message before loading, and will capture a timestamped zip file in the minecraft dir before starting to load. Allows for people to test updates. + MinecraftForge/FML@3557fe31c92ea8d76c90052f9b8b6da963300c4f Throw an exception when discriminator is not found + MinecraftForge/FML@25240457283ba40c32022c97fc982c2ff4408e46 Make NetworkEventFiringHandler sharable + MinecraftForge/FML@dfc0899ec66f87502b5727939ac2f0ad0fabf89f Merge pull request #357 from jk-5/sharable + MinecraftForge/FML@79d42fca8d6b9d73204890ef0edb9d73cf075d87 Merge pull request #355 from jk-5/errorhandling + MinecraftForge/FML@7907e16e96de21e8ba536906ae71adcf02bfa535 Add a type adapter for artifact version. Should fix #354 + MinecraftForge/FML@7ac5bddbc3c227e0ed9385904a2bd9621078e2de Allow indexed messages to validate themselves. Also, catch exceptions from an embedded channel, and cause them to close the connection. It's ugly, but it means that the client doesn't crash if it connects to a screwy bungycord that's trying a 1.6 handshake for some reason. + MinecraftForge/FML@5adacc3b336bacbe30aa06175ef80c3aac08a62a Check the mod, not it's container, in the check handler. Closes #358 + MinecraftForge/FML@3d26f28bcf3e79e1f5fe20fcf056c604487dc35b Allow connection when server is apparently offline. Might allow :NOFML circumvention though. Hmmm. Closes #359 + MinecraftForge/FML@a62374d4aceac1c4ab39b3c0bae624ccbca65b6b findBlock should now return null, not the default block, if the thing being looked for is not found. Closes #352 + MinecraftForge/FML@6a695c4348d062af50b8cf5208530fc5036eba17 Try and stop the epic channel closed spam at close time. Closes #353 + MinecraftForge/FML@35a38d7840a5d0cd842005822c4ec6a9d3b65b6a Make sidedproxy support non-public fields. Closes #344 + MinecraftForge/FML@9d2e089df692655df04315a3822f43140015f3af Merge branch 'logging' of github.com:AbrarSyed/FML into abrar-borked + MinecraftForge/FML@79b04898d43d354714e09ce7e66efb5357ebcf61 And restore suppressions. ABRAR, DON'T TIDY CODE!!!! + MinecraftForge/FML@3dfb54e066ab91e44405706233f2dfffee9add72 Merge branch 'trait-optional' of github.com:RainWarrior/FML + MinecraftForge/FML@32bb7315cc6beff84f186a33e73219cc5280821a Add in example assets dir. Closes #308 + MinecraftForge/FML@16d33d298953b41dbbe3e3b504e800f4f46a3e1b Clean up and document outbound handler a bit better. Add in dispatcher target. Closes #361 + MinecraftForge/FML@5719b9ec533b3e43213dbafcb448221884efd9e8 Fix reply handling. Make the proxy message available for subclasses of indexedcodec. Fire user events into the network event firing. + +Build 1.7.2-10.12.0.1007: + LexManos: Add support in Techne models for the TextureSize tag. Closes #856 + +Build 1.7.2-10.12.0.1006: + LexManos: Updated FML: MinecraftForge/FML@444a7d7fa1cf7fad7dda67f581fa0e3be36069b7 Move placement of single player world load hook to fix NPEs. + LexManos: Fixed RenderWorldLastEvent never being called, was missed in 1.7 update. Closes #932 + +Build 1.7.2-10.12.0.1005: + LexManos: Fix flexible rails, Closes #944 + +Build 1.7.2-10.12.0.1004: + LexManos: Fix warnings in Forge codebase. + LexManos: + Updated FML: + MinecraftForge/FML@7c5d62704ac1d3e586f3bfe26265a534e5362c73 Make UniqueIdentifier final and add a hashCode. Closes #348 + MinecraftForge/FML@ff7b5845e7f6b300d413b917f57adc472a4ebcff Clean up some warnings about @Override + MinecraftForge/FML@275ccac6f14bc66b88c76b1040aa7167f995967c Fix NPE at startup + MinecraftForge/FML@2a5a8d0cd062d3feac9c4de234e3dab1ff4462e5 Fix memory leak?! + +Build 1.7.2-10.12.0.1003: + Christian: + Add exception logging to forge channel handlers as well + + MinecraftForge/FML@53557dcd0582e09f7f35eb3bc2fd130fba3be4a0 Put logging exception handlers on all channel inbounds. Fix problem with failure to login. Closes #350 + +Build 1.7.2-10.12.0.1002: + Christian: MinecraftForge/FML@9c96ca4402e4c231285f170281dd543bfffa191a Fire a custom packet channel registration/deregistration event, for any mods that care about that kind of thing + +Build 1.7.2-10.12.0.1001: + Christian: + MinecraftForge/FML@e14efe786f6255a18e148c4137f560f5e2d2a38f Some fixes and tweaks + MinecraftForge/FML@c013870b1df5e63bd84d92545ebdd434db74b5d1 Merge branch 'simplenet' + MinecraftForge/FML@30882b0c1d2743afebbebc288d73f25696e0815c Clean up some warnings. Add in simple network impl + MinecraftForge/FML@9cab2ab36e7981c847e3e9ae8c3fbbb36531ba6d Add in some tests and examples for the "simple" network stuff + MinecraftForge/FML@a429e106dd00b34302ec5893e0a8fc97c8fc8019 Fix bug with SSP, and hook so we can do confirmation of world loading, as well as other things + +Build 1.7.2-10.12.0.1000: + Christian: + MinecraftForge/FML@b362e8a2733eb3082975edfdf83c996f048b65d3 At the request of AbrarSyed. + MinecraftForge/FML@e344303ec7a5ed27c4378ff072a036df7a350902 Merge pull request #346 from Jezzadabomb338/master + MinecraftForge/FML@a4686b1261a9bad523b4efa8a36a4433a58897cc Added basic Mojang account authentication support for development time login. + MinecraftForge/FML@dd17979a2f6f02ac4a9dda09b52c96365cc5fec9 Fix bukkit connectivity issue. + +Build 1.7.2-10.12.0.999: + Christian: + Updated FML: + MinecraftForge/FML@1db3daa0e82e67fc27ca3d535a09c806c1a54d67 added override toString method for getting full name. + MinecraftForge/FML@acf74a34032224a73c4c03280cafa0042c35cf5a changed the readme to reflect new setup task. + MinecraftForge/FML@96c19b35807fa078cb18b4ae50567d0360bcdb03 undid readme change + MinecraftForge/FML@a89939e57e9ff061df3d53cf1cb075b31de5de1b Merge pull request #336 from jadar/master + MinecraftForge/FML@717a8d694532bd9438eed8d9cf4b57318b2b4cfd Fix csv string vs list of strings. Thanks immibis. Closes #334 + MinecraftForge/FML@584c0f368bca1d5b0223b5b3611b366b9a00f7d7 Fix potential ordering issue, clean up some imports + MinecraftForge/FML@28293b29ea65c30fe80c49e85e2ae15a4db68933 Add in a simple(ish) event driven network handling system. Register using newEventDrivenChannel and you'll get a simple network handler that will fire events at the subscriber(s) of your choice, whenever a packet is received. You'll also get some convenience methods for sending to things. + MinecraftForge/FML@80b00dc7966d96111e2ce8643db8e0f544c2bc89 Fix openGui. Closes #342 + MinecraftForge/FML@fc69bcf2807dc2b85eb52681ba9531cb3e2f1945 Fix up privacy derp in TickEvent. Closes #343 + MinecraftForge/FML@10d056a494aac22137b644cff341a5958e8168fc Fix possible NPE derp + MinecraftForge/FML@5da6dcc7e3607e5f107f6a7d39a4b4e1eb7fb306 Divert connection through FML, so we can deny connections to servers that don't want us + +Build 1.7.2-10.12.0.998: + ohai.iChun: Squash commits so Lex would stop whining. Fix erroneous position when getting player position with changed eye height. + +Build 1.7.2-10.12.0.997: + Christian: + Updated FML: + MinecraftForge/FML@d5bfd69e35b21f701390a8c4c4c58d7ec1fff1fc Fix problem with connecting to vanilla. SHOW what's modded and what's vanilla in the list. Hooks that make the blocking work to come + MinecraftForge/FML@dd098854b0b65b8509b8788422e02d989a991b87 Fix the keybinding array to the right one + MinecraftForge/FML@43068eb9862f280611f26f4107ff5ac2b42b08e4 Fix TargetPoint to be static + +Build 1.7.2-10.12.0.996: + LexManos: Attempt to prevent a NPE when MC renders a lot of things at once. + +Build 1.7.2-10.12.0.995: + minalien: Fixed MinecraftForgeClient for custom Item Renderer implementations. Removed check for forward-slashes (/) in texture asset locations (but left check for backslash in place). + +Build 1.7.2-10.12.0.994: + LexManos: MinecraftForge/FML@0d810c01fab99ac491c2277097a4198518fe6c75 Mark jopt needed on the server, herp derp, blame Abrar! + +Build 1.7.2-10.12.0.993: + LexManos: Deprecate BlockFire.func_149842_a, and throw exception if someone tries to set the burn properties for air. Should prevent 'The Air is on fire!' reports. + LexManos: Fix DoublePlant placement, closes #921 + +Build 1.7.2-10.12.0.991: + verybigbro: Create ru_RU.lang + +Build 1.7.2-10.12.0.990: + Christian: + Updated FML: + MinecraftForge/FML@5317672631f30e1c9655f0bb28dd8b158deea2fb Add a utility method for finding the channel handler name based on type. Should fix naming weirdnesses. + MinecraftForge/FML@9de9a1553086ebeeb5d5fc0f6d96da8680e52df0 Fix stupid hardcoding derp + +Build 1.7.2-10.12.0.989: + Vexatos: Create de_DE.lang + Vexatos: Update de_DE.lang + LexManos: Fixed pipeline naming issue in the ForgeNetworkHandler. + +Build 1.7.2-10.12.0.987: + LexManos: Fixing an infinite recursion case, Closes #916 + LexManos: + Models now load from resource packs + Models must now be loaded from resource packs using the standard resource pack reference. For example, to load a model named "assets/mymod/models/mymodel.obj", you would call AdvancedModelLoader.loadModel("mymod:models/mymodel.obj"); + Closes #670 + LexManos: Fix panes/iron bars not connecting correctly. Closes #904 + LexManos: Fixed the run config for dev time server, Cloases #913 + +Build 1.7.2-10.12.0.986: + Adubbz: Made canBeReplacedByLeaves default to whether a block isn't opaque rather than if it is, also uninverted the checks for canBeReplacedByLeaves in WorldGenBigMushroom, WorldGenSwamp, WorldGenTaiga1 and WorldGenTaiga2 + +Build 1.7.2-10.12.0.985: + Christian: Fix inversion + +Build 1.7.2-10.12.0.984: + Christian: + Updated FML: + MinecraftForge/FML@21b13d63512ce399c82cbb6b9042eefa6dcdaacd Lots of network cleanup. Gui packets now work too! + MinecraftForge/FML@b3f98d1ee0416aa452f8611d458968afdf50775a Fix derpiness with Mods button when Realms is available + MinecraftForge/FML@cdd9d92a4f8cd199e2d8a34bb398ef32e5f1e275 Starting work on the actual GUI. Still work to do. Needs an API. + MinecraftForge/FML@ab5eb3ccfff7f9ccfd8720b23fcef3131e54d57d Fix button size for GuiModList + MinecraftForge/FML@3113138bd1377d71afe3b8290e18511bfb6e5e97 Tweak button positions. + MinecraftForge/FML@c5e29b574a315d48668ebc9189bcc497a0eae13e Avoiding redundant calls to LogManager + MinecraftForge/FML@fbc1f8f6f9effa4a538880f9fec0ce5010226d09 Config GUIs in the modlist now work. + MinecraftForge/FML@fa4f3015a0d7147cbde3edec7664e78e5bcacbb9 Added transparent background for GuiIngameModOptions as per cpw's request. May not compile due to manual de-mcp-fication. + MinecraftForge/FML@7bf119e1e54cadff690ec31a4bab93c0d1d0aad1 Fix up readmes and credits. We no longer support modloader. + MinecraftForge/FML@779cd05aa1ced720a63cc508b82e68cc6fc8daa9 Tweaks + MinecraftForge/FML@b51fb913551a5116cc3b9bb7583b1666f280c650 Merge branch 'patch-1' of github.com:airbreather/FML + Christian: + Updated FML: + MinecraftForge/FML@6f1da6550e10164bd6c678829f111bb5de9383b6 Fix up mcpname derp in GuiScrollingList. + +Build 1.7.2-10.12.0.982: + Adubbz: Fixed sky colour transitions on a render distance of 16, fixed the WorldGen of various things + +Build 1.7.2-10.12.0.981: + jk-5: Update ForgeMessage.java + jk-5: Added a constructor and made the fields package-private + jk-5: Added default constructor for reflection + +Build 1.7.2-10.12.0.980: + LexManos: Update patches for AT changes. + LexManos: Fix inverted login in BlockPistonBase causing blocks to break incorrectly. Closes #910 #909 + +Build 1.7.2-10.12.0.979: + Christian: + Updated FML: + MinecraftForge/FML@22ba6fda5ee2dbf29dc03ba93ff9c7707edeaeee Expose the nethandler in a few places, and pull out FMLEmbeddedChannel, exposing a utility method on it. More to come. + LexManos: Update for the FMLEmbeddedChannel change. + +Build 1.7.2-10.12.0.977: + Christian: + Fix build.gradle for tweakClass property + + Updated FML: + MinecraftForge/FML@f36152398d1d287e7a55a31c77a2614cfb63e1b6 Add in the tweakclass, fix the json for lzma @ the server. + +Build 1.7.2-10.12.0.976: + Christian: + Updated FML: + MinecraftForge/FML@5d069629cf47cd04f2002b3b9a2c32b0ea73c26e Allow itemstacks for furnace recipe inputs. Allow passing extra arguments through registerblock into the itemblock constructor. + +Build 1.7.2-10.12.0.975: + Christian: + Updated FML: + MinecraftForge/FML@061288909de0f0452adf51a5a9935fd09992c801 Fire simple network connect/disconnect gameevents. + +Build 1.7.2-10.12.0.974: + Adubbz: Made BlockCrops.getDrops call its super method + +Build 1.7.2-10.12.0.973: + Christian: Fix the network handler for forge + +Build 1.7.2-10.12.0.972: + Christian: + Updated FML: + MinecraftForge/FML@34819c9303870f560232464a2d16eb46d152515c Make gradlew executable on linux + MinecraftForge/FML@53a1f9841421b41d543d7d1d51319b44c86a527e Attempt to load old pre-1.7 worlds. ENSURE YOU HAVE A BACKUP! + MinecraftForge/FML@6a5f9e135f88b662e4e01e8882f861448910ca90 Fix example mod code for 1.7 + +Build 1.7.2-10.12.0.971: + Christian: Allow tools to override their material harvest levels. + +Build 1.7.2-10.12.0.970: + Christian: Tidier implementation of previous commit. Should fix for subclasses of individual tools too + +Build 1.7.2-10.12.0.969: + Christian: Add in harvesting abilities of the items, should fix effectiveness + +Build 1.7.2-10.12.0.968: + Christian: + Updated FML: + MinecraftForge/FML@f8d6213829d570501166d64d7c8bb4977567131f Update render registry + MinecraftForge/FML@ec316f113fefef12f6defed9eb68de368d7f4420 AT for renderblocks + +Build 1.7.2-10.12.0.967: + LexManos: + MinecraftForge/FML@3714426e19f8f0edaaeda8c787993f8f3615a44d fix derp in example builscript + MinecraftForge/FML@01fb451b6918599de5e732d7ff30c761438ab930 Merge pull request #311 from AbrarSyed/patch-3 + MinecraftForge/FML@30d532f4fc6fc65ea7e79707a75ff4d6ea0ea031 Pass 1: Most patches are restored. + MinecraftForge/FML@53127eec308d3929d68d3d9fafabcfef37e95c37 Merge branch 'master' of github.com:MinecraftForge/FML + MinecraftForge/FML@7ab3c3a37ceb8ab945208206aec86739a2138329 Update gitignore + MinecraftForge/FML@38cec7a11fae7cf12bda3a8d16a50bb6136d8886 The basic network handshaking for FML is done. All scenarios seem to work. + MinecraftForge/FML@9f928963f20bc9bbfbe1391fb16c6f5ca5fd4344 A network design I like. It uses the netty embedded channel to allow mods to build channel pipelines on top of custom payload packets. + MinecraftForge/FML@58f7487cfaf4a25a8349021b9cca5ef4ba0b541c Check in patches. Add in some network timeout tweaking values so you can debug the network. + MinecraftForge/FML@e544adba5c7e9286f917342af2669e5888fa0a17 More cleanup. Bidirectional server <-> client network works for mods as well as FML|HS now. + MinecraftForge/FML@f5c38e2359c2e6eca13cd6606465ee36086a7113 OK, network channels appear to be working well for both dedi and integrated servers. The beginnings of the new mod structure too. + MinecraftForge/FML@9c96a0a10a5cbe34786be8fd41f9818b5ac929bc More network stuff, partially done id syncing. + MinecraftForge/FML@2aaaeba15eabdec189daa8662e9ffdf0b5a09dbe ID loading from the server save now works. + LexManos: Kill liquids finally. + LexManos: Bump data for 1.7 start. + LexManos: Some work on 1.7, waiting for Abrar to fix a few things. + LexManos: + Updated FML: + MinecraftForge/FML@a30f17362764f3e4e594386e193f9e4368e6836e Add sonatype snapshots repo for SpecialSource snapshots. + MinecraftForge/FML@b2550b8a693315ccc205f5315eac67c5283d7af9 Add mappings for Items/Blocks fields. + MinecraftForge/FML@57f7f1d7abd304d3e9f42567f1d66c10122e4ec6 Update for fixed Enum cleaning and names. + MinecraftForge/FML@99c681ad8736e4976053718c3d453b2fb30eefe0 Did it manually, forgot it needed the end comma + LexManos: + Updated FML: + MinecraftForge/FML@1d71c017f45aa7ed9d7d7c5ed5250a8d22477980 ID syncing. + MinecraftForge/FML@fd36f50d8210342f65cb0272bac56a3bcc42dd18 Cleanups + MinecraftForge/FML@89e4e483c204c11b6fdfed34893fc223a7d6a899 Add in a remapping event for mods to consume. + MinecraftForge/FML@cd417c6786256fa23f181ff0b76696bc6dfb0291 Fixed remote and local connections work with mods now. + MinecraftForge/FML@ef492407ef812bb6bbc7f0bd8efbd16d07efcafb Entity spawning works. + MinecraftForge/FML@d0d31d9575403eb2ec058898b86ffd99a9220f75 SpawnAdjustment packet. Clean up stuffs. No more compile errors. + MinecraftForge/FML@3e278acb71e4e3d0406e80f0fad5071c9215ed33 Fix stupid possible compiler error. + MinecraftForge/FML@009d4dee2328cc8d97b74177a2c5a3c359e6564a Fix the exc file. Fix the deobfremapper for handling inner classes. + MinecraftForge/FML@49cb893d12bd4f82b5d1b50d1e6517a256525d32 Fix exc this time *sigh* + MinecraftForge/FML@31efcfc3b2085f5d4e070ddab34a0be1481b4c6f Clean up patches for latest exc. + MinecraftForge/FML@7a4ceebf5efe5b3650080cf912e371d92fc70a55 Kill old patches and add rejects to ignore file. + MinecraftForge/FML@7ea571f593464ad4226ba845da27ff66161621b1 Fix AT, Fix exc. Almost works now! + MinecraftForge/FML@b852e302851cfaf77e1db6f86408e8d049703656 First functional release under reobfuscation. + MinecraftForge/FML@df870c1a3341d8e2e88d7fc3e2f3d9ed2507989f Update shiped ForgeGradle for 1.7 + MinecraftForge/FML@55aa337f952bc72c5a001a6ed661978b11822c63 Rename synthetic bridge methods, these methods are not decompiled, but need to reobf correctly cross the recompile boundary. + MinecraftForge/FML@0098c57f94808751062ee45f2ee267324bb42089 Merge pull request #316 from AbrarSyed/patch-4 + LexManos: Comment out fluids until King gets his hands on it + LexManos: Killed a few hundred compile errors. + Christian: + Moved the core event handler parts to FML. Implemented the Forge network handler based on the new + netty strategy. + + Updated FML: + MinecraftForge/FML@3b2994a3def35a2d3058960b71dc59dc48b802f9 Some patching touchups + MinecraftForge/FML@557357fe179529e0b44aab2f3fcef0c5adf981d5 Update for log4j2 + MinecraftForge/FML@a2b324beb2ef6ec73000678c9305fd70d4ec1643 Copy eventhandler from Forge into FML. It is going to replace a lot of the runtime event systems. + MinecraftForge/FML@4071ff38afe15fddf5db0be882f5627f503a37c6 Patch some GUIs. We're gonna add some basic mod gui config support. + MinecraftForge/FML@0b419ac79c307579f162d47e0388a9d75bcd0a6e Fire a user event down the channels when a handshake has occured. + Christian: + Updated FML: + MinecraftForge/FML@32561265fc935cd6639d5b2e086e879f375676fa Ticks, Player events, keybindings, all migrated to the new event driven system. + LexManos: Inital patch update for 1.7.2, Doesn't compile, not done yet. + LexManos: + Updated FML: + MinecraftForge/FML@a17489172cd54ca955548b15fa0669c9f95d7f45 Code to disable mods at runtime, or other times. + MinecraftForge/FML@85516d9588ebfadbba25f21b2f973e4e81abbaa6 ICraftingHandler, IPickupHandler are now both events. + MinecraftForge/FML@e4b63a1801b453797f5e820eb3f5bd42e6d43948 IWorldGenerator now has an ordering at registration time. This means the order of worldgen should be much more stable. + MinecraftForge/FML@ef3856f9a34e82a05cb2b7715e3611f8fb1a9a6b Update patches for Gradle's rename rewrite: MinecraftForge/ForgeGradle@19e7acf2a27a6c6ae60f6e8ab38337defddc16d3 + MinecraftForge/FML@31ea100b29dfdb4fc907e212c3d49a5240ca72a9 Working on id missing handling + MinecraftForge/FML@3e76dfba34aaba4397fc3fb2bd28e0d1f0abe3e4 More tweaking on id stuffs at worldload + MinecraftForge/FML@f860c8ad3bc7537f885b27c7f045b5b1140c05f4 bump to legacy launcher 1.9 with logging unification stuffs. + bloodshot: + Refactored BiomeManager stronghold add/remove methods to support new + + MapGenStronghold dynamic biome changes. + Changed InitNoiseGensEvent to pass a NoiseGenerator array instead of + NoiseGeneratorOctaves due to new NoiseGeneratorPerlin in + ChunkProviderGenerate. + Fixed worldgen crash caused by wrong metadata in Chunk patch. + LexManos: Get object based on identity not name. + LexManos: Forge uses the FORGE channel for packets. + LexManos: Fix MethodNotFound crash when shutting down internal server. + LexManos: + Fix: + Block placement/interaction + Tesselator crash due to wrong mapping + Missing isreplaceable check in world.canPlaceAt + Small foratting/logging cleanup + Temporarly commented out efficancy changes till I implement it. + LexManos: + Updated FML: + MinecraftForge/FML@58132ccda3a575f10fc209c421fd5d80e01164cc Add new required --accessToken to launch specs. + LexManos: Bump version to 10.12.0 to mark 1.7. + LexManos: Fix debug HUD rendering semi-transparently. + LexManos: Temporary fix for items rendering with effects on one layer. Restores default vanilla rendering, which is considered a bug in modded community. + LexManos: Move Grass {Flower} registry to BiomeGenBase as 1.7 made flowers Biome specifc, this means modders who wish to add global base flowers need to add them to all the biomes indavidually. + LexManos: Fixed accedential inverted logic that caused Potions to render incorrectly. Thanks iChun. + LexManos: Fix items rendering on the GUI with invalid state due to glint rendering changing it. Thanks iChun. + Christian: + Updated FML: + MinecraftForge/FML@156a9ae03a3c80bd1499a8e692c44a322ad9df62 Fix build script + MinecraftForge/FML@7d3b1250e8368886bed0e0da350a94abaa4b6247 Fix handshaking properly. Also, fix ID syncup. It now will completely freeze the idmap after preinit. This frozen map is used to inject "new" stuff into existing serverside worlds. Interesting sideeffect: remote servers lacking things will change the client, to also LACK ids for those things. watch for -1 ids in your remap events. Note: idmaps should be considered temporary per server instance. SERVERSTOPPED will restore "startup" state, as will client logout. + LexManos: + MinecraftForge/FML@c180d9b15735ce89a38c497acd65fa3fab595f77 Add 1.7.2 base json, Gradle will automatically download updated versions of this. Keeping it in the repo allows us to se + e what base json we have built our jsons off of. And if it changes update accordingly. + LexManos: Added constructor to WorldType, and delegated the BiomeLayer management to it. Also updated the access transformer for Item/Block classes. + LexManos: Forgot to regen patches... + LexManos: Resize pending tile updates when it goes over the curent length. Fixed AIOOB error. + LexManos: Add a version check mechanic to startup, it is done in a seperate thread and has a config option to compleetly disable it. This allows us to notify users of new recomended builds. Hopefully stemming the flow of outdated help request. Also adds a warning to the main screen if you are running a 'Beta' Forge. Which means a Forge for a new version of Minecraft that we have not promoted a recomended build for yet. + LexManos: Fix dig speed on redstone ore and obsidian. + ohai.iChun: Add render offset to event. + Christian: + Updated FML: + MinecraftForge/FML@268bbabee6ae3fa1d596bd18e172298e26dc9ce4 Fix handling world reloads when new stuffs are added + +Build 1.6.4-9.11.1.964: + LexManos: + Bump build for gradle fixes: + Now Builds for java 1.6 + Include version,json in universal + Fixed classpath issues in eclipse task. + +Build 1.6.4-9.11.1.963: + luacs1998: + Update readme for ForgeGradle + + Let me know if there's anything else to add or change. + luacs1998: Updated + luacs1998: Another update for eclipse users + luacs1998: Update README.txt + +Build 1.6.4-9.11.1.961: + LexManos: Updated FML: MinecraftForge/FML@c2b919d339e5f63271cfb67a77235c21c5c3b80e Don't validate signatures in dev env. + +Build 960: + Abrar Syed: Step 1: The Purge + Abrar Syed: update FML for gradle changes + Abrar Syed: Step 2: The Reformation + Abrar Syed: Step 3: The Rebirth + Abrar Syed: fixed versioning and stuff + Abrar Syed: added buildSrc to the gitIgnore + LexManos: Fix for new FML, and publish to maven local + LexManos: Update run configs. + LexManos: + Updated FML: + MinecraftForge/FML@e9a7660cb8961660186c7c23e61ab35f9c2dfb81 updated samples + MinecraftForge/FML@30894f7afadf5d3f3c3d5a54c3f904413d5f2309 Merge pull request #307 from AbrarSyed/master + MinecraftForge/FML@c4b8a393f90b00ad7ee4992ea4341ffb6d676abb Make the working directory the root of the eclipse workspace. + LexManos: Regenerate all patches, No functional change as added this is a formatting change only. + Abrar Syed: update build.gradle + porcariadagata: Make the gradle wrapper executable. + LexManos: Proper configuratuion name for jenkins. + LexManos: Fix build file pom closures. + +Build 1.6.4-9.11.1.953: + LexManos: Fix NPE on specific tile entities when the block break event is canceled. Closes #863 + LexManos: Fix NPE in FakePlayers when they are created in a purely client side environment. To remove in 1.7 as FakePlayers should be used for server side interaction with the world on a player's behalf, not for client rendering. + +Build 1.6.4-9.11.1.952: + Christian: + Updated FML: + MinecraftForge/FML@23baf3a8ce58cb8306189401a60647957ccbb4c2 Actually fix the nethandler code + + Update patches + +Build 1.6.4-9.11.1.951: + Christian: + Updated FML: + MinecraftForge/FML@b7f34629c3c47b92ee89d72b0dc935b4997cb009 Don't try and open GUIs on the server. + Christian: + Updated FML: + MinecraftForge/FML@da72640c7ef1f44c49f7f592fbdd193622a30b40 Way to go, missing import. *sigh* + +Build 1.6.4-9.11.1.949: + Christian: + Updated FML: + MinecraftForge/FML@6af42bc656dfb98972d034363352affc9e777805 Add in null protection for client/server sides of handleChat + Christian: Don't send openGui commands from the fakeplayer. Fixes thaumcraft and probably others. + +Build 1.6.4-9.11.1.948: + CovertJaguar: Fix Water/Lava Fluid Localization + +Build 1.6.4-9.11.1.947: + LexManos: Noop out FakePlayer.addStat. + +Build 1.6.4-9.11.1.946: + Christian: + Updated FML: + MinecraftForge/FML@3d25b4e793c59a9131a441d6c7a2d80cac9cd701 Add in the ability to strip interface references for specific interfaces - this is probably mostly useful for scala scenarios where sythetic methods are generated and is not a substitute for using Optional.Method where appropriate. Closes #300 + +Build 1.6.4-9.11.1.945: + onibait: Add block break events based on @bloodmc's initial 1.5.2 Pull Request + onibait: Add block break events based on @bloodmc's initial 1.5.2 Pull Request + onibait: Fixed formatting + onibait: + Cleaned up patches to BlockOre and BlockRedstoneOre + Fixed trailing whitespace (it bugs me too) + +Build 1.6.4-9.11.1.944: + Christian: + Updated FML: + MinecraftForge/FML@f4532410ec1dbf43ce15dfa78d07e5f7be408b08 Change a couple of warnings, as a prelude to 1.7- preinit is now required for all GameRegistry activity, and every item and block REQUIRES registration. + +Build 1.6.4-9.11.1.943: + Christian: + Updated FML: + MinecraftForge/FML@8f87021b0f1ae5b277ad4d1891761b7a7ae1ab71 Fix derp with custom properties. They work now! + +Build 1.6.4-9.11.1.942: + Christian: + Updated FML: + MinecraftForge/FML@bc57ff9e83803d804e9d5374d76273fcd68611f4 Fix recursive API dependency resolution. Allows nested APIs, such as BuildCraft's + +Build 1.6.4-9.11.1.941: + Christian: + Updated FML: + MinecraftForge/FML@de8ab934d8ae960ebc0dede16218ca1e9e488ebc Fix up duplicate entries + +Build 1.6.4-9.11.1.940: + Christian: + Updated FML: + MinecraftForge/FML@81fe1c9682234297443402a54e4b852ef49d0ba8 Add in an API marker for API type packages. This does several things: 1. Packages marked as API will generate a new "modid" (the provides) that can be depended on. 2. Packages marked as API will be searched systemwide, and anything declaring that package (even without the API marker) will get an implicit dependency on the API package. 3. The API package itself will get a soft dependency on the "owner" package. + +Build 1.6.4-9.11.1.939: + LexManos: Add new recipe sorter that is called after all mods are initalized. This is disabled by default in 1.6 to not break current worlds as it may change machine's recipy outputs. Will enable by default in 1.7. Players may enable it in the forge config. + +Build 1.6.4-9.11.1.938: + xcompwiz: + Adds a Check to prevent Biome Replacement + + Splits the BiomeGenBase constructor to create one which takes a flag + that indicates whether to insert the biome object into the biomeList + array. The standard constructor calls the new one with the default of + true. This allows biome wrapper-objects to exist. + +Build 1.6.4-9.11.1.937: + Christian: + Updated FML: + MinecraftForge/FML@dac7f590eabb326c4467dbc829b4aae1e4be2779 Modify ordering of networkmod registration and mod instantiation. This fixes VersionCheckHandler logging an incorrect failure message due to NPE. + MinecraftForge/FML@f0dc530b2833a1c89673208fe296dba5520671c1 Fix up documentation of VersionCheckHandler - it only ever accepted a String and only works on the NetworkMod annotated class + MinecraftForge/FML@243a21a353e6b7717f64008776928c7132110ddf Wrapping coremods as tweakers. Part 1. + MinecraftForge/FML@58a299aabcfadb4139f126a2d46b5247bede4185 Attempt to inject coremods as tweakers, so both can share a dependency ordering + LexManos: Format strings properly in MC's internal logger. Fixes resource pack case warnings. + +Build 1.6.4-9.11.1.935: + LexManos: Updated FML: MinecraftForge/FML@bf54d4d66799f2e58944095826d0722ed0120b1f Make each mod's EventBus log a child of it's main logger. + LexManos: Fix null pointer exception in BiomeDictionary causing the ChunkManager's config to not load/save. + +Build 1.6.4-9.11.1.934: + LexManos: Add wildcard versions of OreDict replacements, Closes #827 + +Build 1.6.4-9.11.1.933: + Christian: + Updated FML: + MinecraftForge/FML@da4337efbfa07b35f5883107768f9ba2f1b24b9b Fix up handling the new method signature data for NetworkCheckHandlers + +Build 1.6.4-9.11.1.931: + Christian: + Updated FML: + MinecraftForge/FML@f92962bbbbb90c19788a5dc2eafdc2eeefdd77ce Use null to empty, so missing values work. *sigh* + +Build 1.6.4-9.11.1.930: + Christian: Add in an event for zombie summoning. Allows for mods to control summoning behaviour, as well as custom summoned mob. + Christian: And remember to make the event class static *sigh* + +Build 1.6.4-9.11.1.928: + Christian: And allow for tweaking baby chance as well. + Christian: And set the RIGHT variable *sigh* + +Build 1.6.4-9.11.1.926: + Christian: Allow configuration of the zombie additional summoning mechanic. The vanilla mechanic is a little borked at times. + +Build 1.6.4-9.11.1.925: + Christian: + Updated FML: + MinecraftForge/FML@58577775d277a4408bda510534eb36841b08ced4 Very minor style fixes + MinecraftForge/FML@96be82343c25b83dd842ada8d6e8b66eb4e4ee00 Merge pull request #280 from mc10/patch-1 + MinecraftForge/FML@2714da10228020a6f2321f6c9a703f0d24fe1370 Primitive capability for tweakers to order. Add a "TweakOrder" integer property to your manifest, or accept the default of zero. + +Build 1.6.4-9.11.1.924: + LexManos: Prevent session from being printed to the console, also make sure the username is not empty. Causes a lot of bugs further down the line. + +Build 1.6.4-9.11.1.923: + Christian: + Updated FML: + MinecraftForge/FML@fc3e7647d2aff01146b1f5bd2ab6b57ef8e833e5 Support, and fix up, interface lists for Optional + +Build 1.6.4-9.11.1.922: + LexManos: Added some missing air checks to world gen features. + +Build 1.6.4-9.11.1.921: + LexManos: Fix repeated argument in CleintCommands. + +Build 1.6.4-9.11.1.920: + LexManos: MinecraftForge/FML@a381874bb9c3bdeeb508bb81719b4d210eb29696 Delay sound system backend initalization to speed up startup and prevent race condition on some computers. + +Build 1.6.4-9.11.1.919: + reflex_ion: + Added PlayerOpenContainerEvent and added ForgeHooks.canInteractWith + + - Used to override the canInteractWith during player tick + - setResult to ALLOW/DENY as required + - Defaults to Vanilla behaviour in any other instance. + + Required for LittleBlocks Mod and to Assist Gullivers Mod + +Build 1.6.4-9.11.1.918: + Christian: + Updated FML: + MinecraftForge/FML@bc64ceabef76b1f4667b22ca8241b72351b44338 Optional shouldn't be constructable itself. It's purely a wrapper thing. + MinecraftForge/FML@55525f6d2eb24f42c26a291b8ce98feb4d4498c9 ModLoader is officially deprecated. It will all cease to be with 1.7. + +Build 1.6.4-9.11.1.917: + Christian: + Updated FML: + MinecraftForge/FML@63ba3aa0099f43183315fb4e16f9e8e8007362f8 Add in support for Optional interfaces and methods. Be gone coremods! + +Build 1.6.4-9.11.1.916: + LexManos: Fix missing patch which caused per-world storage to not be saved. + +Build 1.6.4-9.11.1.915: + rhilenova: Added pre/post to player list rendering in GuiIngameForge. + rhilenova: Moved PLAYER_LIST event inside display check. + +Build 1.6.4-9.11.1.914: + LexManos: + Make isItemStackDamageable() pass the stack to getMaxDamage() to use the Forge version of getMaxDamage(). + Fixes display issues with mods using getMaxDamage(ItemStack) instead of the vanilla one. Closes #805 + LexManos: Bump version number for todays changes. + +Build 1.6.4-9.11.0.913: + ben.blank: allow blocks to choose how they handle indirect power + ben.blank: move `shouldCheckWeakPower` to Forge section + +Build 1.6.4-9.11.0.912: + jrtc27: Pass arguments to install.sh and install.cmd to install.py + +Build 1.6.4-9.11.0.911: + LexManos: Add cancelable EntityStructByLightningEvent, Closes #789 + +Build 1.6.4-9.11.0.910: + LexManos: Stack sensitive version of Item.getItemStackLimit. Closes #771 + +Build 1.6.4-9.11.0.909: + Anthony Lomeli: Villager Trading GUI will not open if Player is sneaking. + +Build 1.6.4-9.11.0.908: + LexManos: Added all the vanilla records to the ore dictionary. Closes #731 + +Build 1.6.4-9.11.0.907: + LexManos: Direct canApplyAtEnchantingTable through canApply Closes #740 + +Build 1.6.4-9.11.0.906: + LexManos: Add pre and post event to rendering Chat, allowing for placement of the chat box. Closes #733 + +Build 1.6.4-9.11.0.905: + LexManos: Set densityDir in BlockFluidBase's constructor, closes #737 + +Build 1.6.4-9.11.0.904: + LexManos: Fix placement of snow cover over metadata 6. Closes #724 + +Build 1.6.4-9.11.0.903: + LexManos: + Add the ability to register chat commands that only execute on the client. Works with autocomplete. + Client commands are gray when shown in the autocomplete list (when you press tab) + Closes #640 + +Build 1.6.4-9.11.0.902: + LexManos: Update workspace to point at launchwrapper 1.8 + LexManos: Vanilla hopper should obey the IInventory contract, TileEntityHopper now takes into account IInventory.getInventoryStackLimit() when inserting items Closes #597. + +Build 1.6.4-9.11.0.901: + hobos_taco: + Added ItemTooltipEvent + + This event is fired at the end of ItemStack.getTooltip(EntityPlayer, boolean), which in turn is called from it's respective GUIContainer. It allows an itemstack's tooltip to be changed depending on the player, itemstack or whether the advanced information on item tooltips is being shown, toggled by F3+H. + +Build 1.6.4-9.11.0.900: + Christian: + Updated FML: + MinecraftForge/FML@5265e34a350adbb762264379f0134bfa40d33eaa Fix null killing the server + +Build 1.6.4-9.11.0.899: + LexManos: MinecraftForge/FML@35ab9f52b02d84592e4c7607feb6009710b2f7d9 Fix md5s for new checksums.sha1 in scala libraries. + +Build 1.6.4-9.11.0.898: + Christian: + Updated FML: + MinecraftForge/FML@e356f4d713b1269825839954fe86f5312ede0fc6 Cross-modsystem compatibility fix with thanks to Mumfrey @ liteloader + MinecraftForge/FML@9b55f1f48f89a5348ac1d58622b71946f310316a Attempt at a shared modlist implementation - should allow visibility between liteloader and fml for "mod list display" + +Build 1.6.4-9.11.0.897: + Christian: + Updated FML: + MinecraftForge/FML@bfc25bc5da1ff0f6fd0faf817b32a8f6d35dedc2 Add to both the classloader and the parent + +Build 1.6.4-9.11.0.896: + Christian: + Updated FML: + MinecraftForge/FML@9f0f9e7288afc6cce9a425ad770a208af9e28648 Fix deobf tweaker + +Build 1.6.4-9.11.0.895: + Christian: + Updated FML: + MinecraftForge/FML@ce6404fd5bb5e8e425af3bcafeaa285575bf39a3 TYPOS!!! + +Build 1.6.4-9.11.0.894: + Christian: + Updated FML: + MinecraftForge/FML@8f18a3de9a02b003762dace891829ef64dfedf49 Separate deobf tweaker so it runs last. Should fix problems with cascaded tweakers expecting an obf environment. + +Build 1.6.4-9.11.0.893: + Christian: + Updated FML: + MinecraftForge/FML@8e26c99de3b44d272d2fdc398e0687db17bce3b7 Add debugging for deobfuscation + MinecraftForge/FML@1d902df5814b815959165e4aa69272003f002d25 Use the negative cache in latest legacylauncher. + MinecraftForge/FML@9815d8c3793182a08fcdbd29376a3f70bff464d0 Update for launchwrapper 1.8 + +Build 1.6.4-9.11.0.892: + LexManos: Add wrapper exception to the new Structure ID system to point to the correct Structure. + +Build 1.6.4-9.11.0.891: + LexManos: Update dev workspace for 1.6.4 .. + LexManos: Remove some side onlys on BiomeEvents that don't need them. + LexManos: Fixed typo in bounding box based ladder checks that caused potential infinite loops with entities in certian positions. Thanks Overmind for reporting it. + LexManos: + Updated FML: + MinecraftForge/FML@fc8c3bef0380d59c0842a252e4f0bd29127ee78b Update to new installer that uses xz compression and better support for non-standard jvms + +Build 1.6.4-9.11.0.886: + Christian: + Updated FML: + MinecraftForge/FML@a4de22c1addf0a6b95d38e467a96f2af417c86d5 And use the parent that's actually going to be valid. *sigh* + +Build 1.6.4-9.11.0.885: + CovertJaguar: + Fluid Rarity should have a default + + Oops. + Christian: + Updated FML: + MinecraftForge/FML@70cffe6982b27df0ea7d8d4d8851a0c0043bb2cb Herpaderp. Make addURL accessible. *sigh* + +Build 1.6.4-9.11.0.884: + Christian: + Updated FML: + MinecraftForge/FML@4a94c2c71bb4cc9644caeb06011a189989b22f87 Fix NPE when loading second single-player world + MinecraftForge/FML@0e80fcb8f716cfef5b016a73ca32ff0e2f3c3c05 Merge pull request #284 from smcv/uninit + MinecraftForge/FML@39620f1e41464f53482277dc3bcb0b9eed8ca25c Fix injection of tweaker into system + +Build 1.6.4-9.11.0.883: + Christian: + Updated FML: + MinecraftForge/FML@79c39f8b7c711377f7919abd1ee6a56a339d1062 Fix classpath for launchwrapper 1.7 + +Build 1.6.4-9.11.0.882: + traincrazyb: Correcting SoundManager Transformer + +Build 1.6.4-9.11.0.881: + Christian: Clean patch fuzz + +Build 1.6.4-9.11.0.880: + Christian: + Updated FML: + MinecraftForge/FML@f6190e8752013c0d6857090ffd42559cf83809ae Update workspaces for 1.6.4 + +Build 1.6.4-9.11.0.879: + Christian: + Updated FML: + MinecraftForge/FML@25981706ef12654b6c2baccc80fa2298bb5afb4a Update for MC 1.6.4 + MinecraftForge/FML@0950b9fc8441a2d3b022ed876f17ee5ac0c47b9c Fix up a deep crash in the early server init hanging the client + +Build 1.6.3-9.11.0.878: + LexManos: Remove duplicate access transformer + LexManos: Move have handler creation up, to prevent NPE. + +Build 1.6.3-9.11.0.877: + LexManos: + Updated FML: + MinecraftForge/FML@e7dd728f955aa4713fef45fea770b1f91246d712 Format the log messages through MessageFormat. Thanks CovertJaguar for the pointer. + MinecraftForge/FML@82d896a35e08be5712bdc15bdb93e5d4fc0ddd46 Make final transformers actually work on methods as well. + +Build 1.6.3-9.11.0.876: + LexManos: Move the Structure data save files to per-world data folders. Vanilla saves them to the global folder which will potentially cause conflicts if two worlds generate 'Villages'. Which in the modded world is highly likely. Refer back to the long standing vanilla issue where nether 'villages' would override the overworlds villages, it's the same situation. + +Build 1.6.3-9.11.0.875: + LexManos: Make MapGenStructureIO name registration functions public, Any mod that has anything extending StructureStart or StructureComponent must register there classes and create a default (no parameter) constructor. + +Build 1.6.3-9.11.0.874: + LexManos: Unfinalized Item.getIconIndex(ItemStack) + +Build 1.6.3-9.11.0.873: + LexManos: + Updated FML: + MinecraftForge/FML@da70cdd35a378d02db47d2aa31fb9aac87beaedc Update tweaker for new Launcher API + MinecraftForge/FML@352117fd78eec745da6c80b8d354947c4dbbbb48 Update for new installer and thank you. + MinecraftForge/FML@40a34af43105ebcb5a63ce2351ca119da5a8158e Merge branch 'master' into newtweak + MinecraftForge/FML@e77d2547ad447025729ae7f3cccaaf343c4c86f9 Update for pre-ninja 1.6.3 update + MinecraftForge/FML@34493b0d99e2cf2bdca080ff226f2dfeedb1cf51 Update for real 1.6.3 update + MinecraftForge/FML@95afc95b248ecc69bc6ffcc5a95912820d8f4066 Update mcp mod info + MinecraftForge/FML@ff75416a325717770a5cf457c859bfb0abcbe281 Update mc_versions data and commands patch and eclipse workspace + MinecraftForge/FML@8f2e67558127f16d92399ea97cbcb0df46d52e19 Update the src distro's eclipse workspace. + LexManos: Bump version for new MC version. + LexManos: Actually push the submodule update -.- + +Build 1.6.2-9.10.1.871: + Christian: + Updated FML: + MinecraftForge/FML@81328b6684c5127427153807b5e498c2efefb96b Add in support for using a mirror list and provide checksums for packed download of libs + +Build 1.6.2-9.10.1.870: + Christian: + Revert "Added a RenderType that allows Map-style rendering w/o inheriting from" + + This reverts commit eb4688bf5ea132cd8ddc802a7dad6d423ad50543. + + Conflicts: + patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch + +Build 1.6.2-9.10.1.869: + vilim.lendvaj: Prevent NPE in fluid lookup for block + Christian: Fix broken PR from vilml. TEST! + +Build 1.6.2-9.10.1.867: + CovertJaguar: + Allow Fluids to have Rarities + + Used for tool tips. + +Build 1.6.2-9.10.1.866: + Christian: Fix the divider + +Build 1.6.2-9.10.1.865: + Adubbz: + Sky colours now smoothly transition + + Made transitions even smoother + + Sky colours now smoothly transition + Christian: Move stuff around a bit- also tie range and enabled to options. + +Build 1.6.2-9.10.1.864: + ml: + Added a RenderType that allows Map-style rendering w/o inheriting from + ItemMap. + Christian: Tweak patch comment + +Build 1.6.2-9.10.1.863: + mitchpetrie29: Check if block is air instead of just ID zero when growing from stem block. + +Build 1.6.2-9.10.1.862: + Christian: Allows proper raytracing from actual player eye position rather than hardcoded eye heights. + +Build 1.6.2-9.10.1.861: + claire.alexandria: Added fov hook + claire.alexandria: fixed merge + claire.alexandria: Small formatting changes (opening braces on new line) + +Build 1.6.2-9.10.1.860: + Christian: + Updated FML: + MinecraftForge/FML@b5af446d7111730c7973c9f0d6b76e62b78b9131 Fix sidedness derp in LanguageRegistry. + +Build 1.6.2-9.10.1.859: + Christian: The partial tick should be available for all render player events. Weird it wasn't. + +Build 1.6.2-9.10.1.858: + Christian: Reverting HarvestEvent, for new implementation + Christian: Redo harvest event. This time with simpler logic, that should be less liable to weird "missing" stuff. + +Build 1.6.2-9.10.1.857: + LexManos: Fix bug where guis were not closed properly, resulting in signs not having there text set. + +Build 1.6.2-9.10.1.856: + Christian: Change trigger calculation so entities get some time to age before refiring the event. + +Build 1.6.2-9.10.1.855: + LexManos: Create helper apply_patches script and add paramter to change patch output folder. + +Build 1.6.2-9.10.1.854: + Christian: + Change from Cancelable to using a Result. This means you can force despawn mobs you + don't want around anymore. Also, deferred check to once every 20 ticks. May tune it + down further or make it a config if this event is a lag issue. + +Build 1.6.2-9.10.1.853: + Christian: + Add a cancellable despawn event- allows mods to decide to prevent the despawning + of certain otherwise normally despawnable mobs. + Christian: + Added fov hook + + Small formatting changes (opening braces on new line) + Christian: Create es_ES.lang + +Build 1.6.2-9.10.1.852: + Christian: Add some javadoc to the HarvestBlock event. + +Build 1.6.2-9.10.1.851: + Christian: Use the dropchance from the event. + Christian: Clean up some formatting. + +Build 1.6.2-9.10.1.850: + claire.alexandria: Added tessellation methods to obj model, for ISBRH-friendliness + claire.alexandria: Fixed both RenderAllExcept behaviours + claire.alexandria: Added more render methods to IModelCustom interface. + jk-5: + Added GuiOpenEvent + + You can use this for a clean way to override guis, without needing an + TickHandler to check if the gui you want to override is open and show + your own gui + + Proper close check + mhahn: + capacity was not respected + + Updated to properly calculate the amount of free space in the tank + before checking that against the amount of the resource. + robin: create french localization + claire.alexandria: Added display name hook + claire.alexandria: Memoization of display name result + claire.alexandria: Added mouse event + claire.alexandria: inserted hook into Minecraft.java + claire.alexandria: fixed logic error + ohai.iChun: + Fix player push out of blocks clientside being hardcoded and not based on entity size. + Added player eyeHeight field to allow changeable eye heights of players rather than being hardcoded per player class as well as add a getDefaultEyeHeight function. + Christian: Reduce patch size significantly + Christian: Fix patch for new MCP naming. + Christian: Add a bit of javadoc + Christian: MachineMuse, remember, there's TWO model formats supported! + Christian: Defer firing CreateDecorator until it's likely mods have had a chance to register their listener. Should close #759 + Christian: + Add a harvestblock event, to allow mods to intercept and change the drops for blocks. Don't abuse this, or we'll have to take safety measures. + Fires for both silktouch and non-silktouch harvesting, and provides the player. Note, you may need to + change your break overrides to pass on the player for best results. + Christian: Add in a block reverse lookup for fluids. Closes #749 + +Build 1.6.2-9.10.1.849: + Christian: + Update forge for MCP naming updates + + Updated FML: + MinecraftForge/FML@d0c6e92900590f578b80d9a6c00fa28fd333d3bf Update MCP data + Christian: Update version to 9.10.1 for mcp naming changes. + +Build 1.6.2-9.10.0.848: + Christian: Fix possible NPE in searching code. + +Build 1.6.2-9.10.0.847: + Christian: + Updated FML: + MinecraftForge/FML@2a9c485edc4cf3382154d5b3b9b600386f2ab8ae Remove @SideOnly from 70318 (getDistance) it makes no sense that it's not on the server. + +Build 1.6.2-9.10.0.846: + Christian: + Updated FML: + MinecraftForge/FML@a13598b17ea9637c054d867a76298d6c080c5e32 Use java 1.6 compatible method of closing the zip file. Stops stupid compile error. + +Build 1.6.2-9.10.0.845: + Christian: Small fix to container registry. emptyContainer is not null, it's "NULL_EMPTYCONTAINER" now and won't match any valid container. + +Build 1.6.2-9.10.0.844: + Christian: Tweak the release to add in assets to the distributable. *sigh* + +Build 1.6.2-9.10.0.843: + Christian: + Updated FML: + MinecraftForge/FML@1c9a853868f7df0daa5f67b99401dfab44ae18e6 Allow coremods to properly inject asset readers. + MinecraftForge/FML@40b54013b4c9b01686411cd47a7866eeb650ea2b Allow server side lang file injection, hopefully + Christian: Add some starting work for a forge tps command. Also update coremod for new FML behaviour + +Build 1.6.2-9.10.0.842: + Christian: + Updated FML: + MinecraftForge/FML@b993cf4a9825865b3a8a0c7b083c23d56dbd1d6f More exception handling for less derpiness. + +Build 1.6.2-9.10.0.841: + Christian: + In the time honoured tradition of trying to fix vanilla, we today attempt to patch the pathfinding AI so that it doesn't lag when + there's a lot of entities. Basically, if the zombie can't reach the villager, backoff subsequent pathfinding attempts. Hopefully + should really help with lag caused by zombie swarms. + +Build 1.6.2-9.10.0.840: + Christian: Allow multipass RenderItem rendering for terrain icons too. Should fix sengir's saplings. + +Build 1.6.2-9.10.0.839: + Christian: + Updated FML: + MinecraftForge/FML@913f6f6d36bd179db7c147db0485e99dee693933 Try and use the relaunch log, which should be classloaded.. + MinecraftForge/FML@ac065ff5f76b6c512b346366107efde66e9e1c88 Reset the IWorldGenerator seed for each mod, before calling. That should mean worldgen is consistent and not dependent on mod ordering, or mod sideeffects. + +Build 1.6.2-9.10.0.838: + LexManos: Cache world on all render passes in case some mod disables the first pass. + LexManos: Skipp toss event for null entity items. Closes #732 + +Build 1.6.2-9.10.0.837: + LexManos: Fix bug with custom Fluids. You can now drown in them! + +Build 1.6.2-9.10.0.836: + Christian: + Updated FML: + MinecraftForge/FML@9468e41bbf3ea425c50daa710cf3ada11c82b238 Fix up scala refs, for better results + +Build 1.6.2-9.10.0.835: + Nick: + Adds Temperature to Lava + + Missing lava temperature. Feel free to change it to any value. + 1300K is the typical max for Magma so wasn't sure what was desired. Regardless, better than the same temp as water at 295K :smile: + +Build 1.6.2-9.10.0.834: + Christian: + Updated FML: + MinecraftForge/FML@4a9d0f9bd522e543b76daaf9c49b6214443c595f Add in some log information + Christian: + Updated FML: + MinecraftForge/FML@f157e7a6ecdeac2758fc0eaf547d3e8a763fb15b And more coremod logging + Christian: + Updated FML: + MinecraftForge/FML@ffdd056a18eddb8f28b74435d40e69c956b9dd48 Check keys, not values *sigh* + +Build 1.6.2-9.10.0.833: + Christian: + Updated FML: + MinecraftForge/FML@03989166665956df03aa85472eb13dca2d74a38d And actually instantiate the collection *sigh* + +Build 1.6.2-9.10.0.832: + Christian: + Updated FML: + MinecraftForge/FML@dec9a3924d361bc016cb7f6b3e95764158cf5ae1 Add in "FMLCorePluginContainsMod" in the manifest. If this value is present, FML will attempt to parse your mod jar file as a normal mod file as well, instantiating mod containers there. + +Build 1.6.2-9.10.0.831: + Christian: + Updated FML: + MinecraftForge/FML@24701206808a43b9c7b10d7130c47b5d1e841bb6 Clean up a couple of resources. Also, don't parse jars just because they're in the mods dir + +Build 1.6.2-9.10.0.830: + Christian: + Updated FML: + MinecraftForge/FML@9a5e24e338c6172531efb086a4b584c26d4f1435 Fix stupid derp is stupid. Closes #275 and means sp614x can do his thing + MinecraftForge/FML@ba90b616070ce15793eb05e5afaed62a6f07c6e7 Make sure we only add args to the argument list if a tweaker hasn't already. Should fix LiteLoader compatibility issue. + +Build 1.6.2-9.10.0.829: + LexManos: Fix NPE in enchangint books. + +Build 1.6.2-9.10.0.828: + LexManos: Fix inverted case, search works now. + +Build 1.6.2-9.10.0.826: + ross.swartz: Add stone and cobblestone to Ore Dictionary + ross.swartz: Update OreDictionary.java + LexManos: Addition: Added isAllowedOnBooks hook to Enchantments Closes #589 + +Build 1.6.2-9.10.0.825: + LexManos: Deprecate Block.addCreativeItems, Kill in 1.6.3+ Closes #655 + +Build 1.6.2-9.10.0.824: + mehvids: Add onNeighborTileChange callback to block by generalizing func_96440_m to all blocks rather than just comparators. + +Build 1.6.2-9.10.0.822: + malc.geddes: Added a new function to allow control over whether an entity is dismounted when the entity it is riding goes under water + LexManos: Allow creative tabs to have a search box if they want to Closes #592 + +Build 1.6.2-9.10.0.821: + tommy.stanley96: Fixed Fluid Non-Solid Block Duplication + tommy.stanley96: Fixed Double Item Drop + tommy.stanley96: Fixed Classic Checking + +Build 1.6.2-9.10.0.820: + LexManos: Add optional feature to check entire bounding box for ladders. Closes #709 + +Build 1.6.2-9.10.0.819: + LexManos: Only refresh vanilla tile entities when IDs change. + +Build 1.6.2-9.10.0.818: + LexManos: + Updated FML: + MinecraftForge/FML@f275a24b43559cfdced243ff77e9848c9d458362 Add in some reverse lookup methods for game registry data + MinecraftForge/FML@cb05c8c4aa60a131de92f0a21c06697c8f8896a8 Add missing SideOnly in BaseMod + MinecraftForge/FML@1857064afa9ace796440c19f3275637a6e659375 Merge pull request #266 from grompe/patch-1 + MinecraftForge/FML@182aa9c0cbe61ac69b0d428ead1dc817dd2a2e71 Fixed install.sh not passing arguments to install.py + MinecraftForge/FML@f46a538b41157081c840f647f123513ac4c5a071 Merge pull request #268 from Bo98/sh-args-fix + MinecraftForge/FML@29ef3d5ab412dcabbd67695558880c45011ace82 Update installer. + +Build 1.6.2-9.10.0.817: + tommy.stanley96: + Fluid Render Fix + + Formatting + ohai.iChun: Add Pre and Post events for RenderLivingEvent + ohai.iChun: Add Pre and Post events firing for RendererLivingEntity + ohai.iChun: if statement added + ohai.iChun: Update RendererLivingEntity.java.patch + tommy.stanley96: + Fixed fluids eating each other + + Fluids check for other fluids density before flowing, if their density + is higher they can flow into the other fluid, if not they can't. + CovertJaguar: Add SneakClick bypass to client + cpw: Fix names for water/lava fluids. Closes #689 + cpw: + Add support for loading legacy liquid stacks as new fluid stacks. + Requires having been written with the "liquidname" code from forge 1.5.x + cpw: + Add a translation map for looking up legacy liquid names to convert + to new fluid names. + tommy.stanley96: Fluid Rendering Fixes + cpw: Fix formatting error in PR + cpw: + Tweak setBlock in update tick - it should only send serverside updates for + source blocks. Experimental attempt to fix worldgen issues for fluid blocks + cpw: + Updated FML: + MinecraftForge/FML@57befa89bbbf2bc2fcc4a97b78e07b3f9e23ef9d Fix keybindings being derped + MinecraftForge/FML@1d84e8063e9d0dc73928dba006e6001201285cad Temporarily add a version of 'reobfuscate.py' that will resolve complex reobfuscation graph issues with specialsource. Copy it over 'reobfuscate.py' in the mcp runtime dir. Hopefully will have an MCP/specialsource fix in the coming days. + ohai.iChun: Fix RenderLivingEvent.Pre/Post not being fired by most Renders. + tonkamatt98: + added temperature to fluids + + it could be useful for blocks that are affected by temperature + mitchel.pyl: Fix render colour on bottom of fluids + mitchel.pyl: Fix small derp + +Build 1.6.2-9.10.0.816: + purpleposeidon: + Add an InputStream constructor to WavefrontObject + + It is said that Resource Packs will return InputStreams. And I like putting my models into texture packs which, obviously, give InputStreams rather than URLs. + 7of9: Add cloud height to WorldType + +Build 1.6.2-9.10.0.815-miscchanges: + mitchel.pyl: Fix render colour on bottom of fluids + mitchel.pyl: Fix small derp + +Build 1.6.2-9.10.0.812-miscchanges: + tonkamatt98: + added temperature to fluids + + it could be useful for blocks that are affected by temperature + +Build 1.6.2-9.10.0.811-miscchanges: + ohai.iChun: Fix RenderLivingEvent.Pre/Post not being fired by most Renders. + +Build 1.6.2-9.10.0.810-miscchanges: + cpw: + Updated FML: + MinecraftForge/FML@57befa89bbbf2bc2fcc4a97b78e07b3f9e23ef9d Fix keybindings being derped + MinecraftForge/FML@1d84e8063e9d0dc73928dba006e6001201285cad Temporarily add a version of 'reobfuscate.py' that will resolve complex reobfuscation graph issues with specialsource. Copy it over 'reobfuscate.py' in the mcp runtime dir. Hopefully will have an MCP/specialsource fix in the coming days. + +Build 1.6.2-9.10.0.809-miscchanges: + cpw: Fix formatting error in PR + cpw: + Tweak setBlock in update tick - it should only send serverside updates for + source blocks. Experimental attempt to fix worldgen issues for fluid blocks + +Build 1.6.2-9.10.0.808-miscchanges: + tommy.stanley96: Fluid Rendering Fixes + +Build 1.6.2-9.10.0.807-miscchanges: + cpw: + Add a translation map for looking up legacy liquid names to convert + to new fluid names. + +Build 1.6.2-9.10.0.806-miscchanges: + cpw: + Add support for loading legacy liquid stacks as new fluid stacks. + Requires having been written with the "liquidname" code from forge 1.5.x + +Build 1.6.2-9.10.0.804: + copyboy: Fix getArmorTexture by passing it the subtype + +Build 1.6.2-9.10.0.802: + LexManos: + Re-added deprecated liquids system. To be removed next major MC versions after issues with Fluids are fixed. (reverse-merged from commit 9b5208fa308f22c24e295ce3be38dcafea2857ea) + This WILL be removed and should not be developed against aside for a temporary 1.6 release. + +Build 1.6.2-9.10.0.801: + LexManos: Remove SideOnly(Client) in IBlockAccess.isAirBlock + +Build 1.6.2-9.10.0.800: + LexManos: MinecraftForge/FML@10b16d32da4b7c32b15e69cf1c636505ebbe2540 Use json 2.9.1 nightly for OSX in release json like vanilla does. + +Build 1.6.2-9.10.0.799: + LexManos: General code cleanup of Fluid system. Made Fluid icons and associated functions non-sided. + +Build 1.6.2-9.10.0.798: + LexManos: MinecraftForge/FML@3f21a2c1b413e591f61f2906c3adbadd9c5b09e3 Stupid spaces and windows escaping -.- + +Build 1.6.2-9.10.0.797: + LexManos: MinecraftForge/FML@b2958c9066db8c95bb4260893fbfe00103fc4ba1 Add quotes for paths with spaces -.- + LexManos: Package 'version.json' with universal jar for maunchers to use. It's the json used by the vanilla Minecraft launcher for Forge. + +Build 1.6.2-9.10.0.796: + LexManos: MinecraftForge/FML@9520978b81d4cba5d8b0af0d5f155bd115023795 Use a temporary file for recompile's command line to combat command length to long issues. + +Build 1.6.2-9.10.0.795: + LexManos: Updated FML: MinecraftForge/FML@4981aa3421262c3c1c4705468fe202df8198b9f0 Fix potential NPE in villager skin registry. Closes #678 + +Build 1.6.2-9.10.0.794: + Nick: + Fixes Vanilla Fluid Still Icon Setters + + Fixes null icons from being set for both the still water/lava icons, and sets the correct Icon. + +Build 1.6.2-9.10.0.793: + LexManos: Updated FML: MinecraftForge/FML@c48b48ee15f38d3e794b6eb3499c536226ca5a79 Fix server launching. + +Build 1.6.2-9.10.0.792: + Christian: Fix for new location of mcp logo. + +Build 1.6.2-9.10.0.791: + Christian: + Updated FML: + MinecraftForge/FML@0378355c3720d587652b7792665a8b70bf104eb3 The server.classpath generates the runtime manifest, so it needs the non-debug asm jars. + MinecraftForge/FML@a3f48734ffbbb2eccffdafcd3cbe73824bd1afd6 Fix up jar sanity check code. FML validation of the jar works now and doesn't derp classloading. + MinecraftForge/FML@9947ba85036542a3231e25328d3300f2a5337370 Fix logo handling. no more NPE if the logo can't be found. Also, fix location of mcp logo now. + +Build 1.6.2-9.10.0.790: + Adubbz: + Made eating particles compatible with metadata + + Removed extra spaces + + Made eating particles compatible with metadata + Christian: + Updated FML: + MinecraftForge/FML@e44e8b3112bd56c716a00c19d0be2f15d9128b70 Force a global asset scan prior to mod construction : you should be able to reference assets anywhere in your mod now. + MinecraftForge/FML@20e93a412ee13498babef02d404f57bf5e0fd919 Fix up logos in the mod screen. Clean up some unnecessary casts and suppressions, use the -debug asm library at dev time, since it contains full symbols and code in compiled form. + LexManos: MinecraftForge/FML@b9f4b02cb0b041594656f05de70225df702a8ddd Kill mcp's truncate method, for more useful logs. + LexManos: + Updated FML: + MinecraftForge/FML@7348929819b0ae8ad35419ef5dbf66e66b442858 Kill release time scala libraries, to be re-evaluated after all movement is done and shit is fixed. May require manual instalation for mods that use scala. + MinecraftForge/FML@6de36d78f57f6f08ec586b67b684d0e5406cd436 Coremods now have a primitive dependency capability. Also, we search mods dir for special "TweakClass" manifests. These are using the vanilla tweak mechanism to inject into Minecraft. Helpful for other "platform" systems, when you don't want to have to deal with json changes! + MinecraftForge/FML@d4b30422b64a62a2f8a8c2cccd94cb0fd06154e0 Update build and eclipse workspaces for debug asm. + LexManos: MinecraftForge/FML@c625ef30093abb0755985c74d1f31e2c4cf6cfdd Update Forge signature for new private key + LexManos: Update changelog generator to point to new jenkins. + LexManos: Monkey patch to try and make print flush properly. + +Build 1.6.2-9.10.0.789: + LexManos: Re-add reverted patch AGAIN cpw check your commits -.- + +Build 1.6.2-9.10.0.787: + Christian: + Updated FML: + MinecraftForge/FML@bab4d87ce76baa40200939cc46780b1d3b2ff466 Update FML for new stealth update for 1.6.2 + +Build 1.6.2-9.10.0.786: + Christian: Remove forge ISidedInventory, deprecated since 1.5. + +Build 1.6.2-9.10.0.785: + Christian: + Allow optional rider interaction for entities, thanks for the suggestion Vswe. + + Updated FML: + MinecraftForge/FML@7af5c21d74679d1a53550f9719bba22b2f28dd13 @InstanceFactory was set to look for Fields instead of methods + MinecraftForge/FML@bc9d1fe657c7a0953adc7d4c5ed81c575bdfb0f1 Merge pull request #254 from CaptainShadows/patch-1 + +Build 1.6.2-9.10.0.784: + LexManos: MinecraftForge/FML@c913258ca38e662264bdf4aafbfbef86881c9290 Disable signature check of client for now, it's broken. + Christian: + Updated FML: + MinecraftForge/FML@97269a5e3dc0a0e2e1a79183f9f5f2ee120e90bd Decode the file URL. Hopefully will make things work more.. + MinecraftForge/FML@d4d522c5978ecd7a9195977b3327b441901bb5b4 And don't forget to remove the test code + +Build 1.6.2-9.10.0.781: + LexManos: + Updated FML: + MinecraftForge/FML@dfa3a2665d6782b87713cea26dda558ac990a72a Add MC Version to installed version name. + MinecraftForge/FML@e91431fb707ce3e7e4296ccb8f3b2e5208b4dfac Don't validate signatures on servers, they are not signed. + MinecraftForge/FML@c7ab872c85dd057a4e44e12e34089dfd1a1184b6 Temporarily disable GuiModList's Mod logos. + +Build 1.6.2-9.10.0.780: + LexManos: + Updated FML: + MinecraftForge/FML@c997f2adbc4c11cd8c2abe5f82ccd00b0e954b68 FML now verifies that the minecraft jar is correct and intact. This is intended to discourage those who think that modifying the minecraft jar is still acceptable. + MinecraftForge/FML@0db4624b27a5ecf59ed506ccfc26459ca26ee408 Don't initialize the server. + MinecraftForge/FML@4fa375683fdb7edff67c951fb371ab4a23435308 Fix NPE in new debug line when patch targets don't exist. + +Build 1.6.2-9.10.0.779: + LexManos: Fix accedential reverted patch. + LexManos: Proper return for getRegisteredFluidContainerData thanks Soaryn. Ref issue #634 + +Build 1.6.2-9.10.0.778: + Christian: Make resourcelocation the class available on the server. + +Build 1.6.2-9.10.0.777: + Christian: + Drop two domain related fixes that have been applied in vanilla. + + Updated FML: + MinecraftForge/FML@c47d08c89dfcacb96e36c427593174e08dcb4224 Tweak debug data on patched classes + MinecraftForge/FML@dbf5fe38cee04288e92d57f8782114b452245bce We now generate an adler32 checksum for each patched file and verify at load time that they match. Mismatch won't crash, but will emit a big warning.. + MinecraftForge/FML@e88a0cd13f63904f7317e1a73880611f58820389 Update for stealth update. Thanks mojang! + MinecraftForge/FML@2336002f20e9412a7663781b23c51de0eff6a692 The game is going to exit in face of patch mismatch, unless you force it to run with fml.ignorePatchDiscrepancies in the system properties. + +Build 1.6.2-9.10.0.776: + LexManos: + Updated FML: + MinecraftForge/FML@1d0384f8f664d7002019b865675a5fddf2963b3d Update for 1.6.2 and MCP 8.04 + MinecraftForge/FML@111b0216fdc55f56a8361a584141bca7c9c3f070 Add the jsons for 1.6.2 + MinecraftForge/FML@6f96d89e2bf9313b26eeb4c334a208bf3e1c9ad4 Update eclipse workspaces for 1.6.2 + LexManos: Remove deprecated Liquids API, Use new Fluids system as replacement. + LexManos: Bump version to 9.10 for new MC version and removal of Fluids. + +Build 1.6.1-8.9.0.775: + Christian: + Updated FML: + MinecraftForge/FML@c97ac284a5e7dbdbccbad2f7ccc95252c4aef239 Update ModLoaderFuelHelper.java + MinecraftForge/FML@3a200e901e34ade679e4485307f57bee725bbe94 Fix coremod injection into main system. Should stop double-dipping coremods. + MinecraftForge/FML@2676c8999cbede05b5475ba68bfc25467a67d4fc Update mcp data. fixes #248 + MinecraftForge/FML@5990e29af7b70e343dfd9cf38bb3e033e71a4489 Merge pull request #247 from jk-5/patch-1 + MinecraftForge/FML@adc89722770b7319884619cadc6f10cc9050df24 Add cascadedTweaks. This will allow simple coexistence for any other mod framework using the tweaker system as well. Hi Voxel and LiteLoader! + +Build 1.6.1-8.9.0.774: + xcompwiz: + Makes player-specific spawnpoints dimension aware + + Makes ServerConfigurationManager correctly get player-specific spawn + point for the target dimension + Changes EntityPlayer to store and save a (bed) spawn point for every + dimension, as well as transfer them to respawn "clones" + +Build 1.6.1-8.9.0.773: + LexManos: Re-gather list of Icons when atlas textures are stitched, allows for addition/removal of blocks/items after the atlas's inital constrction. + +Build 1.6.1-8.9.0.772: + LexManos: Fix enchantment effect on single pass items. Closes #644 + +Build 1.6.1-8.9.0.771: + kinglemming: + Forge Fluid System! + + Signed-off-by: King Lemming + LexManos: Mark old liquid system as deperated to be removed next Minecraft release. + +Build 1.6.1-8.9.0.770-newliquid: + LexManos: Mark old liquid system as deperated to be removed next Minecraft release. + +Build 1.6.1-8.9.0.769-newliquid: + richard: Techne model loader (incomplete for debugging) + richard: Complete it, got the bug figured out + Christian: + Updated FML: + MinecraftForge/FML@24c405665105a789a0708a7e30c8bcb96899da6b Add in an optional modid identifier for @SidedProxy. It's main use is when both scala and java @Mods reside in the same package, and you want the @SidedProxy behaviour for a specific @Mod language type. In general it should not be needed otherwise. + MinecraftForge/FML@cd0466395a8f1af3ec44f124bf4088df2d318603 Fix sysout with trailing messages after a newline + LexManos: Disable ImageIO's File based cache, should speed up texturepack loading/stitching. + jadran.kotnik: Added rotation support for all vanilla blocks that can be rotated. + LexManos: + Add NPE protection to ItemStack delegates. Closes #601 + Also cleaned up the names of said delegates, we do not have to follow MCP's crowdsourced names as they are very bad. + Redirected damage through setItemDamage to allow items to have finder control of breaking. + LexManos: Fix Air block check in BlockPortal. + LexManos: Fix hoes being able to till dirt under other blocks, and made it look for air type blocks. + LexManos: Add NPE protection to refernce to MinecraftServer.worldServer + LexManos: Fix AIOOB exception in crash reporting if exception does not have a stack. Possible, but odd. + LexManos: Fixed changelog generation. + LexManos: Forgot most important side, release script. + Christian: Make glass panes and iron fences connect to block sides based on solidity. This does change IBlockAccess, so anything with a custom IBlockAccess may need to implement the new method. + Christian: + Fix server patch FML update + + Updated FML: + MinecraftForge/FML@22738de028a9ba51d43d73857dfb8969985566f0 Attempt to properly fix deadlock if the internal server derps. It should never hang now. Damn you fast computer.. + MinecraftForge/FML@05a854cd2af53ca822ee8b249b0b3bbe44f94675 Small tweaks to the mcp data. Nothing major.. + mitchel.pyl: Fix tripwire patches for solid sides + LexManos: Added EntityLiving to Block.isLadder arguments, deperacating older version. New parameter has the possibility of being null, so modders must take care. Closes #608 + LexManos: Add air checks to BlockSand falling and Piston pushing. Please report any other issues with custom 'Air' blocks in issue #602 + LexManos: Bump Forge revision and mark recomended. + LexManos: Fic Chest content gneeration delegate call. Cloases #609 + LexManos: Add air check to Flint and Steel Ref: #602 + LexManos: Update workspace for new library structure. + LexManos: Update FML to 16launch branch + LexManos: Initial patch update to 1.6, Does not compile, need to update references to the old TexturePack system. + LexManos: Small fixup, need to Update GuiIngameForge for new HUD changes. + LexManos: + Updated FML: + MinecraftForge/FML@6a318ddb784ca8b2bef0f6718089f7beb4d404e0 Fix typo in new packages. + MinecraftForge/FML@3711da9c456d20865a965734cc5aeaf7f5cb5e5d Another typo + MinecraftForge/FML@e35e4b16ff3d6dea547c41f02f2ca31ebe1f74aa More fixups + MinecraftForge/FML@18371bd8c9bd107f774289da35519f593ccc8ee7 Some fixes for updated mcp code + MinecraftForge/FML@ef646d3146e1f285d2cb8e79a74373beffa84774 Merge branch '16launch' + MinecraftForge/FML@7406b38d8ad1bc5c2c641c74f1614b946f246588 1.6.1 + MinecraftForge/FML@12c928c538c1c04d3a21255c747d15468328ace9 Tweak commands patch + MinecraftForge/FML@3f15cd54c2d776ea161aaedbecad9e188d66578f Functional client @ 1.6.1 + MinecraftForge/FML@71a92de5d95fccc4fe17cc39d0836891c6622f4d Client launch for eclipse + LexManos: + Updated FML: + MinecraftForge/FML@8960f6869fbe30d358a40997c47999025c3eae68 Add windows lzma executable http://tukaani.org/xz/ He states that most things are under public domai + n, But I couldn't find an exact reference to this executable. I'm going to assume it under public domain and distribuiting it here is fine. If not someone pleas + e direct me to the apropriate license and I will act accordingly. + MinecraftForge/FML@70cfe24e67adf6872ef1501599e2115e420c2539 Fix wrong project name in distro eclipse launch. + MinecraftForge/FML@7a004087f79b94bc92f29d50eb71288b6c1c968c Add deobf data to src dist. Dont create deobf jar as we ship the lzma Added *.lzma to .gitignore + LexManos: + Updated FML: + MinecraftForge/FML@110cf372eb5aa85df20b248976f1acdefa85e102 Add deobf data to merge-common, workspace is now actually runnable! + LexManos: Support dirty submodules in changelog script. + LexManos: 1.6.1 Update + LexManos: Add new launch configs to dev workspace. + LexManos: Update GuiIngameForge to reflect Mojang changes in 1.6.1 + LexManos: + Updated FML: + MinecraftForge/FML@c418da353f6a8420b095fa737e8b0eae270d31ae Cleanup coremod code, server side working now. + LexManos: Update release script to generate binary patches and include deobf data. + LexManos: Deprecation sweep and update version to 8.9 to reflect 1.6.1 update. + LexManos: MinecraftForge/FML@7fecf2ad6bdd918149a3c43453f6a78bd11e5404 Update mcp URL. + LexManos: Try absolute path, to not confuse jenkins. + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + LexManos: Update ToolMaterial enum helper. + LexManos: Release will now build a installer jar and use the standard 'target' output folder. + LexManos: + Updated FML: + MinecraftForge/FML@29d6c875d0675ffa14428c511bd6ebe9232a486c Add FML Installer logo crated by @ZaverSLO https://twitter.com/ZaverSLO/status/349947190300508162 + MinecraftForge/FML@3d17434510e890574b68c8a181b80c830b5d043a Build installer package for the new client launcher. + MinecraftForge/FML@bf38d947569911dab03319a8b0f1964f36b195b2 Update json samples + MinecraftForge/FML@7037184a4e724300001dfc1f8df2e76a0ec30368 Fix up release JSON + MinecraftForge/FML@dc7d02ebf6c9fc5965344a9aeca79f230a40afb4 Fix json syntax error. + LexManos: + Fix installer unintended replace. + + Updated FML: + MinecraftForge/FML@9b6525e80504ff72a1798cf5797bf148295db776 Point scala downloads to our servers, Launcher doesn't like standard maven repos. + LexManos: + Updated FML: + MinecraftForge/FML@91ecf711092e1610dd10e77cdd517c3324e62d8d Fix -rel json + MinecraftForge/FML@efc369ee83a7b62f605c13e16efad66b63b4bd8c Fix EventHandler annotation. + MinecraftForge/FML@fbd57b32641b540d609314d91fd64350d50b9013 Mods are now loaded as resource packs. Vanilla will scan for valid prefixes based on subdirs of 'ass + ets' which can then be referenced as ResourceLocations with the ":path" notation. + LexManos: + Updated FML: + MinecraftForge/FML@5a97d183dfb13b0f831172a1afef7407347ea7bc Remember to update your patches!!!! + MinecraftForge/FML@f1b533ad87ea08d6e62259c59779bcec1636e2fe Keep these on our servers until the launcher is actually fixed -.- + LexManos: Fix bound texture in Controls screen, Closes #631 and #629 + LexManos: Make Block.setIconName public + LexManos: Update filler block to prevent useless console warning. + LexManos: Fix resource domain when loading icon. Textures should be located in /assets/{domain}/textures/{block|item}/{name}.png Same strcutre as before except 'assets' instead of 'mods'. + LexManos: Update ChestGenHooks for new Dungeon chest strcture. + Christian: + Start: f1b533ad87ea08d6e62259c59779bcec1636e2fe + End: f21cd286ca8e974b75536224a38cc0dacaca8454 + Updated FML: + MinecraftForge/FML@f21cd286ca8e974b75536224a38cc0dacaca8454 Resource packs, part two. FML mods are now resource packs. Vanilla will scan anything under 'assets' and turn it into a resource prefix. Use resourcelocations to look stuff up. + LexManos: Move resource location resolution down to TextureAtlasSprite and allow for sprites that are not stitched. + LexManos: Attempt to gather lastBuild information to fix ChangeLog's off-by-one issue. + LexManos: + Updated FML: + MinecraftForge/FML@6f0eedc9a64e4e246c40335e91b4868ad7f5a9e2 Fixed ClassCastException when loading ModLoader mods + MinecraftForge/FML@8844554da6d5d15756d7b0a9da2f5924006b3190 Merge pull request #243 from jrtc27/modclassloader + MinecraftForge/FML@7aa7221756d62ea1fbc750d7cf7acfdb28d75f2e Fix transformer search + MinecraftForge/FML@5f7df5e742cbc21565cee0d25709b5cb5462127c Revert "Keep these on our servers until the launcher is actually fixed -.-" + MinecraftForge/FML@ad79b9ed86eaf8c2702d79505d78a931c1774560 Fix up some deprecation warnings, and clean up coremod code that's going away. + MinecraftForge/FML@ba3707af22376f8f18103f63db56e4614a9c37db More javadoc cleanup + LexManos: Update dev worksapce: Proper natives location and new server launch profile. + LexManos: TEMPORARY fix for MCP mapping issue. + LexManos: Include MANIFEST file from FML's universal.jar, makes the jar runnable now! + LexManos: + Updated FML: + MinecraftForge/FML@155e8468180c93f1886a64028628764b1b22dd58 Add in support for mods/ as a mod location. Also drop coremods as a location. They go in mods too now. + MinecraftForge/FML@3f4bf61ae6757605b27078c7321de9f640876836 Update key + MinecraftForge/FML@4545beb49d5348d8632e42965627b9837115525b Add deobf-data to setup env. + MinecraftForge/FML@e24f94951741709329208f738000b72933302a24 Fix eclipse workspaces and launch configurations. + MinecraftForge/FML@532bee7ce1c4392ee11f0389d98f0c2be6240aa0 Update to new MCP bugfix version, Fixes: Missing Armor/Item rendering, and Boss health mapping issues. + LexManos: + Updated FML: + MinecraftForge/FML@7ce84491d1d4eada442944e02fc0e50c51f8045c Fix missing argument and startclient/startserver support. + LexManos: Fix domain issue with SoundPool entries. + LexManos: Add hook for EntityWither trying to destroy a block. + LexManos: Fix lether item rendering colors. + LexManos: Render pass sensitive version of Item.hasEffect, Closes #517 + LexManos: Fix compile errors temporarily, dont use till updated to new system. + LexManos: Add missing air checks to WorldGenTrees and ChunkCache Closes #593 + LexManos: Updated FML: MinecraftForge/FML@54e06e841d1c8df24fc30e1ec3a51def67f58858 Move Resource refreshing until affter postInit. + +Build 1.6.1-8.9.0.768: + LexManos: Add missing air checks to WorldGenTrees and ChunkCache Closes #593 + LexManos: Updated FML: MinecraftForge/FML@54e06e841d1c8df24fc30e1ec3a51def67f58858 Move Resource refreshing until affter postInit. + +Build 1.6.1-8.9.0.767: + richard: Techne model loader (incomplete for debugging) + richard: Complete it, got the bug figured out + LexManos: Fix compile errors temporarily, dont use till updated to new system. + +Build 1.6.1-8.9.0.766: + LexManos: Add hook for EntityWither trying to destroy a block. + LexManos: Fix lether item rendering colors. + LexManos: Render pass sensitive version of Item.hasEffect, Closes #517 + +Build 1.6.1-8.9.0.765: + jadran.kotnik: Added rotation support for all vanilla blocks that can be rotated. + +Build 1.6.1-8.9.0.764: + LexManos: + Updated FML: + MinecraftForge/FML@7ce84491d1d4eada442944e02fc0e50c51f8045c Fix missing argument and startclient/startserver support. + LexManos: Fix domain issue with SoundPool entries. + +Build 1.6.1-8.9.0.763: + LexManos: + Updated FML: + MinecraftForge/FML@155e8468180c93f1886a64028628764b1b22dd58 Add in support for mods/ as a mod location. Also drop coremods as a location. They go in mods too now. + MinecraftForge/FML@3f4bf61ae6757605b27078c7321de9f640876836 Update key + MinecraftForge/FML@4545beb49d5348d8632e42965627b9837115525b Add deobf-data to setup env. + MinecraftForge/FML@e24f94951741709329208f738000b72933302a24 Fix eclipse workspaces and launch configurations. + MinecraftForge/FML@532bee7ce1c4392ee11f0389d98f0c2be6240aa0 Update to new MCP bugfix version, Fixes: Missing Armor/Item rendering, and Boss health mapping issues. + +Build 1.6.1-8.9.0.762: + LexManos: Update dev worksapce: Proper natives location and new server launch profile. + LexManos: TEMPORARY fix for MCP mapping issue. + LexManos: Include MANIFEST file from FML's universal.jar, makes the jar runnable now! + +Build 1.6.1-8.9.0.761: + LexManos: + Updated FML: + MinecraftForge/FML@6f0eedc9a64e4e246c40335e91b4868ad7f5a9e2 Fixed ClassCastException when loading ModLoader mods + MinecraftForge/FML@8844554da6d5d15756d7b0a9da2f5924006b3190 Merge pull request #243 from jrtc27/modclassloader + MinecraftForge/FML@7aa7221756d62ea1fbc750d7cf7acfdb28d75f2e Fix transformer search + MinecraftForge/FML@5f7df5e742cbc21565cee0d25709b5cb5462127c Revert "Keep these on our servers until the launcher is actually fixed -.-" + MinecraftForge/FML@ad79b9ed86eaf8c2702d79505d78a931c1774560 Fix up some deprecation warnings, and clean up coremod code that's going away. + MinecraftForge/FML@ba3707af22376f8f18103f63db56e4614a9c37db More javadoc cleanup + +Build 1.6.1-8.9.0.760: + LexManos: Attempt to gather lastBuild information to fix ChangeLog's off-by-one issue. + +Build 1.6.1-8.9.0.759: + LexManos: Move resource location resolution down to TextureAtlasSprite and allow for sprites that are not stitched. + +Build 1.6.1-8.9.0.758: + Christian: + Start: f1b533ad87ea08d6e62259c59779bcec1636e2fe + End: f21cd286ca8e974b75536224a38cc0dacaca8454 + Updated FML: + MinecraftForge/FML@f21cd286ca8e974b75536224a38cc0dacaca8454 Resource packs, part two. FML mods are now resource packs. Vanilla will scan anything under 'assets' and turn it into a resource prefix. Use resourcelocations to look stuff up. + +Build 1.6.1-8.9.0.757: + LexManos: Update ChestGenHooks for new Dungeon chest strcture. + +Build 1.6.1-8.9.0.756: + LexManos: Make Block.setIconName public + LexManos: Update filler block to prevent useless console warning. + LexManos: Fix resource domain when loading icon. Textures should be located in /assets/{domain}/textures/{block|item}/{name}.png Same strcutre as before except 'assets' instead of 'mods'. + +Build 1.6.1-8.9.0.755: + LexManos: Update ToolMaterial enum helper. + LexManos: Release will now build a installer jar and use the standard 'target' output folder. + LexManos: + Updated FML: + MinecraftForge/FML@29d6c875d0675ffa14428c511bd6ebe9232a486c Add FML Installer logo crated by @ZaverSLO https://twitter.com/ZaverSLO/status/349947190300508162 + MinecraftForge/FML@3d17434510e890574b68c8a181b80c830b5d043a Build installer package for the new client launcher. + MinecraftForge/FML@bf38d947569911dab03319a8b0f1964f36b195b2 Update json samples + MinecraftForge/FML@7037184a4e724300001dfc1f8df2e76a0ec30368 Fix up release JSON + MinecraftForge/FML@dc7d02ebf6c9fc5965344a9aeca79f230a40afb4 Fix json syntax error. + LexManos: + Fix installer unintended replace. + + Updated FML: + MinecraftForge/FML@9b6525e80504ff72a1798cf5797bf148295db776 Point scala downloads to our servers, Launcher doesn't like standard maven repos. + LexManos: + Updated FML: + MinecraftForge/FML@91ecf711092e1610dd10e77cdd517c3324e62d8d Fix -rel json + MinecraftForge/FML@efc369ee83a7b62f605c13e16efad66b63b4bd8c Fix EventHandler annotation. + MinecraftForge/FML@fbd57b32641b540d609314d91fd64350d50b9013 Mods are now loaded as resource packs. Vanilla will scan for valid prefixes based on subdirs of 'ass + ets' which can then be referenced as ResourceLocations with the ":path" notation. + LexManos: + Updated FML: + MinecraftForge/FML@5a97d183dfb13b0f831172a1afef7407347ea7bc Remember to update your patches!!!! + MinecraftForge/FML@f1b533ad87ea08d6e62259c59779bcec1636e2fe Keep these on our servers until the launcher is actually fixed -.- + LexManos: Fix bound texture in Controls screen, Closes #631 and #629 + +Build 1.6.1-8.9.0.751: + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + +Build 1.6.1-8.9.0.750-1.6: + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + +Build 1.6.1-8.9.0.749: + LexManos: Update workspace for new library structure. + LexManos: Update FML to 16launch branch + LexManos: Initial patch update to 1.6, Does not compile, need to update references to the old TexturePack system. + LexManos: Small fixup, need to Update GuiIngameForge for new HUD changes. + LexManos: + Updated FML: + MinecraftForge/FML@6a318ddb784ca8b2bef0f6718089f7beb4d404e0 Fix typo in new packages. + MinecraftForge/FML@3711da9c456d20865a965734cc5aeaf7f5cb5e5d Another typo + MinecraftForge/FML@e35e4b16ff3d6dea547c41f02f2ca31ebe1f74aa More fixups + MinecraftForge/FML@18371bd8c9bd107f774289da35519f593ccc8ee7 Some fixes for updated mcp code + MinecraftForge/FML@ef646d3146e1f285d2cb8e79a74373beffa84774 Merge branch '16launch' + MinecraftForge/FML@7406b38d8ad1bc5c2c641c74f1614b946f246588 1.6.1 + MinecraftForge/FML@12c928c538c1c04d3a21255c747d15468328ace9 Tweak commands patch + MinecraftForge/FML@3f15cd54c2d776ea161aaedbecad9e188d66578f Functional client @ 1.6.1 + MinecraftForge/FML@71a92de5d95fccc4fe17cc39d0836891c6622f4d Client launch for eclipse + LexManos: + Updated FML: + MinecraftForge/FML@8960f6869fbe30d358a40997c47999025c3eae68 Add windows lzma executable http://tukaani.org/xz/ He states that most things are under public domai + n, But I couldn't find an exact reference to this executable. I'm going to assume it under public domain and distribuiting it here is fine. If not someone pleas + e direct me to the apropriate license and I will act accordingly. + MinecraftForge/FML@70cfe24e67adf6872ef1501599e2115e420c2539 Fix wrong project name in distro eclipse launch. + MinecraftForge/FML@7a004087f79b94bc92f29d50eb71288b6c1c968c Add deobf data to src dist. Dont create deobf jar as we ship the lzma Added *.lzma to .gitignore + LexManos: + Updated FML: + MinecraftForge/FML@110cf372eb5aa85df20b248976f1acdefa85e102 Add deobf data to merge-common, workspace is now actually runnable! + LexManos: Support dirty submodules in changelog script. + LexManos: 1.6.1 Update + LexManos: Add new launch configs to dev workspace. + LexManos: Update GuiIngameForge to reflect Mojang changes in 1.6.1 + LexManos: + Updated FML: + MinecraftForge/FML@c418da353f6a8420b095fa737e8b0eae270d31ae Cleanup coremod code, server side working now. + LexManos: Update release script to generate binary patches and include deobf data. + LexManos: Deprecation sweep and update version to 8.9 to reflect 1.6.1 update. + LexManos: MinecraftForge/FML@7fecf2ad6bdd918149a3c43453f6a78bd11e5404 Update mcp URL. + LexManos: Try absolute path, to not confuse jenkins. + +Build 1.6.1-8.9.0.748-1.6: + LexManos: Try absolute path, to not confuse jenkins. + +Build 1.5.2-7.8.1.738: + LexManos: Fic Chest content gneeration delegate call. Cloases #609 + LexManos: Add air check to Flint and Steel Ref: #602 + +Build 1.5.2-7.8.1.737: + LexManos: Bump Forge revision and mark recomended. + +Build 1.5.2-7.8.0.736: + LexManos: Added EntityLiving to Block.isLadder arguments, deperacating older version. New parameter has the possibility of being null, so modders must take care. Closes #608 + LexManos: Add air checks to BlockSand falling and Piston pushing. Please report any other issues with custom 'Air' blocks in issue #602 + +Build 1.5.2-7.8.0.735: + mitchel.pyl: Fix tripwire patches for solid sides + +Build 1.5.2-7.8.0.734: + Christian: + Fix server patch FML update + + Updated FML: + MinecraftForge/FML@22738de028a9ba51d43d73857dfb8969985566f0 Attempt to properly fix deadlock if the internal server derps. It should never hang now. Damn you fast computer.. + MinecraftForge/FML@05a854cd2af53ca822ee8b249b0b3bbe44f94675 Small tweaks to the mcp data. Nothing major.. + +Build 1.5.2-7.8.0.733: + Christian: Make glass panes and iron fences connect to block sides based on solidity. This does change IBlockAccess, so anything with a custom IBlockAccess may need to implement the new method. + +Build 1.5.2-7.8.0.732: + LexManos: Forgot most important side, release script. + +Build 1.5.2-7.8.0.731: + LexManos: Fixed changelog generation. + +Build 1.5.2-7.8.0.730: + LexManos: Fix AIOOB exception in crash reporting if exception does not have a stack. Possible, but odd. + +Build 1.5.2-7.8.0.729: + LexManos: Fix hoes being able to till dirt under other blocks, and made it look for air type blocks. + LexManos: Add NPE protection to refernce to MinecraftServer.worldServer + +Build 1.5.2-7.8.0.728: + LexManos: Fix Air block check in BlockPortal. + +Build 1.5.2-7.8.0.727: + LexManos: + Add NPE protection to ItemStack delegates. Closes #601 + Also cleaned up the names of said delegates, we do not have to follow MCP's crowdsourced names as they are very bad. + Redirected damage through setItemDamage to allow items to have finder control of breaking. + +Build 1.5.2-7.8.0.726: + LexManos: Disable ImageIO's File based cache, should speed up texturepack loading/stitching. + +Build 1.5.2-7.8.0.725: + Christian: + Updated FML: + MinecraftForge/FML@24c405665105a789a0708a7e30c8bcb96899da6b Add in an optional modid identifier for @SidedProxy. It's main use is when both scala and java @Mods reside in the same package, and you want the @SidedProxy behaviour for a specific @Mod language type. In general it should not be needed otherwise. + MinecraftForge/FML@cd0466395a8f1af3ec44f124bf4088df2d318603 Fix sysout with trailing messages after a newline + +Build 1.5.2-7.8.0.724-newliquid: + jeffreykog: RenderGameOverlayEvent.Post(ALL) is now called in GuiIngameForge + LexManos: Fix arbitrary GUIContainer text coloring by forcing lighting to be disabled. Closes #594 + Christian: Patch village distance checking to use floats instead of ints, to avoid int wrapping + Christian: Fix isAir check to see if a portal can light. Should fix w/Railcraft and others + LexManos: Make changelog generation non-fatal untill we get jenkins issue figured out. + LexManos: Add cache for ASM Event Handler bridge classes, should not need to redefine a class to invoke the same method on different instances. + LexManos: Ignore registration of a object that is already registered. Preventing duplicate callback invocations. Thanks King_Lemming for pointing this out. + Christian: + Updated FML: + MinecraftForge/FML@6f3da9736531153629fb4213e3b2cae776bfb50a Don't throw an exception if the scala adapter find a java proxy. I may add some distinguishers to @SidedProxy so you know which mod it's for. + MinecraftForge/FML@59fe905695421a5be9370b0009ef794abaaf75bb Don't continue trying to send events to mods that depend on errored mods. + +Build 1.5.2-7.8.0.723: + Christian: + Updated FML: + MinecraftForge/FML@6f3da9736531153629fb4213e3b2cae776bfb50a Don't throw an exception if the scala adapter find a java proxy. I may add some distinguishers to @SidedProxy so you know which mod it's for. + MinecraftForge/FML@59fe905695421a5be9370b0009ef794abaaf75bb Don't continue trying to send events to mods that depend on errored mods. + +Build 1.5.2-7.8.0.722: + jeffreykog: RenderGameOverlayEvent.Post(ALL) is now called in GuiIngameForge + +Build 1.5.2-7.8.0.721: + LexManos: Ignore registration of a object that is already registered. Preventing duplicate callback invocations. Thanks King_Lemming for pointing this out. + +Build 1.5.2-7.8.0.720: + LexManos: Add cache for ASM Event Handler bridge classes, should not need to redefine a class to invoke the same method on different instances. + +Build 1.5.2-7.8.0.719: + Christian: Fix isAir check to see if a portal can light. Should fix w/Railcraft and others + LexManos: Make changelog generation non-fatal untill we get jenkins issue figured out. + +Build 1.5.2-7.8.0.716: + Christian: Patch village distance checking to use floats instead of ints, to avoid int wrapping + +Build 1.5.2-7.8.0.715: + LexManos: Fix arbitrary GUIContainer text coloring by forcing lighting to be disabled. Closes #594 + +Build 1.5.2-7.8.0.713: + Christian: + Updated FML: + MinecraftForge/FML@843a13c1ab1e3901160082fa63c557243fb64675 Try and clean up cycle detection output a bit + MinecraftForge/FML@82e9de8641c6a559eec711ea6d1e940d99cbc98f More tweaks to the mod sorting code + MinecraftForge/FML@ac97370f94d10beee5f021795cddda827c4411d4 Add in a pretty sorting error screen + MinecraftForge/FML@f1d68ed4c82cd28e50ec6a0befc55ff0165bfe08 Throw the sorting exception + MinecraftForge/FML@edc1fb24e2cad9badd2dd18ccccd590d77156e18 Send the "suspect list", and print the suspect versions + +Build 1.5.2-7.8.0.711: + bloodshot: + Add support for servers to register dimensions on client. + + In order to support multi-worlds such as MultiVerse, the server needs the + ability to register dimensions on client or many forge mods such as IC2 + will not function correctly. This has been an issue for MCPC which + provides both Forge and Bukkit support to players. By adding the + DimensionRegisterPacket class, MCPC now has the ability to send the + required packet to client to register a dimension with DimensionManager. + LexManos: Cleanup Dimension Registration packet, generate takes no arguments, and added fix to world to prevent providers from overwriting the dimension ID. + LexManos: Fix potential GL issue when atlas animations bind textures without informating RenderEngine. + +Build 1.5.2-7.8.0.710: + LexManos: + Introduced the framework for Forge's packet handler system. Heavily based off FMLPacket. + Packet splitting and reconstruction is handled. + +Build 1.5.2-7.8.0.708: + Christian: + Updated FML: + MinecraftForge/FML@3bf50c4bbe82f0cc317dafcf2a569cb5210bc738 Fix server side derp with Forge network packet handler + +Build 1.5.2-7.8.0.707: + LexManos: Fix type in biome list. + LexManos: Fixed creative tab rendering with invalid color closes #588 + +Build 1.5.2-7.8.0.706: + Christian: + Add forge network handling support + + Updated FML: + MinecraftForge/FML@4922e90d81d8b8b9374c4d04858a06c5bf03965c Separate network mod config from setup. Allows for Forge Packet Handler nicety + +Build 1.5.2-7.8.0.705: + mehvids: Add hitInfo field to MovingObjectPosition for when an int doesn't suffice + +Build 1.5.2-7.8.0.704: + LexManos: Fix another NPE when Items are in Block range with custom renderers, Modders keep your items out of the block range! Closes #581 + LexManos: Fixed render count for stacks of blocks 40+ and distrabution of items based on scale. Closes #579 + +Build 1.5.2-7.8.0.703: + Christian: Remember x & z passed to getTopSolidOrLiquidBlock and use it for foliage tests. Fixes #575 + +Build 1.5.2-7.8.0.702: + Christian: Fix blending on the hotbar. Closes #574 + +Build 1.5.2-7.8.0.701: + Christian: + Updated FML: + MinecraftForge/FML@23b070c7d02a8da44bf04c2f9ba2b485a44ad967 Alternative @SidedProxy setter for Scala. + MinecraftForge/FML@2cca7aa759b4b6c3a128ce43bbd924e4762c43c2 Some more Scala @SidedProxy adjustments. Now properly supporting pure singletons, i.e. object C { @SidedProxy(...) var proxy: P = null } Removed fallback, as all such singletons are properly handled by the new code now, and class implementations fall back to the code also used for plain Java mods. + MinecraftForge/FML@8517a824e5251c409e05999d42fc6d70497609f5 Merge declaration and initialization of a variable. + MinecraftForge/FML@a3a920437f3ede6841ae2c449a38975b02b28088 Merge pull request #230 from fnuecke/master + Christian: Add in a very simple stencil bit registry to try and arbitrate between mods wanting to use stencil bits in rendering + +Build 1.5.2-7.8.0.700: + hbiede: + Added oreQuartz + + Gives a default quartz Ore Dictionary (I know of at least 3 used by different mods that use Nether Quartz as an equivalent). + gholdampf: updated FurnaceRecipes.java.patch + mike.stengel: Created an ItemStack sensitive version of canHarvestBlock. + +Build 1.5.2-7.8.0.699: + CovertJaguar: + Possible NPE if the liquid isn't in the LD + + https://github.com/BuildCraft/BuildCraft/issues/787 + +Build 1.5.2-7.8.0.698: + LexManos: Fix NPE when rendering EntityItems that are not blocks but int he block range. + +Build 1.5.2-7.8.0.697: + LexManos: Prevent water from dropping snowballs. + +Build 1.5.2-7.8.0.696: + LexManos: Fire EntityJoinWorled event for forced entities {Players and there mounts} as well, just ignore the cancelled value. + +Build 1.5.2-7.8.0.695: + LexManos: + MinecraftForge/FML@787c0c4a6af3af60928b3a90f383a305a17a4347 Don't spit error on LWJGL not supporting 4.3 just warning. + Make custom item renderers attempt to use EQUIPPED type when running first person. For backwards compatiblity, will be removed in 1.6. + And a small change to make the 1.6 check not print it's stack trace. + +Build 1.5.2-7.8.0.693: + purpleposeidon: Fix render bounding box of trapped double chests + jholcroft: + Make getStencilBits static + + Made getStencilBits static so it can be called. + +Build 1.5.2-7.8.0.692: + LexManos: Move Partical rendering down in the order, after everything else. Should fix particals rendering behind water, digging process, and selection. + +Build 1.5.2-7.8.0.691: + LexManos: Fixed NPE in rendering dragged items. + +Build 1.5.2-7.8.0.690: + LexManos: + Attempt to allocate a 8-bit stencil buffer when creating Minecraft's display context. If that throws an error it will revert back to it's default values. + Also contains a method for modders to rereive how many bits the context was created with. Closes #552 + +Build 1.5.2-7.8.0.689: + LexManos: EntityPlayer sensitive version of Item.isValidArmor, deprecated older version. Closes #551 + LexManos: Changed to just plane entity for flexability. + LexManos: New RenderPlayer and RenderLiving events. Closes #493 + +Build 1.5.2-7.8.0.688: + pahimar: Update forge_at.cfg + +Build 1.5.2-7.8.0.687: + mitchpetrie29: Separate EQUIPPED and EQUIPPED_FIRST_PERSON Item Render Types + +Build 1.5.2-7.8.0.686: + LexManos: Capture and fire the PlaySoundAtEntity event for The client entity. Minecraft does some odd bypasses for no good reason. Thanks iPixile for reporting this. + +Build 1.5.2-7.8.0.685: + LexManos: + Updated FML: + MinecraftForge/FML@99bb50d8f8d27217ba58a41c802a504213e99461 Improved Entity Spawn Error + MinecraftForge/FML@c0cca7f41d5b080e39dd8d3d6cfc329295c822e6 Merge pull request #227 from CovertJaguar/patch-1 + MinecraftForge/FML@49111e9c5cffab49ec35f965801c3f0496f6def6 Add version detection to astyle and print error if it doesnt detect version 2.0+ + Also fixed astyle's config for max-instatement-indent that sometimes caused crashes with certian versions of astyle. + +Build 1.5.2-7.8.0.684: + LexManos: + Update to 1.5.2 PR. + MinecraftForge/FML@f0bba74a4748935ef3a715ae2f45feb75cc20376 Update for minecraft 1.5.2 + MinecraftForge/FML@62fdbad74c2507d147ecab56f56029135d88c6f5 Update MCP's md5 for the fixed srg files. + LexManos: + Updated FML: + MinecraftForge/FML@00f00b17bf0da262e6fe3e327ca2deedf7146305 Fix scalac detection to actually use the located command instead of defaulting to 'scalac' + LexManos: Fixed hardcoding of MC version in debug text. + LexManos: Bump version number for 1.5.2 + +Build 1.5.2-7.8.0.683-1.5.2: + LexManos: Bump version number for 1.5.2 + +Build 1.5.1-7.7.2.682: + cadyyan: Fixed build error handling using invalid Python syntax. + +Build 1.5.2-7.7.1.681-1.5.2: + LexManos: Fixed hardcoding of MC version in debug text. + +Build 1.5.2-7.7.1.680-1.5.2: + LexManos: + Updated FML: + MinecraftForge/FML@00f00b17bf0da262e6fe3e327ca2deedf7146305 Fix scalac detection to actually use the located command instead of defaulting to 'scalac' + +Build 1.5.1-7.7.2.679: + LexManos: Changelog generator will now bundle failed builds with the next successful build. Should make it look better and prevent the version numbers from being confusing. + +Build 1.5.1-7.7.2.678: + LexManos: Bump version to 7.7.2 so I can make a release. + +Build 1.5.1-7.7.1.676: + tobias: Fixed ListenerListInst not being rebuild after unregistering a listener, causing calls to unregistered event listeners. + tobias: Replaced derpy tabs with spaces + +Build 1.5.1-7.7.1.675: + kinglemming: + -Add vanilla Ores to the Ore Dictionary. No recipe replacement required. + -Add NBT-sensitive getMaxDamage() for ItemStack. + + Signed-off-by: King Lemming + +Build 1.5.1-7.7.1.674: + LexManos: Attempted a fix for the changelog generation, should print all builds back to 1 now. + +Build 1.5.1-7.7.1.673: + Christian: + Updated FML: + MinecraftForge/FML@cf9b5b445ba284d389c7e32a03d9c8ef43469042 Don't leave scala running in interactive mode. + +Build 1.5.1-7.7.1.672: + Christian: + Updated FML: + MinecraftForge/FML@cfda7fc738ce6079f625a3822ebff5e7e0db5669 Fix URL for MCP + MinecraftForge/FML@781c68121626321e0efddaf4c4db9f1b8b5911db Some fixups for scala compilation in MCP. Scala should now be compilable and reobfuscatable with srgnames in MCP. + Christian: Try and be less noisy about world leaks + Christian: ItemStack delegation to Item for damage values. + LexManos: Fix rotation issue with non-block items. + Christian: + Updated FML: + MinecraftForge/FML@ddadf93ca1d648d88fdb61c9625cd675c3650ccd Fix when an old scalac is present on the system to not fail the build + Christian: + Updated FML: + MinecraftForge/FML@aa200923f0fe0c548faa4f103d803ade2e49d19d Fix patch derp. + +Build 1.5.1-7.7.1.667: + Christian: + Updated FML: + MinecraftForge/FML@dcf069ca52738a7bb7bde01f1c7ebd2e06cd0ac6 Attempt to reduce lines on the screen for id mismatch. Hopefully prevents game crashes. + MinecraftForge/FML@58ba24add2a96bf4c079d5919f2d90dcc2f380e4 Fix possible NPEs in GameData + +Build 1.5.1-7.7.1.666: + Christian: + Updated FML: + MinecraftForge/FML@a3b5eaacfdd9218ef68d3dc064bba729b797cb3d Fix a small modloader compatibility derp: closes #222 + MinecraftForge/FML@677a6e578e84109702365da4a784f9a57d8c9957 Fix scala supporting SidedProxy. It should work now. + MinecraftForge/FML@334a76de75f2b417f04c23526c7e66ceb48e0de2 Update FMLDeobfuscatingRemapper.java + MinecraftForge/FML@42f1d8795599e0d1a516a1fdd7488a09b77e4565 Merge pull request #224 from Glought/master + MinecraftForge/FML@2dcabe01232b48009acbca6724565598761f561b Add a to string to fmlmodcontainer: should mean less derpy cyclic dependency data + MinecraftForge/FML@11ac46daebe901a6012a09ba5f6fe44af5b1be06 Fixing the GameRegistry. Now it is possible to register a Block with a BlockItem using following code: MyBlock myBlock = new MyBlock(); GameRegistry.registerBlock(myBlock, MyBlockItem.class, "myBlock"); where MyBlockItem class has one constructor with signature: public MyBlockItem(int id, Block block) + MinecraftForge/FML@c3fda11d100f9db7c32ef212ac37eade3e35d701 Merge pull request #225 from MarcinSc/master + Christian: Add forge/FML data to the f3 screen. + +Build 1.5.1-7.7.1.665: + LexManos: + Forge now takes control of GuiIngame's renderGameOverlay, and spits out a ton of events to give modders control of how the screen is rendered. + Inital draft for community feedback. + +Build 1.5.1-7.7.1.664: + LexManos: Allow spawning of Bonemeal particles even if block is not set. + +Build 1.5.1-7.7.1.663: + LexManos: Fix the BLOCK_3D render helper for items that aren't an instance of ItemBlock Closes #533 + LexManos: Fix replaceable checks to work on blocks with a non-replacable material, Closes #532 + LexManos: Restore world unload event for client worlds Closes #531 + +Build 1.5.1-7.7.1.662: + LexManos: Fix logic issue in CrashReportCategory patch, blame Jadedcat for sloppy quick patch. + +Build 1.5.1-7.7.1.661: + lhb: + Fix for ClassCastException when attempting to fetch Biome types from BiomeDictionary + + Attempting to fetch the BiomeDictionary types linked to a biome throws a ClassCastException. This fixes that + lhb: getBiomesForType will cause the same problem + +Build 1.5.1-7.7.1.660: + Christian: + Updated FML: + MinecraftForge/FML@b3d4ea05ec633fb1898e97febf786f1a3e420986 Fix possible NPE in findItemStack, closes #218 + Christian: + Simple block recolouring API: closes #525 + Fix up documentation on "rotation" API: it is up to the mod to decide interpretation of "rotation" for the mod/block. + +Build 1.5.1-7.7.1.659: + LexManos: Fix return value of EnchantPower hook, closes #518 + LexManos: Adds a field to the player for maximum health. Player.dat additions are present, getMaxHealth() needs a magic number for spawning. Closes #527 + +Build 1.5.1-7.7.1.657: + LexManos: New hook to allow Items to render Helmet overlays like pumpkins do. + +Build 1.5.1-7.7.1.656: + Christian: + Updated FML: + MinecraftForge/FML@394f424185a044afcd6b31f400e731478171dd18 Fix to output versions in crash logs + MinecraftForge/FML@8f35adca7a41c280a4b63d4787f042f615966cac Use more expressive language when a version specifier is a simple unbounded above condition + +Build 1.5.1-7.7.1.655: + Christian: + Updated FML: + MinecraftForge/FML@5673c1dd2966536000c2b3f17f85131204c4a291 Add srgname to registerTileEntityWithAlternatives + MinecraftForge/FML@7aea09f4ca2f087d59ff6cb0de1c8e3e8b9ea4df Add type info to properly deobfuscate overloaded fields. Fixes #210. + MinecraftForge/FML@edffd04ed2e89ece75189f76b92ae47643ec92f8 Add in some caching of the read field descriptions for efficiency + MinecraftForge/FML@0daf1a6df4203d97be65a76a46550f6ad22ccc79 Merge branch 'agaricusb-fix-deobf-field' + MinecraftForge/FML@ada52078c75fdfa506a4287c112d01d9af961d5a Merge pull request #216 from agaricusb/add-srgname + +Build 1.5.1-7.7.1.654: + jmacwilliams: fixed a bug that prevented proper lava generation near bedrock + +Build 1.5.1-7.7.1.653: + LexManos: Fix AIOOB in crash report stack trimming. + +Build 1.5.1-7.7.1.652: + pahimar: Fix a derp in that we provision the various arrays for a face, even if we are not going to parse data into it. Solves NPEs for when obj models that don't have texture coordinates attempt to render. + pahimar: Missed a bit + +Build 1.5.1-7.7.1.651: + LexManos: Cave and Ravine gen will now take into account the Biomes top and foller block, allowing them to break the surface in modded biomes. Beaches, MushroomIslands and Deserts are exempt from this check to preserve vanilla world gen functionality. Closes #491 + +Build 1.5.1-7.7.1.650: + Christian: Fix offset in AdvancedModelLoader. *doh* + +Build 1.5.1-7.7.1.649: + LexManos: Added NBT data to liquid stacks. Closes #501 + LexManos: Added a small method in the Block.java to specify the amount of enchanting power it can supply to an enchanting table. Closes #508 + +Build 1.5.1-7.7.1.648: + LexManos: Item callback for EntityItem update tick. Closes #426 + LexManos: Add Item 'swing' callback for use when playing the arm swing animation. Closes #505 + +Build 1.5.1-7.7.1.647: + Christian: Delete sneaky extra file + +Build 1.5.1-7.7.1.645: + LexManos: Re-add and mark deprecated the old signature for ForgeHooksClient.getArmorTexture. + +Build 1.5.1-7.7.1.644: + Christian: + Deprecate preloadTexture, make it a no-op. Should stop derpiness with new + texturing system performance tweaks. + +Build 1.5.1-7.7.1.643: + LexManos: + Updated FML: MinecraftForge/FML@4836b3272a9b292c62816c1d1f9e845486753839 Re-worked the Texture patches, optifine helper function, and re-added support fo + r dynamically rotating the texture for mod authors who do things horribly wrong. + +Build 1.5.1-7.7.1.642: + Christian: + Fix performance of texture uploads + + Updated FML: + MinecraftForge/FML@00c788308881a07a683e17e2e9382313f3719b45 Very significant improvement in performance by using glSubImage to upload data. Inspired by frequent complaints about performance of hires texture packs. They probably still need a beefy system but should work. Hopefully I can figure out why the subImage GL side copy isn't working properly for an even more significant speed boost. But this gets things started. + MinecraftForge/FML@57ad221cc6d9605b9d521f86620c2a31f922ac24 And add the patches *sigh* + Christian: + Updated FML: + MinecraftForge/FML@a31607ae7d0214101679a1ecf1ae8032a5257eda Fix compilation derp, and clean up rotation helper. + +Build 1.5.1-7.7.1.640: + LexManos: Small optimization for usages of Minecraft.getGLMaximumTextureSize(), only need to calculate it once. + LexManos: Small bugfix in Stitcher that was preventing ti from fully filling the possible texture space. Should lower the amount of empty space in textures. + LexManos: + Optimize Texture loops a bit for non-rotated textures. Should help the FPS loss on higher resolution texture packs. If it becomes a major issue we may have to look into a more optimized animation system. + + https://mojang.atlassian.net/browse/MC-13206 + +Build 1.5.1-7.7.1.639: + LexManos: Fix scoreboard saving bug caused by our fix of vanilla map saves. + +Build 1.5.1-7.7.1.638: + LexManos: Updated FML: MinecraftForge/FML@1de89525cc2265bdce8704d9bd0d31c57bca4d97 Fixed issue with instalation when java/javac commands had quotes. + LexManos: Deprecate long dead interface that moved to FML. remvoe next MC version. + +Build 1.5.1-7.7.1.637: + LexManos: Updated FML: MinecraftForge/FML@704a70902fca3de620375116a33dccd3d6d576d0 Sanitize input to isRemappedClass to use '/' as a package seperator like the srg files. + +Build 1.5.1-7.7.1.636: + froggytheturtle: + This allows the result of the explosion to take into account metadata, + tile entities, or even to cancel it altogether. + + Allowed block exploding to take into account tile entity and metadata + LexManos: New hook to allow Items to provide there own armor models. Closes #487 + +Build 1.5.1-7.7.1.635: + LexManos: Fix item deletion in creative menu for items that are the same id/meta but differnet NBT's. Closes #479 + LexManos: Untag NBTTagList.removeTag as client side only, allowing simple removal ont he server side. Closes #477 + +Build 1.5.1-7.7.1.634: + LexManos: Allow items to provide there own FontRenderer for there tooltips. Added for #463 + +Build 1.5.1-7.7.1.633: + ProjectZulu: Added maxCanSpawnInChunk event to allow overriding of creature chunk spawn cap + ProjectZulu: Clarify Factory call and Event Functionality + LexManos: Add function to remove categories from a configuration, indavidual properties can be removed using ConfigCategory.remove() Closes #462 + +Build 1.5.1-7.7.1.632: + LexManos: + Pulled Biome Tag System by Emasher, Closes #433 + An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed. + + A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it. + + Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit. + +Build 1.5.1-7.7.1.631: + LexManos: Deprecate IArmorTextureProvider, moved to Item. And exposed more information to the function. Closes #365 + +Build 1.5.1-7.7.1.630: + LexManos: Updated FML: MinecraftForge/FML@570faeb790745c35403c67fabab57651b71da576 Added the ability to save transformed classes to disc for debugging. + LexManos: Add checking for 'ENUM$VALUES' in EnumHelper. Eclipse uses it's own internal compiler which does not follow the java standard of making the values field names $VALUES and private. Instead its public and ENUM$VALUES. Closes #502 + +Build 1.5.1-7.7.1.629: + LexManos: Revert MinecraftForge/MinecraftForge@f594109b30c87f5a0996eee9e8c4513380733cee If concurancy issues arise we will reassess. The provided solution caused entities to be removed incorrectly and cause 'invisible' entities client side. + +Build 1.5.1-7.7.1.628: + LexManos: Fix EntityPlayer passed to Bonemeal event. + +Build 1.5.1-7.7.1.627: + LexManos: Fix off-by-one in rotated textures. + LexManos: Removed index bounds checking in some chunk functions, if you error blame Grum. + +Build 1.5.1-7.7.1.625: + LexManos: Fix vanilla texture bug causing rotated textures to be placed wrong. + +Build 1.5.1-7.7.1.624: + Christian: + Updated FML: + MinecraftForge/FML@8b8837c9ff635d4988e0a1504fca38667825daf0 Fix NPE when branding isn't present + +Build 1.5.1-7.7.1.623: + kraphteu: Remove unneeded SideOnly. ref: Buildcraft/Buildcraft#710 + +Build 1.5.1-7.7.1.622: + Christian: + Removed obsolete patches + Updated FML: + MinecraftForge/FML@26ccb9106e443e664b0fdc1b95c3600b90ab2bc5 Change snooper/crash report brand handling. fmlbranding now loads another string! + MinecraftForge/FML@eff464cf0e656d92dfedf16e79e5cd6c36b9fc76 And the core patches for that + +Build 1.5.1-7.7.1.621: + Christian: Sanity check the item ID for loaded liquid stacks better. + +Build 1.5.1-7.7.1.620: + Christian: Make liquidstacks immutable in their type data. Sorry about this, but it makes things a lot easier. + Christian: Add in persistence code for LiquidTank. Using it should protect against liquids that get removed f.e. Closes #395 + +Build 1.5.1-7.7.1.618: + Christian: Fix up liquidstack so it knows about the texture sheet for it's icon + +Build 1.5.1-7.7.1.617: + Christian: Fix AT file + +Build 1.5.1-7.7.1.616: + Christian: Fix possible NPE in ChunkManager. Closes #478 in reality + +Build 1.5.1-7.7.1.615: + Christian: made BlockFluid.theIcon protected + Christian: fix bug #489 from #429 + Christian: Fix up some liquid logic + +Build 1.5.1-7.7.1.614: + Christian: + Updated FML: + MinecraftForge/FML@2bc6a0666f8a54f6b1fbc3398c6e3a385ecd35b5 Attempt to make any "default package" class public. This might fix problems with certain modloader mods that ship changes to vanilla classes. + Christian: Use the liquid name in liquid stack persistence. Closes #429 + Christian: Fix hashCode + Christian: + Updated FML: + MinecraftForge/FML@0d844874124649099dbcbb9ae2b36719e1dda25f Fix up derp in access transformer + +Build 1.5.1-7.7.1.611: + LexManos: Bump version number for 1.5.1 Note: We really need to do this more... + +Build 1.5.1-7.7.0.610: + LexManos: Fix NPEs when modders stupidly register null texture names. + +Build 1.5.1-7.7.0.609: + LexManos: Fixed issue with Event.hasAnnotation ignoring it's parameter. And cached its values for potential performance gain. Closes #482 + +Build 1.5.1-7.7.0.608: + jesse: + Entity Extended Properties Changes + + Adds IExtendedEntityProperties interface, which specifies three methods + that are needed: Init, Save, and Load. + + Adds the EntityConstructing event, which is called during the + constructor of Entity. It is needed there so that the reference is in + place during the ReadNBT call. + + Adds hooks into Entity that allow registration of + IExtendedEntityProperties classes, as well as saving and loading to NBT. + jesse: + Brewing Stand Changes + + Added an event on potion ingredient applied. Event contains the item + stacks of each of the potions being brewed as well as any remaining + ingredients. + + Changed TileEntityBrewingStand and SlotBrewingStandPotion to look for + instanceof ItemPotion rather than potion.itemID + jesse: + Player Flyable Fall Event + + Adds an event to EntityPlayer that is posted on player fall when the + player has flight capabilities. + Christian: Fix itemframe render bug + Christian: Add in block rotation support. It supports most vanilla blocks (hopefully), logs should be added soon. + jesse: + Access Transformer Changes + + AT changes and corresponding class changes. + Additions (all made public): + EntityLiving.targetTasks + PotionHelper.potionRequirements + PotionHelper.potionAmplifiers + PotionEffect.duration + Potion.setIconIndex + Item.setPotionEffect + Block.blockHardness + Block.blockResistance + jesse: + Enderman Teleport Event + + New event when an enderman teleports that allows the teleport location + to either be modified or completely cancelled. + jesse: + Enderman attackEntityFrom changed + + Changed so that if the teleport fails upon being attacked, Endermen will + take damage as normal. + jesse: + Ender Teleport Changes + + Renamed Ender Teleport Event and added it in to ender pearls. + jesse: + quick bugfix in entityenderman + + reversed boolean check on event result + Christian: + Updated FML: + MinecraftForge/FML@2d368c4c2eb6b4e0bb60757b6e1679c23aaad9db Itemstacks in the GameRegistry (manual registration by mods) + Christian: + Updated FML: + MinecraftForge/FML@5e1949eb0e3a43d3ec6c710289532d93f6819934 Clone the itemstack, and allow for passing in a stacksize + Christian: + Updated FML: + MinecraftForge/FML@ede93d438f2b5fab92cd6a459247ca158354e430 Validate supplied stack size + MinecraftForge/FML@d73ac867df775174dafdd2da193fabd7c3e7407e Add a mechanism to dump the registry- useful for mod developers. + Christian: + Updated FML: + MinecraftForge/FML@82bc9f1b35f5d51a722d294dd252e6bab4d54fa4 Add some information, and a log message letting you know it worked + Christian: Update patches! + Christian: Re-enable changelog? Hopefully... + Christian: Changelog fixup + Christian: Damn you python and your tab obsession! + +Build 1.5.1-7.7.0.605: + Christian: Fix AT config for texturemap + +Build 1.5.1-7.7.0.604: + Christian: + Allow itemstack sensitive damage computation for attacks. Should allow + storing data in the nbt :) + +Build 1.5.1-7.7.0.603: + Christian: + Updated FML: + MinecraftForge/FML@d9db27275ea06d37ae75e201140019ca152314b0 Fix mismatch screen a bit. Should render more correctly now and at least not be blank in a lot of circumstances.. + Christian: Allow items to decide if they can or cannot have book enchantments applied + +Build 1.5.1-7.7.0.602: + Christian: + Updated FML: + MinecraftForge/FML@d1ff1967b50f2ff2edf0b60acdb6508c0a3eeb06 Fixed FMLRelaunchLog's Newline Handling + MinecraftForge/FML@591a25722b36d2d1b200a31278cb8da117363f6b Merge pull request #208 from jrtc27/patch-1 + +Build 1.5.1-7.7.0.601: + Christian: + Updated FML: + MinecraftForge/FML@f709ce757984b13acb7208d6d8fbdeaa83d2928d Fix missing block world rendering + MinecraftForge/FML@748eece456e079a21112a77047d004d4f410b170 Merge pull request #206 from mDiyo/patch-1 + MinecraftForge/FML@012a755bb9ce9737c843b0dfd86473d143b637be Fix up patch properly. Also, fix md5s for the jars. + +Build 1.5.1-7.7.0.600: + LexManos: + Update to 1.5.1 Pre-Release: + MinecraftForge/FML@9565529baf77de27ed8b75be2065da3ba08d16c8 Updated to latest MCP and Minecraft 1.5.1 Pre-release. + MinecraftForge/FML@a573faf92def5dd01af380b3ca86de877c1178a2 Someone derped up this function bad, revert name. + LexManos: MinecraftForge/FML@aaf02ea2ac938d8cbaafdd2f59985c0604d648d7 Updated for new PR client jar. + +Build 1.5-7.7.0.598: + LexManos: + Updated FML: + MinecraftForge/FML@3c346247e1c5de12d4548f6a99349157057e2de6 Fix NPE with CoreMods who do not have the new MCVersion annotation. + LexManos: + Updated FML: + MinecraftForge/FML@625da6492dddcaca8133718aeee97f9981ced623 Fix install.py --mcp-dir option. Fixes #204. + MinecraftForge/FML@687d3c059d054c338c25a489be206a9f3dc63d81 Merge pull request #204 from agaricusb/fix-mcpdir + +Build 1.5.1-7.7.0.597-1.5.1: + LexManos: MinecraftForge/FML@aaf02ea2ac938d8cbaafdd2f59985c0604d648d7 Updated for new PR client jar. + +Build 1.5-7.7.0.595: + LexManos: Change placement of ChunkDataEvent.Save call to apply before sending to worker thread. + +Build 1.5-7.7.0.594: + Christian: + Updated FML: + MinecraftForge/FML@5cc90f060caace93c0bf041d3cc37208f425f623 Fix the logger to treat newlines better, hopefully. Closes #199 + MinecraftForge/FML@5e3af8ac0e18cfa3a92f9ba726ec1a6b55e87d97 Use the relaunch log, for class circularity safety. + MinecraftForge/FML@ce949e6099fe2a63ee6774acd6e55aa55d3b3673 Support simple mc version test in coremods, only effective through jar loading. Also, log some more data about the environment. + +Build 1.5-7.7.0.593: + LexManos: + New TextureStitchEvents called before and after a TextureMap gathers and stitches textures together. + Also added a config option to diable the writing of resulting stitched textures to disc. Default disables the writing. + +Build 1.5-7.7.0.592: + LexManos: + Updated FML: + MinecraftForge/FML@24022ab6ba79e4babb57fc0db893c23d4aec85bc Added comments to note FML-only methods + MinecraftForge/FML@8905237306230a33e2a3bab7a2b6f7a8b42d94e4 Merge pull request #200 from bspkrs/patch-2 + MinecraftForge/FML@577b19c1cf12a354112e829fb5704c32fd6cd0a5 Fix potential NPE in class loading and add extra debug information. + +Build 1.5-7.7.0.591: + LexManos: Fix placing of certian items on Redstone Blocks. + +Build 1.5-7.7.0.590: + LexManos: Fix equipment slots for items when right clicked, and dispensed using a dispensor. + +Build 1.5-7.7.0.589: + LexManos: Prevent pistons from generating snowballs. + LexManos: Fix logic inversion that allowed SnowMen to create snow on hoppers. + +Build 1.5-7.7.0.588: + lepko.san: Fix ShapedOreRecipe checking mirrored recipes + +Build 1.5-7.7.0.587: + Christian: Fix multipass item rendering so that it uses the right spritesheet for the item. + +Build 1.5-7.7.0.586: + froggytheturtle: + Made WorldServer.allPlayersSleeping public + + Made EntityPlayer.sleepTimer public + + Sleep changes + +Build 1.5-7.7.0.585: + LexManos: Fix Activator rails activating TNT carts, closes #458 + +Build 1.5-7.7.0.584: + github: Update ForgeDummyContainer.java + +Build 1.5-7.7.0.583: + Christian: + Updated FML: + MinecraftForge/FML@c5d5f4e5164111c5ae63e8de7ce97cc583d73e6e Fix AllPublic access transformer not affecting methods. Should fix modloader compatibility + +Build 1.5-7.7.0.582: + LexManos: + Updated FML: + MinecraftForge/FML@4762d4d8ef00bd789ffb6bccbd12f7478b07da62 Allocate more ram {typically 256 is defailt} to fermflower, should fix decomplication issues on OSX + MinecraftForge/FML@6370c242f0e1cb8ec80c7dccc1133cb0d0607bae OS X's python 2.6.1 has a bug in zipfile.extractall that makes it unzip directories as regular files. So switch to extract + +Build 1.5-7.7.0.581: + LexManos: Remove the block if TE errors. + +Build 1.5-7.7.0.580: + LexManos: Add config toggle to atempt to remove TileEntities and Entities that error during there update without fully crashing the server, use at your own risk. Closes #424 + +Build 1.5-7.7.0.579: + Christian: + Updated FML: + MinecraftForge/FML@8f2dbf7046f52d836993edb946d7d310b399bf9d Fix up stupid derp in IMC code: actually reset the IMC list after each delivery. Fixes a bunch of mods. Sorry everyone. + +Build 1.5-7.7.0.578: + ohai.iChun: + [Bugfix] One should not assume an item would use the item spritesheet. + + Item class has a func to return an int to use terrain.png or items.png. This makes forge take account of it. + +Build 1.5-7.7.0.577: + LexManos: Fix bug with rendering one too many passes for ItemEntities Closes #450 + LexManos: Fix RedstoneBlock power issues, Closes #452 + LexManos: Fix for nether quartz not generating in the nether, Closes #454 + +Build 1.5-7.7.0.576: + LexManos: Deprecation Sweep in DungeonHooks and fixed wildcard in ChestGenHooks remove function. + +Build 1.5-7.7.0.575: + LexManos: Fix RenderItem to work with items that use the terrain texture map that aren't in the block ID range. Close #443 + LexManos: Move the RenderWorldLastEvent back to before renderHand like it was in 1.4 Closes #444 + LexManos: Add call to EntityLiving when counting entities for Spawning Cap. Closes #447 + LexManos: Fix missed wildcard change in OreDictionary closes #448 + +Build 1.5-7.7.0.574: + LexManos: Fix crash when EnumHelper can't find $VALUES field, log info, and return gracefully. + +Build 1.5-7.7.0.573: + Christian: + Updated FML: + MinecraftForge/FML@23ea835fa7bc0cdb466d058814b5a0e0c67e8c9a Pass obfuscation status to coremods + +Build 1.5-7.7.0.572: + Christian: Some tweaks to the liquid dictionary, to allow for canonical liquid stacks for things like rendering + Christian: + Updated FML: + MinecraftForge/FML@d88db6c0cfd5484428b574889eae02d34535beae Fix up deep tree deobfuscation + +Build 1.5-7.7.0.571: + LexManos: Removed get/setTextureFile from Block, nolonger used. + LexManos: + Updated FML: + MinecraftForge/FML@7b722bfcd6d4c6867d15492c293a455dfd50d272 Update MCP for latest PR silent update. + MinecraftForge/FML@c6dab815f4e036e25b8f56bef7b8ee63f838adb4 Missed joined.exc, must fix scripts. + +Build 1.5-7.7.0.569: + LexManos: + Updated FML: + MinecraftForge/FML@a90504315e928915345c7b04972d912cdaa0bfdb Readjust size of mods button when Minecraft Realms button is enabled. + +Build 1.5-7.7.0.568: + Christian: Fix the oredictionary for the new recipe wildcard value of Short.MAX_VALUE. + +Build 1.5-7.7.0.567: + Christian: + Updated FML: + MinecraftForge/FML@3765ceb02d783ae5156976f3165bafdb6a3ddbb3 Update MCP, fixes the "broken texture packs" problem. + +Build 1.5-7.7.0.566: + Christian: + Updated FML: + MinecraftForge/FML@179c504746910d4196eef3ee2d56f63cf585c983 Simplify logic in tick start/end + MinecraftForge/FML@29edd242cd7a1fadedf4fb874ea8bbd4e643bffa Fix coremods without a manifest crashing the game. Closes #181 + MinecraftForge/FML@ac16845fc4661fa046a252eda7f9a9a847940189 Fix demo mode crash. Closes #187 + MinecraftForge/FML@984291cee91f585a6f4300eedfed882c814843f8 Fix supertype parsing to handle null superclass (Hi Object!). Closes #160 + MinecraftForge/FML@f6479299936f0f94cfc43210dd9dd44b8b5350ef Merge branch 'master' of github.com:Uristqwerty/FML + MinecraftForge/FML@b301e8e4c1877be246fd4f0b45085b70773d8f2b Change type of connection queue to a concurrent linked queue. Much more efficient, hopefully. Closes #189 + Christian: + Updated FML: + MinecraftForge/FML@dab22f5b74f3f2a410e20583f811605dc8e3c05f Fix "0 mods" display when installed in forge. + +Build 1.5-7.7.0.565: + Christian: + Updated FML: + MinecraftForge/FML@485db6be2e6b54a9a523a2b06e0d886792b0826a Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf. + Christian: + Updated FML: + MinecraftForge/FML@591e65fa1aa52d2a72dc527ad1c2ac53c8eb94c4 Revert "Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf." + MinecraftForge/FML@2a779ec3289f695b477ec6b0822a27801e2deba1 Try a different way of remapping the fields. Should work because it's userspace, not relauncher space + MinecraftForge/FML@ca2d8bd83475f37946b86cf6fabd8ff810f9c2bf Fix reflection helper: it needs to unmap the classname to find the field maps. + +Build 1.5-7.7.0.563: + Christian: + Updated FML: + MinecraftForge/FML@25f3fcad4654d19637878bdfb2b70a9586fb3fc9 Fix up some relauncher stuff: the vanilla applet works now, as do other applets. Deobf data is resolveable for them too. + +Build 1.5-7.7.0.562: + LexManos: + Updated FML: + MinecraftForge/FML@6bf7c9878cc959d5f5fa8ec0bf9d0d75037df882 Fixed srg name of minecraftDir for runtime deobf. + +Build 1.5-7.7.0.561: + Christian: Refresh patch + Christian: + Updated FML: + MinecraftForge/FML@95d0ff18cdca3b5a91b648c847c00f559f8ce6f2 Fix runtime deobfuscation for remapped inner classes + +Build 1.5-7.7.0.560: + LexManos: + Updated FML: + MinecraftForge/FML@86a9c7d35953296f7c8bd3a2b1b43115ef0f9308 Fixup reobfusication of server code if present. + MinecraftForge/FML@8e7956397dd80902f7ca69c466e833047dfa5010 Just enable server side compile, and warn not to complain tous. + MinecraftForge/FML@889efc1c0a9216b55f6de275e4f4a279d977e60c Fixes GameRegistry.registerBlock + MinecraftForge/FML@fe1623a36a1bb8b0a046d833e896fd46d88898ef Merge pull request #195 from RainWarrior/snapshot15 + MinecraftForge/FML@62f5adf8e21d59408af409a88b2c81757fd3c587 Revert "Fix modlist to use the new texture binding functions, i think" + MinecraftForge/FML@58ee06ea8edf508daa4ab3920790c0153cf6660d Some fixes for the snapshot + MinecraftForge/FML@368a2245ef0071b0b7a35d3bd78ab1ae379f8faf Merge branch 'snapshot15' + MinecraftForge/FML@1eba1dfdc00edf12ca3d8586dc342563218fc717 Fix accidental commands.patch overwrite + MinecraftForge/FML@ebdb166ec87e63503f0071e557cdb44629a0e0c2 Merge branch 'snapshot15' + MinecraftForge/FML@450dd8313c2e9e46d173bbd242f84d48266af7c8 Fix up some small things, merging into mainline + MinecraftForge/FML@1642bad402efe819f4e763bf4b460d8c04194849 Fix Multi-part entity children ID issue, mobs with custom spawning must deal with child ids themselves. + +Build 1.5-7.7.0.559: + LexManos: Update patche for jad-style names. + LexManos: Updated FML and at config for 1.5 snapshot + LexManos: First patches updae to 1.5, Many rendeirng related changes, most notibly removed Item/Block's getTextureFile() functions. + LexManos: Removed some dead code, We don't bind custom tessellators + CovertJaguar: MCL Update + LexManos: Bump major and minor version numbers to mark 1.5, it's gunna break everything. Should be a compileable 1.5 build. + Christian: + Fix a couple of forge patches + + Update FML: d075daf + d075daf Merge branch 'master' into snapshot15 Fix up compilation and patching errors + 1bd6847 Fix up packages.csv ordering for easier diffing + dd832f2 Update for MCP7.30c - fixes redstone rendering issues + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-server + e1c6630 Javadoc cleanup + 5ce4e31 Fix breaking change + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + aa822e3 Fix logical error in comment text + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + 0165742 Fix mcp conf md5 signatures for the snapshot + 26a5b31 FMLLogFormatter: dynamic log level name + LexManos: + Merge commit '695b080197bd577cc34fe6dbc72b74f4a74b2d5c' into snapshot15 + Testing cherry picking. + LexManos: + Sync up with FML, Will not run nativly as you need deobfusication_data.zip in your libs folder. + We have not setup the download for that yet, to make it yourself just zip joined.srg name it deobfusication_data.zip and put it in lib + LexManos: Not supposed to have debug stuff... + LexManos: Updated Forge to s13w09c + Christian: Fix up patches for FML, also, add in FML as a submodule rather than a zip + Christian: + Add in simple texture management for mods using the stitcher. Scope with "{domain}:{texture}" to + get textures that are not at /textures//{texture}.png but /mods/{domain}/textures//{texture}.png + instead + LexManos: Testing selective commit of submodule. + LexManos: + Added submodule changelog ganerator: + + Updated FML: + MinecraftForge/FML@e74087ee430633475c3ca058e54e3ef242a9d6aa Ignore again, testing submodule. + LexManos: Removed GNUWin32 files and uneeded files seince FML is now a submodule. + LexManos: Remove window helper batch files. + LexManos: Update python scripts to reflect that FML is now a submodule. Delete updateasmdata as it's in /fml/ now. Build should work once again. + LexManos: Change FML module to read-only connection. + Christian: Update submodule + LexManos: Copy over some needed files for debugging. + LexManos: Rework configuration, configs should now use Config.hasChanged to deterne if thehould call save(), also re-worked the saving to not use String.format as much. + LexManos: Fixed new python changes. + LexManos: + Updated FML: + MinecraftForge/FML@aed2cc446ad8d5882890c5f218eb894ea7bd2577 Force file name encoding to UTF-8, caused different zips on different systems. + LexManos: Fix animation location for textures with domains + LexManos: Add helper functions for deling with custom TextureStitched + LexManos: Add callback on TextureStitched to control texture loading. + LexManos: New world event for controlling potential entity spawnlists. For #430 + LexManos: Removed erroring imports and update build function to die on errors. + LexManos: Fix ItemSeedFood respecting custom soils. + LexManos: + Updated FML: + MinecraftForge/FML@debbdc00be8ea1a261cdff83785ddc7100419a74 Capture Minecraft logs into FML logging + MinecraftForge/FML@74fffc6fdc2eda8caa9a7feb0826d7babb84751a Update next render to 40 + Christian: + Call stitcher for non-existent textures as well. Probably allows + for generated textures. Hmmm + Christian: let's do it right this time. Hmmm + Christian: + Updated FML: + MinecraftForge/FML@abe4f73a9a3158f6f9d1ea2334798f54a25817bf FIX massive performance issue with FML. Thanks to @sfPlayer1 for finding this epic derp on my part! + Christian: Add an Icon to the LiquidStack, for rendering the liquid in various ways + LexManos: Readd second render pass to TileEntities and Entities, patches were missed when merging in master branch. As note, CB can DIAF. + LexManos: Fix compile error, forget to flush to disc. + LexManos: Make release quit on compile error. + Christian: Clean up Access Transformer mapping data + Christian: + Updated FML: + MinecraftForge/FML@e9ff699c2dcd787a3e0ebaa427c625a48de4c9fb Refresh the renderengine after modloading is complete. Should fix issues with out-of-place texture registration by mods. + MinecraftForge/FML@a723aa68606d57b0ee5bac8b1d1905abef440b54 Refresh copyright notices on everything + MinecraftForge/FML@c42a2101408b21799728c88e2d02c718c3b0dd36 Strip deprecated code + MinecraftForge/FML@6eeae8c49ff4359dc21c44eb73e4e043285cd8bf Fix up state transition derp when the server crashes with an error- it shouldn't double-derp + MinecraftForge/FML@81c6421f84c1bff359dfe927974e8730b348806a Tweak license text- any osi licensed project can use the asm transformer code + LexManos: + Updated to 1.5 Pre-release + Updated FML: + MinecraftForge/FML@2d98835db8c6a7665ef55117d60ab4318876836b Scala support! It's still primitive, I hope that people will like it. I do :) + MinecraftForge/FML@5bfaf7c1700191b6ed8f4752c9a95bf8c25323ef Global object registry, also, support the new itemblockwithmetadata constructor + MinecraftForge/FML@80a40c03e644840d827eb7d67ff97f6558eaa2e4 Update to MCP 1.5 and minecraft 1.5. + MinecraftForge/FML@b3e854a15d7c50b4967be8237df5fdace95a15ee Update for new MCP with srg reobf. + LexManos: Fix typos. + LexManos: Deprecated Forge's ISidedInventroy, there is a vanilla solution. Added temporary config option to legacy furnace slot orientation. + LexManos: + Updated FML: + MinecraftForge/FML@f1c6bdd57d41a938cb3326d509042f6842e42396 Support the MCP format of partial reobfuscation for portability. Ensure modloader-like compatibility + MinecraftForge/FML@0419b9d9751ade4497343aefaf2ca43703eb479a Update MCP info for latest + LexManos: Early define CrashReport classes to combat invalid crash details. + LexManos: Fix reobf call. + +Build 1.5-7.7.0.558-snapshot15: + Christian: Clean up Access Transformer mapping data + Christian: + Updated FML: + MinecraftForge/FML@e9ff699c2dcd787a3e0ebaa427c625a48de4c9fb Refresh the renderengine after modloading is complete. Should fix issues with out-of-place texture registration by mods. + MinecraftForge/FML@a723aa68606d57b0ee5bac8b1d1905abef440b54 Refresh copyright notices on everything + MinecraftForge/FML@c42a2101408b21799728c88e2d02c718c3b0dd36 Strip deprecated code + MinecraftForge/FML@6eeae8c49ff4359dc21c44eb73e4e043285cd8bf Fix up state transition derp when the server crashes with an error- it shouldn't double-derp + MinecraftForge/FML@81c6421f84c1bff359dfe927974e8730b348806a Tweak license text- any osi licensed project can use the asm transformer code + LexManos: + Updated to 1.5 Pre-release + Updated FML: + MinecraftForge/FML@2d98835db8c6a7665ef55117d60ab4318876836b Scala support! It's still primitive, I hope that people will like it. I do :) + MinecraftForge/FML@5bfaf7c1700191b6ed8f4752c9a95bf8c25323ef Global object registry, also, support the new itemblockwithmetadata constructor + MinecraftForge/FML@80a40c03e644840d827eb7d67ff97f6558eaa2e4 Update to MCP 1.5 and minecraft 1.5. + MinecraftForge/FML@b3e854a15d7c50b4967be8237df5fdace95a15ee Update for new MCP with srg reobf. + LexManos: Fix typos. + LexManos: Deprecated Forge's ISidedInventroy, there is a vanilla solution. Added temporary config option to legacy furnace slot orientation. + LexManos: + Updated FML: + MinecraftForge/FML@f1c6bdd57d41a938cb3326d509042f6842e42396 Support the MCP format of partial reobfuscation for portability. Ensure modloader-like compatibility + MinecraftForge/FML@0419b9d9751ade4497343aefaf2ca43703eb479a Update MCP info for latest + LexManos: Early define CrashReport classes to combat invalid crash details. + LexManos: Fix reobf call. + +Build 13w09c-7.7.0.556-snapshot15: + LexManos: Make release quit on compile error. + +Build 13w09c-7.7.0.555-snapshot15: + LexManos: Readd second render pass to TileEntities and Entities, patches were missed when merging in master branch. As note, CB can DIAF. + LexManos: Fix compile error, forget to flush to disc. + +Build 13w09c-7.7.0.553-snapshot15: + Christian: Add an Icon to the LiquidStack, for rendering the liquid in various ways + +Build 13w09c-7.7.0.552-snapshot15: + Christian: + Updated FML: + MinecraftForge/FML@abe4f73a9a3158f6f9d1ea2334798f54a25817bf FIX massive performance issue with FML. Thanks to @sfPlayer1 for finding this epic derp on my part! + +Build 13w09c-7.7.0.551-snapshot15: + Christian: let's do it right this time. Hmmm + +Build 13w09c-7.7.0.550-snapshot15: + Christian: + Call stitcher for non-existent textures as well. Probably allows + for generated textures. Hmmm + +Build 13w09c-7.7.0.549-snapshot15: + LexManos: Fix ItemSeedFood respecting custom soils. + LexManos: + Updated FML: + MinecraftForge/FML@debbdc00be8ea1a261cdff83785ddc7100419a74 Capture Minecraft logs into FML logging + MinecraftForge/FML@74fffc6fdc2eda8caa9a7feb0826d7babb84751a Update next render to 40 + +Build 13w09c-7.7.0.548-snapshot15: + LexManos: Removed erroring imports and update build function to die on errors. + +Build 13w09c-7.7.0.547-snapshot15: + LexManos: New world event for controlling potential entity spawnlists. For #430 + +Build 13w09c-7.7.0.546-snapshot15: + LexManos: Add callback on TextureStitched to control texture loading. + +Build 13w09c-7.7.0.545-snapshot15: + LexManos: Fix animation location for textures with domains + LexManos: Add helper functions for deling with custom TextureStitched + +Build 13w09c-7.7.0.544-snapshot15: + LexManos: Copy over some needed files for debugging. + LexManos: Rework configuration, configs should now use Config.hasChanged to deterne if thehould call save(), also re-worked the saving to not use String.format as much. + LexManos: Fixed new python changes. + LexManos: + Updated FML: + MinecraftForge/FML@aed2cc446ad8d5882890c5f218eb894ea7bd2577 Force file name encoding to UTF-8, caused different zips on different systems. + +Build 13w09c-7.7.0.543-snapshot15: + Christian: Update submodule + +Build 13w09c-7.7.0.542-snapshot15: + Christian: Fix up patches for FML, also, add in FML as a submodule rather than a zip + Christian: + Add in simple texture management for mods using the stitcher. Scope with "{domain}:{texture}" to + get textures that are not at /textures//{texture}.png but /mods/{domain}/textures//{texture}.png + instead + LexManos: Testing selective commit of submodule. + LexManos: + Added submodule changelog ganerator: + + Updated FML: + MinecraftForge/FML@e74087ee430633475c3ca058e54e3ef242a9d6aa Ignore again, testing submodule. + LexManos: Removed GNUWin32 files and uneeded files seince FML is now a submodule. + LexManos: Remove window helper batch files. + LexManos: Update python scripts to reflect that FML is now a submodule. Delete updateasmdata as it's in /fml/ now. Build should work once again. + LexManos: Change FML module to read-only connection. + +Build 13w09c-7.7.0.539-snapshot15: + LexManos: Updated Forge to s13w09c + +Build 13w05b-7.7.0.538-snapshot15: + LexManos: Not supposed to have debug stuff... + +Build 13w05b-7.7.0.537-snapshot15: + LexManos: + Sync up with FML, Will not run nativly as you need deobfusication_data.zip in your libs folder. + We have not setup the download for that yet, to make it yourself just zip joined.srg name it deobfusication_data.zip and put it in lib + +Build 13w02b-7.7.0.536-snapshot15: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + Christian: Attempt to fix a possible NPE in the face of ChickenBones' hackery. ChickenBones. stop it! + Christian: + Fix a potential problem with "Entity already added" when using the dormant + chunk cache capability. The entities in the dormant chunk cache will get new + IDs prior to the cached chunk returning. + Christian: Fix NPE causing issue with the cache. Derpy derp. + Christian: + Add in TESR culling, and a new TileEntity method to allow for differential sizing of the + TESR view culling vs the TE collision bounding box (the former defaults to the latter) + Checked into a branch because it's likely to break expanded TileEntities. + Christian: Bump the revision number for the TESR and renderpass changes + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + Christian: Fix small derp in TE + Christian: + Update FML:549b6fd + 549b6fd IMC tweaks: runtimeMessages now work (thanks for all that testing for this much requested feature!) and IMCEvent will no longer rem + 9fafdc1 More logging tweaks. You can probably configure individual mod log files if you wish now + f169f7c A log of logging cleanup. FML will now read logging.properties to configure logging channels a couple of times during startup. You + 3ac891f Try and handle "death on startup" a bit cleaner + 2dc0189 Deprecate the old GUI ticktype. They're dead and have been for some time. + dd98784 Tweak a method signature + 1c9a510 Add parameters to FML install to enable/disable certian aspects. Applying patches, running transformer/merger, and decompiling serv + 1bd6847 Fix up packages.csv ordering for easier diffing + Christian: + Add in "armor ticking"- implement the interface and the armor piece will tick. + + Update FML:22dbe41 + 22dbe41 Fix up mistake that broke all modloading. Nice. + Christian: Fix TESR rendering for double chests + Christian: Fix possible null case for collision bounding box. + Christian: Remove the single use interface ITickingArmor, and apply to Item directly. + Christian: + Fix ServerBrand retriever- forge is now forge,fml! + + Update FML: cd96718 + cd96718 Fix HD mob skins, FINALLY!!! Stupid eyes are stupid. + LexManos: Kill generated timestamp in config files, if you want to retreive this information, usethe file's modified time. Closes #404 + LexManos: Actually use the line parameter in ServerChatEvent, closes #401 + LexManos: Kill .sh wrappers until someone writes more robust versions, closes #392 and closes #402 + LexManos: Made LiquidStack.isLiquidEqual(ItemStack) properly check the contained liquid, in addition to obvious id/meta closes #399 and closes #403 + LexManos: Add item frame transformations to the EntityItem render helper Closes #407 + LexManos: Added a hook into SlotArmor so Items can control if they are classified as a Armor type. Closes #408 + LexManos: Fixes comparison for items in creative inventory, closes #411 + LexManos: Fix fortune modifier always passed as 0 to idDropped closes #412 + LexManos: Fix EventTransformer throwing an NPE when transforming a class that doesn't exist. Closes #413 + LexManos: Fix profiler issue with RenderGlobal patch. Closes #414 + LexManos: Jenkins needs this script, *pokes Overmind* -.- + LexManos: + Update FML to 556: + b6d6f235 Fix sprite map issue. + 1158aa46 Fix Language Registry, closes #FML 163 + 50ce6fb3 Option to disable renaming for srgnames. + LexManos: Disable automatic equiti of pcke dup items for players, and fixed index issues in Player.setCurrentItemOrArmor. + LexManos: Fixed entity colision above max world height, and below 0. Closes #400 + LexManos: Change usage of ketSet/get to entrySet in OreDictionary, closes #422 + LexManos: Fix movement speed check, closes #420 + LexManos: clarify what the size is measured in for the dormant chunk cache. -.- + LexManos: ItemStack sensitive versions of Item.getPotionEffect and Item.isPotionIngredient Closes #321 + LexManos: WorldGen*Trees shoud not respect custom soils. Closes #355 + LexManos: Added unload event for client worlds Closes #405 + LexManos: Store the glMultiTexCoord lightmap for later use with glDrawArrays closes #406 + LexManos: Add water and lava to liquid dictionary by default, closes #419 + LexManos: Bump version to 6.6.2, declaring Forge for MC 1.4.7 feature complete, as 1.5 is on the horizon, only bug fixes from this point on. Unless something major happens on Mojang's end. + LexManos: Fix TESR culling for beacons, and implement a good enough measure for Chests. + +Build 13w02b-7.7.0.535-snapshot15: + LexManos: + Merge commit '695b080197bd577cc34fe6dbc72b74f4a74b2d5c' into snapshot15 + Testing cherry picking. + +Build 1.4.7-6.6.2.534: + LexManos: Fix TESR culling for beacons, and implement a good enough measure for Chests. + +Build 1.4.7-6.6.2.533: + LexManos: Bump version to 6.6.2, declaring Forge for MC 1.4.7 feature complete, as 1.5 is on the horizon, only bug fixes from this point on. Unless something major happens on Mojang's end. + +Build 1.4.7-6.6.1.532: + LexManos: Added unload event for client worlds Closes #405 + LexManos: Store the glMultiTexCoord lightmap for later use with glDrawArrays closes #406 + LexManos: Add water and lava to liquid dictionary by default, closes #419 + +Build 1.4.7-6.6.1.531: + LexManos: WorldGen*Trees shoud not respect custom soils. Closes #355 + +Build 1.4.7-6.6.1.530: + LexManos: Fix movement speed check, closes #420 + LexManos: clarify what the size is measured in for the dormant chunk cache. -.- + LexManos: ItemStack sensitive versions of Item.getPotionEffect and Item.isPotionIngredient Closes #321 + +Build 1.4.7-6.6.1.529: + LexManos: Disable automatic equiti of pcke dup items for players, and fixed index issues in Player.setCurrentItemOrArmor. + LexManos: Fixed entity colision above max world height, and below 0. Closes #400 + LexManos: Change usage of ketSet/get to entrySet in OreDictionary, closes #422 + +Build 1.4.7-6.6.1.528: + LexManos: + Update FML to 556: + b6d6f235 Fix sprite map issue. + 1158aa46 Fix Language Registry, closes #FML 163 + 50ce6fb3 Option to disable renaming for srgnames. + +Build 1.4.7-6.6.1.527: + LexManos: Kill generated timestamp in config files, if you want to retreive this information, usethe file's modified time. Closes #404 + LexManos: Actually use the line parameter in ServerChatEvent, closes #401 + LexManos: Kill .sh wrappers until someone writes more robust versions, closes #392 and closes #402 + LexManos: Made LiquidStack.isLiquidEqual(ItemStack) properly check the contained liquid, in addition to obvious id/meta closes #399 and closes #403 + LexManos: Add item frame transformations to the EntityItem render helper Closes #407 + LexManos: Added a hook into SlotArmor so Items can control if they are classified as a Armor type. Closes #408 + LexManos: Fixes comparison for items in creative inventory, closes #411 + LexManos: Fix fortune modifier always passed as 0 to idDropped closes #412 + LexManos: Fix EventTransformer throwing an NPE when transforming a class that doesn't exist. Closes #413 + LexManos: Fix profiler issue with RenderGlobal patch. Closes #414 + LexManos: Jenkins needs this script, *pokes Overmind* -.- + +Build 1.4.7-6.6.1.524: + Christian: + Fix ServerBrand retriever- forge is now forge,fml! + + Update FML: cd96718 + cd96718 Fix HD mob skins, FINALLY!!! Stupid eyes are stupid. + +Build 1.4.7-6.6.1.523: + Christian: Remove the single use interface ITickingArmor, and apply to Item directly. + +Build 1.4.7-6.6.1.522: + Christian: Fix possible null case for collision bounding box. + +Build 1.4.7-6.6.1.521: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + Christian: + Add in TESR culling, and a new TileEntity method to allow for differential sizing of the + TESR view culling vs the TE collision bounding box (the former defaults to the latter) + Checked into a branch because it's likely to break expanded TileEntities. + Christian: Bump the revision number for the TESR and renderpass changes + Christian: Fix small derp in TE + Christian: + Update FML:549b6fd + 549b6fd IMC tweaks: runtimeMessages now work (thanks for all that testing for this much requested feature!) and IMCEvent will no longer rem + 9fafdc1 More logging tweaks. You can probably configure individual mod log files if you wish now + f169f7c A log of logging cleanup. FML will now read logging.properties to configure logging channels a couple of times during startup. You + 3ac891f Try and handle "death on startup" a bit cleaner + 2dc0189 Deprecate the old GUI ticktype. They're dead and have been for some time. + dd98784 Tweak a method signature + 1c9a510 Add parameters to FML install to enable/disable certian aspects. Applying patches, running transformer/merger, and decompiling serv + 1bd6847 Fix up packages.csv ordering for easier diffing + Christian: + Add in "armor ticking"- implement the interface and the armor piece will tick. + + Update FML:22dbe41 + 22dbe41 Fix up mistake that broke all modloading. Nice. + Christian: Fix TESR rendering for double chests + +Build 1.4.7-6.6.1.520-TESRculling: + Christian: Fix small derp in TE + +Build 1.4.7-6.6.1.519-TESRculling: + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + +Build 1.4.7-6.6.0.518: + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + +Build 1.4.7-6.6.0.517: + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + +Build 1.4.7-6.6.0.516: + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + +Build 1.4.7-6.6.0.515: + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + +Build 1.4.7-6.6.1.514-TESRculling: + Christian: Bump the revision number for the TESR and renderpass changes + +Build 1.4.7-6.6.0.513-TESRculling: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + +Build 1.4.7-6.6.0.511: + Christian: Fix NPE causing issue with the cache. Derpy derp. + +Build 1.4.7-6.6.0.510: + Christian: + Fix a potential problem with "Entity already added" when using the dormant + chunk cache capability. The entities in the dormant chunk cache will get new + IDs prior to the cached chunk returning. + +Build 1.4.7-6.6.0.509: + Christian: Attempt to fix a possible NPE in the face of ChickenBones' hackery. ChickenBones. stop it! + +Build 13w02b-7.7.0.508-snapshot15: + scott: Add ability to WorldTypes to display the 'Customize' button and react to it + LexManos: + Update FML: + New scripts for signing jars, and repackging source folders. + Fix LanguageRegistry loading files in UTF-8 format. loadLocalization should work for non-xml in all languages now (assumes UTF-8) + Fix incorrect end length calculation. Closes #161 Thanks BStramke! + LexManos: Fix check in getItem() to allow lowest item ID #361 + CovertJaguar: + Fixed render passes for EntityItems + + Should be < instead of <= + Christian: + Update licencing information to make clear that forge is allowed to redistribute and automatically + download parts of MCP, but this permission is not transitive to people distributing MinecraftForge + source independently of the MinecraftForge project. + + Update MCP to 7.26a and FML: 7ad8529 + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + Christian: + Update FML: a99c488 + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + aa822e3 Fix logical error in comment text + 26a5b31 FMLLogFormatter: dynamic log level name + Christian: Merge part of PR #375 related to ChunkEvent.Load for the client side + Christian: + Update FML: 5ce4e31 + 5ce4e31 Fix breaking change + Christian: + Add in patch to change how playerinstance sends TE chunk updates. It should always send just the TEs + that changed now, and not "ALL" TEs. Also, added configuration value to change the 64 threshold to a + configurable number + Christian: Some javadoc fixes + Christian: + Change DimensionManager.getCurrentSaveRootDirectory() to try and work even for the new server about to start event + + Update FML:8921cfe + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. A + Christian: + Update FML:aebf6eb + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + Christian: + Fix a couple of forge patches + + Update FML: d075daf + d075daf Merge branch 'master' into snapshot15 Fix up compilation and patching errors + 1bd6847 Fix up packages.csv ordering for easier diffing + dd832f2 Update for MCP7.30c - fixes redstone rendering issues + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-server + e1c6630 Javadoc cleanup + 5ce4e31 Fix breaking change + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + aa822e3 Fix logical error in comment text + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + 0165742 Fix mcp conf md5 signatures for the snapshot + 26a5b31 FMLLogFormatter: dynamic log level name + +Build 1.4.7-6.6.0.507: + Christian: + Update FML:aebf6eb + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + +Build 1.4.7-6.6.0.506: + Christian: + Change DimensionManager.getCurrentSaveRootDirectory() to try and work even for the new server about to start event + + Update FML:8921cfe + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. A + +Build 1.4.7-6.6.0.505: + Christian: Some javadoc fixes + +Build 1.4.7-6.6.0.504: + Christian: + Update FML: 5ce4e31 + 5ce4e31 Fix breaking change + Christian: + Add in patch to change how playerinstance sends TE chunk updates. It should always send just the TEs + that changed now, and not "ALL" TEs. Also, added configuration value to change the 64 threshold to a + configurable number + +Build 1.4.7-6.6.0.503: + scott: Add ability to WorldTypes to display the 'Customize' button and react to it + CovertJaguar: + Fixed render passes for EntityItems + + Should be < instead of <= + Christian: Merge part of PR #375 related to ChunkEvent.Load for the client side + +Build 1.4.7-6.6.0.502: + Christian: + Update FML: a99c488 + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + aa822e3 Fix logical error in comment text + 26a5b31 FMLLogFormatter: dynamic log level name + +Build 1.4.7-6.6.0.501: + Christian: + Update licencing information to make clear that forge is allowed to redistribute and automatically + download parts of MCP, but this permission is not transitive to people distributing MinecraftForge + source independently of the MinecraftForge project. + + Update MCP to 7.26a and FML: 7ad8529 + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + +Build 13w02b-7.7.0.500-snapshot15: + LexManos: Bump major and minor version numbers to mark 1.5, it's gunna break everything. Should be a compileable 1.5 build. + +Build 1.4.7-6.6.0.499: + LexManos: + Update FML: + New scripts for signing jars, and repackging source folders. + Fix LanguageRegistry loading files in UTF-8 format. loadLocalization should work for non-xml in all languages now (assumes UTF-8) + Fix incorrect end length calculation. Closes #161 Thanks BStramke! + LexManos: Fix check in getItem() to allow lowest item ID #361 + +Build 1.4.7-6.6.0.497: + LexManos: Added getter for Metadata smelting list, because, why not.. PR: #352 + LexManos: Fixed incorrect lighting in some cases. Closes issue #349 + LexManos: + Added event hooks to control to allow mod control of mob spawning. PR: #337 + Deprecated LivingSpecialSpawnEvent in favor of new LivingSpawnEvent.SpecialSpawn + +Build 1.4.7-6.6.0.496: + LexManos: Fix issue where dungeon loot table had wrong values. + LexManos: Fixed issue where ChunkPriderEvent.InitNoiseField used the wrong sizeY value. + LexManos: Some small code cleanups. + +Build 1.4.7-6.6.0.495: + Christian: + Update FML:6f1b762 + 6f1b762 Move server stopped *after* the server has actually stopped. *sigh* + +Build 1.4.7-6.6.0.494: + Christian: + Update FML:d9bfb29 + d9bfb29 Add in a "server stopped" event + +Build 1.4.7-6.6.0.493: + Christian: + Attempt to resolve the entity concurrency issue, by simply deferring unload + to the next tick + +Build 1.4.7-6.6.0.492: + Christian: Fix noisy exception logging + Christian: + Update FML:6fc7bc4 + 6fc7bc4 Add in some classloader debugging information: use fml.debugClassLoading=true as a system property to track down prob + +Build 1.4.7-6.6.0.491: + Christian: + Fix a missed patch and cleaned up other patches + Rollback a method name change that breaks a lot of mods + Update FML: fb701cd + fb701cd Revert MCP name change for canConnectRedstone - it conflicts with a forge method of the same name and breaks 1 + +Build 1.4.7-6.6.0.490: + Christian: + Update for MC 1.4.7 + Update FML: f7cc50b + +Build 1.4.6-6.5.0.489: + LexManos: Attempt a fix for the new chunk compression changes. + +Build 1.4.6-6.5.0.488: + Christian: + Update FML:1a232cf + 1a232cf Fix multiple GUI containers for ML containers. Sorry ultimatechest that this fix took so long, a bug report at + 853f54b Log if there's a problem reading the class bytes + +Build 1.4.6-6.5.0.487: + LexManos: Fix mobs spawning on inverted slabs/stairs. + +Build 1.4.6-6.5.0.486: + LexManos: Use nanoTime instead of currentTimeMillis for potential performance increase. + LexManos: Fixed order <.< you saw nothing. + +Build 1.4.6-6.5.0.484: + LexManos: Fixed issue with Efficancy enchatment when connected to vanilla servers. + LexManos: Fixed EntityMinecard missed patch, Issue #338 + LexManos: Fixed typo in dungeon loot + +Build 1.4.6-6.5.0.483: + Uristqwerty: + Force parent ListenerListInsts to rebuild. + + Without this change, it is possible (and, in fact, nearly guaranteed) for lists to rebuild endlessly if a parent list is marked as needing a rebuild but never actually read. This change forces the parent list(s) to rebuild as well, resulting in a significant performance increase and smoother framerate due to greatly reduced GC activity. + Christian: Protect deflation with a simple semaphore. Should close #336 + +Build 1.4.6-6.5.0.482: + LexManos: Update FML: Fix NPE in fingerprint loading, and pass expectged fingerprint to FMLFingerprintViolationEvent + +Build 1.4.6-6.5.0.481: + Christian: + Update FML: 7e6456d + 7e6456d Fix a message delivery issue in IMC + 664ebda Some tweaks for signing and ID matching + +Build 1.4.6-6.5.0.480: + LexManos: + Fixes a vanilla bug where the player view would dip when stepping between certain blocks + https://mojang.atlassian.net/browse/MC-1594 + Issue #318, let me know if you notice any issue. + +Build 1.4.6-6.5.0.479: + LexManos: Fixed parameter ordering u.u + +Build 1.4.6-6.5.0.478: + LexManos: + Re-write/Deprecated DungeonHooks loot tables, now uses ChestGenHooks like the rest of the world gen. Also fixes issue #330 by adding in enchanted books. + + Should be API compatible. + +Build 1.4.6-6.5.0.477: + LexManos: + Move chunk compression to the network thread in Packet 51 and 56 + + This will reduce the server load considerably by doing the chunk data compression in writePacketData, which will be run from the network thread. + + The chunk compression can easily use 1/4th of the overall server thread CPU time if someone is exploring much, especially when moving quickly (e.g. with quantum leggings). + + Player, this is how it's properly done. + +Build 1.4.6-6.5.0.476: + LexManos: Fix missed patch in EntityMinecart, #334 + LexManos: Explicitly check if useItem is not denied, allows for denying the item without denying the block + +Build 1.4.6-6.5.0.475: + LexManos: Delete unneeded patch. + +Build 1.4.6-6.5.0.474: + Christian: Some access transformations to allow mystcraft to work again. Closes #331 + +Build 1.4.6-6.5.0.473: + Christian: Fix Fireworks to always work in SMP + +Build 1.4.6-6.5.0.472: + Christian: + Fix up enchantment at the enchanting table vs via a book. Adds in a method + that previously exists under a new name: canApplyAtEnchantingTable() + to determine enchantments that can apply at the enchanting table (a smaller + subset of all possible enchantments for an item, now). Also, add your + enchantments to the anvil book application list, if neccessary. + +Build 1.4.6-6.5.0.471: + Christian: Tweak packet56 to see if this resolves the apparent worldgen derpiness + +Build 1.4.6-6.5.0.470: + Christian: + Server side only item callback: allow a held item to decide if it wants to pass sneak-clicks through + to a block, or not. Defaults false- the same as the new vanilla behaviour (sneak clicks with an item + in hand don't activateBlock anymore). + +Build 1.4.6-6.5.0.469: + Christian: Move another patch up a bit - should actually close #329 + +Build 1.4.6-6.5.0.468: + Christian: Add IPlantable to itemseedfood. Potato and carrot support! + +Build 1.4.6-6.5.0.467: + LexManos: + Update FML: + Fixed issue with users who don't have the JDK installed in there path + MCP will now output bfusicated files with windows reserved names to _name.class and FML will prioritize those names. + Fixed placement of onConnectionClosed callback + LexManos: Updated NetClientHandler for onConnectionClosed placement fix. + LexManos: Fixed cpw's derp in the PlayerInteractEvent logic. + +Build 1.4.6-6.5.0.466: + Christian: Fix ItemInWorldManager so that itemUseFirst works, and the playerinteractevent works. Minor patching mis hit. Apologies. + +Build 1.4.6-6.5.0.465: + Christian: OK. AT the right thing, and add in a call to always get the right thing. Clean up patch fuzz too. + +Build 1.4.6-6.5.0.464: + Christian: Access Transform a couple of methods + +Build 1.4.6-6.5.0.463: + LexManos: Fixe BiomeDecorator AT entry. + +Build 1.4.6-6.5.0.462: + Christian: Drop the item in onBlockHarvested, not breakBlock + +Build 1.4.6-6.5.0.461: + Christian: Fix up block drops for skulls and cocoa + +Build 1.4.6-6.5.0.460: + Christian: And fix up the other equals + +Build 1.4.6-6.5.0.459: + Christian: Fix comparing ItemStack tags for equality + +Build 1.4.6-6.5.0.458: + Christian: + Update FML: 40e57a2 + 40e57a2 Update MCP to newer version Fix fingerprint fire + +Build 1.4.6-6.5.0.457: + Christian: + Fix accidentally removed not-deprecated methods. + + Update FML: d604e44 + d604e44 InterModComms now supports a runtime polling based model for inter-mod comms at runtime. Deprecate method that shouldn't be used. COPY it's content to your mod. Don't CALL it. + 8b7778c Don't be as alarming about item overwrites. + +Build 1.4.6-6.5.0.456: + Christian: Fix binding the texture for multiple render passes. Thanks mdiyo! Closes #320 + +Build 1.4.6-6.5.0.455: + Christian: Allow RenderItem to be easily overridden for things that need to render entityitems. IronChest, BuildCraft, RP2, whatever... + +Build 1.4.6-6.5.0.454: + LexManos: Fixed items dieing improperly due to new EntityItem sync changes, also made items render offset when rendered in 3d. + +Build 1.4.6-6.5.0.453: + Christian: Fix RenderItem so that forge textures load for it + +Build 1.4.6-6.5.0.452: + LexManos: Removed all functions marked as deperacted for the new MC version + LexManos: + Updated FML: + Fixes startclient/startserver + + Added configuration file which allows modids to ignore ID validation checking. IT WILL CRASH YOUR GAME in 99.999% of cases. + + Immibis is a whingy ass. And TinyTimRob too. Now STFU and GTFO. closes fml/#510 for ever. + +Build 1.4.6-6.5.0.451: + LexManos: Inital update to 1.4.6, Version bumped to 6.5 + LexManos: Added jar signing to forge, we sign cpw/* and net/minecraftforge/* + LexManos: Try and print error while signing jar + +Build 1.4.5-6.4.2.448: + Christian: + Update FML: e98c311 + e98c311 Fix up handling null names. *sigh* + +Build 1.4.5-6.4.2.447: + Christian: + Update FML: 293edb3 + 293edb3 Some tweaks to item identification. The GameRegistry methods are deprecated to encourage you to use the new named ones instead. These will force a name on the item/block, allowing for stronger matching t + 9266ff3 Updated MCP download mirriors upon Searge's request. + 31695d5 Fix var name messup + bfb3020 Update released eclipse project to link BouncyCastle + 22a88ea Change ID management slightly. IDs are tracked by block type for itemblock items now. This means servers will need to update. Also, ordinal rearrangements within a mod will no longer trigger server disco + +Build 1.4.5-6.4.2.446: + LexManos: Make PlaySoundAtEntityEvent fire for players as well + LexManos: Remove erronious double call to PlayerDestroyItemEvent + +Build 1.4.5-6.4.2.445: + LexManos: Update FML to fix a typo + +Build 1.4.5-6.4.2.444: + LexManos: Automatically resolved imports. + LexManos: Fixup workspace for BC replacement + LexManos: Manual import fixes + LexManos: + Update FML: + Minecraft is now decompiled into sane package names. + Got rid of the src/common folder as the only folder that exists is src/mincraft, because the client and server codebase is merged. + ID Map generation/validation fixes + LexManos: Updated python scripts for removal of common folder + LexManos: Update patches for repackage. + LexManos: Update AT for repackage + LexManos: Update FML: Fixed the eclipse workspace to reference BouncyCastle library. + +Build 1.4.5-6.4.2.443: + LexManos: Bump version to 6.4.2 to mark the merge of TerrainGen branch. + +Build 1.4.5-6.4.1.442: + Christian: + Added terrain gen events + Added biome color events for @XCompWiz + Christian: Removed unchanged file + Christian: Readded unchanged version + Christian: For @XCompWiz, added a hook to allow mods to dynamically change the color that water is rendered. + Christian: Fix RenderBlocks patch, touch branch + +Build 1.4.5-6.4.1.441: + LexManos: + Update FML: + 2f34290e: Fix possible escape leakage.. + 83deece6: Change ID management slightly. IDs are tracked by block type for ItemBlock items now. This means servers will need to update. + + Also, ordinal rearrangements within a mod will no longer trigger server disconnection, though a warning will still be logged. + LexManos: Derp, imported the repackaged names not old names. + +Build 1.4.5-6.4.1.439: + LexManos: Update readme to reflect the fact that we now download MCP. + +Build 1.4.5-6.4.1.438: + LexManos: Fix ForgeDirection.ROTATION_MATRIX for issue #313 + LexManos: Made GuiContainer.drawSlotInventory overrideable for issue #312 + LexManos: Made BlockButton.func_82535_o overrideable for issue #311 + LexManos: Moved check if map cursor should 'spin' and which world a player respawns in to WorldProvider for PR #308 + LexManos: Add .DS_Store to the gitignore for mac users + LexManos: Add CloudRenderer for PR #304 + LexManos: New TileEntity function to determine if the TE should be destroied when Block/Meta changes, For Issue #300 + LexManos: Pistons now respect world height a little better, for PR #286, will review Rotation event later. + LexManos: Creative GUI will now remember what tab page you were on, thanks Matchlighter PR #290 + LexManos: Fix type in ForgeChunkManager.ticketCountAvaILableFor, thanks iChun PR: #285 + LexManos: Fixes crash when mods add TreeMaps to the Configuration map, thanks AtomicStryker, PR: #282 + LexManos: Fix shouldRiderSit() to properly determine if rider is sitting. + LexManos: Expose BiomeDecorator fields for custom Biome information, Issue: #239 + LexManos: Make BlockButton.sensible protected and non-final + +Build 1.4.5-6.4.1.437: + LexManos: Fix for FML Fixes eclipse workspace, now sets execution bits on astyle-osx, and mcp .sh files. Also now kills install if astyle is not found. + +Build 1.4.5-6.4.1.436: + LexManos: Fixed release -skipchangelog + LexManos: Fixed install --mcp-dir + LexManos: + Updated FML to 486: + 02b54ca8: Add a modid on the mods list, should make it easier to do things like forge chunkloading config + 70670f2f: Fix build eclipse extractor task + b9fa3fc9: Add in storage, detection and validation of the ItemID array between client and server + 5e5d8206: Fixing id map generation - should validate correctly now + f9fc06a8: Remade python dist as 32-bit. + 93d47a1c: Reenabled replacement of the eclipse folder. + +Build 1.4.5-6.4.1.435: + LexManos: And finally, fix up the release install script to have a parameter to specity the MCP directory. + +Build 1.4.5-6.4.1.434: + LexManos: Fix Forge install script to use python shipped with FML. + +Build 1.4.5-6.4.1.433: + LexManos: Push didn't get all of eclipse.... + +Build 1.4.5-6.4.1.432: + LexManos: + Cleaned up eclipse workspace and moved it to a zip file. + Setup will extract it if it doesn't already exist. + +Build 430: + Christian: Fix release script for new forge job name. Add in skip changelog option for local builds + +Build 1.4.5-6.4.1.426: + LexManos: Remove MCP from released src distro.. whops. + +Build 1.4.5-6.4.1.425: + Christian: + Fix static method, closes #271 + Don't spam the log if a mod requests a ticket beyond their maximum. A single message is fine. + +Build 1.4.5-6.4.1.424: + GuntherDW: Fix typo in chunkmanager config + Christian: fix List configs + Christian: Add Chunk Watch and UnWatch events. + +Build 1.4.5-6.4.1.414: + Christian: + Tweak release.py script: HEAD==master in general + + Update FML: 26a2ef5 + 26a2ef5 Add a modid on the mods list, should make it easier to do things like fo + b4e3490 Fix build eclipse extractor task + 828341f Fix typo + 7a8dae5 Try and make branch non-derpy + d3c0e1f Try defaulting branch differently + 9c77d3f Remove old eclipse workspace and ship/extract as a zip file (use ant set + 6371e9b Assume Forge is the parent directory when checking for AT configs. + 516954e Name both zips the same format + 1151d5c Last part of branch name only please + 25f1dda Try and get a valid branch name on jenkins + 39a146f Clean up build.xml script- support outputting a branched jar file + 037dcae Small derp in install.py + 01d6da3 Try marking python as binary. + 8b26659 FML will now attempt to download MCP as part of the install process Now + 42b3e6a Windows Python distrabution created using py2exe, thanks Fesh0r for the + e709ab8 Marked more spots in gui/items bitmask as being free. + +Build 1.4.5-6.4.1.413: + LexManos: Add wget and unzip from GnuWin32 for use in the setup scripts. + LexManos: Update FML, now includes python, and will download MCP for you + LexManos: Update python files to add support for specifying MCP directory and FML downloading MCP on the fly. + LexManos: Fix issue with DimensionManager.shouldLoadSpawn + +Build 1.4.5-6.4.1.411: + Christian: Fix #289 + +Build 1.4.5-6.4.1.410: + Christian: + Add in some additional ticket loading callbacks for ChickenBones. Closes #284 + Add in a call to determine if there are possible chunktickets for a world. This should let + Mystcraft and other dynamic world generating mods check if they should immediately load + a world based on existing chunk tickets. + +Build 1.4.5-6.4.1.409: + LexManos: Fix issue where non-BlockContainer TEs would not be removed properly. + +Build 1.4.5-6.4.1.408: + LexManos: Fix logic issue in ForgeChunkManager.ticketCountAvaliableFor(username) PR + LexManos: Fix issue where worlds were potentially unloaded improperly on server shutdown. + +Build 1.4.5-6.4.1.407: + LexManos: Small change to fix loading configs. + +Build 1.4.5-6.4.1.406: + LexManos: Added section of the EntityData NBT that will be persisted for players across respawning. + +Build 1.4.5-6.4.1.405: + LexManos: Exposed some ChunkLoader information for PR #278 + LexManos: Fix potential NPE in EntityJoin handler and print warning. + +Build 1.4.5-6.4.1.404: + LexManos: Small tweak to config to use Treemap + +Build 1.4.5-6.4.1.403: + xcompwiz: + Adds a more intelligent chunk constructor + + Adds a chunk constructor with full block id range, that's metadata + sensitive, has intelligent coord ordering, and which allows for + generation at greater heights than 127. + xcompwiz: Fixes some weird formatting + zach: + Fixes ordering for z & x loops (proper array increment order) + + The ordering before would skip about in the ids and metadata arrays. This runs linearly and should improve performance. + Done live on github + +Build 1.4.5-6.4.1.402: + LexManos: Fixed AIOOB issue with new sanity check in getBlock + +Build 1.4.5-6.4.1.401: + LexManos: Fix potential NPE in saving a property that didn't define a type. + +Build 1.4.5-6.4.1.400: + LexManos: + Added new functions to the Config class to allow for specification of comments when getting properties. + Added new getTerrainBlock whihc will limit the resuling ID to < 256, useful for world gen. + Calls to getBlock with IDs less then 256 will be assigned values above 256 {Thus freeing up terrain gen slots} + Made ConfigCategory implement Map should fix compatibility with most mods that broke two builds ago. + +Build 1.4.5-6.4.0.399: + xhamolk.class11: + OreDictionary addition: getOreID(ItemStack) + + Allow getting the oreID from a ItemStack, as an alternative from getOreID(String). + + Now is easier to exchange items for their equivalencies through the OreDictionary. + +Build 1.4.5-6.4.0.398: + LexManos: New nested configuration category support, for PR #258 + +Build 1.4.5-6.4.0.397: + LexManos: Fixed issue with abandoned chunks. + LexManos: Fixed random chest items not generating to there max stack sizes. + +Build 1.4.5-6.4.0.396: + ohai.iChun: + Add check that Entity saves to disk before saving entity to saved chunkloading data. + + Returning false to addEntityID prevents the entity from being saved (cred to LexManos) + Entities which do not save to disk but are chunkloaders causes errors the next time the world loads. This ought to fix it. + +Build 1.4.5-6.4.0.395: + LexManos: Updated FML, proper free-sprite list for /gui/items.png, and fixed MCP version. + +Build 1.4.5-6.4.0.394: + Christian: + Move server specific patch back to common from minecraft. + + Update FML: 1f5c58b + 1f5c58b Fix up MCP version + 61e4db2 Merge joined.exc add update howto + 5efc1eb Revert "Fix MC-2497 - derpy torch flames. Moved from forge. Everyone sho + 3b3600d Modified merger to just consider all server classes as common. And moved + edcc5ca Forgot mcp.cfg + ca79dfe Updated to 1.4.5b + 5945279 Fix python error + 57bf643 Modified decompile so that we do not have to decompile the server, saves + d9d0a46 Cleaned up some tabs + 2fac644 Change usage of ZipFile, fixes issues with Mac's default instation of py + +Build 1.4.5-6.4.0.393: + LexManos: Fix TE Issue + +Build 1.4.5-6.4.0.390: + LexManos: Removed GnuWin32 programs, should no longer be needed as we've moved to python. + LexManos: Updated to MC 1.4.5b + +Build 1.4.5-6.4.0.388: + Christian: Stupid eclipse resetting preferences. Spaces, not tabs!!! + Christian: + Update FML: 570592b + 570592b Attempt to fix a possible comodification risk + +Build 1.4.5-6.4.0.387: + Christian: Add in events when forcing and unforcing chunks. Hope this works for you ChickenBones! + +Build 1.4.5-6.4.0.386: + Christian: + Update FML: fde9414 + fde9414 Change texturebinding to use the textureId directly rather than iconInde + +Build 1.4.5-6.4.0.385: + LexManos: Fixed issue with default implementation of Beach plant type check + LexManos: Fixed custom soil checks for NetherStalk and Reeds + +Build 1.4.5-6.4.0.384: + LexManos: Release script will now include the Minecraft version in the arcive names. + +Build 6.4.0.383: + Christian: + Update FML: f348496 + f348496 Fix mod display list. Shouldn't be derpy anymore. + a5c31b5 Fix World patch- workaround no longer required and leftovers are bad. + 2dc3f0d Cleaned up the AT config updater, should work for any setup of the MCP w + +Build 6.4.0.382: + LexManos: Fixed beds not working properly when respawning. + +Build 6.4.0.381: + Christian: + Remove EntityFX patch - moved to FML. Patch SuspiciousClasses to add "forge" + + Update FML: fa56701 + fa56701 Fix MC-2497 - derpy torch flames. Moved from forge. Everyone should benefit. + 96935bb Fix an NPE in TileEntity trying to generate a crash report. Make suspicious classes just return the obvious. Fix NPE for FML crash report on server. Clean up dead pa + +Build 6.4.0.380: + Christian: Fix the derpy torch flames properly. Closes MC-2497 properly ;) + +Build 6.4.0.379: + Christian: + Update to MC 1.4.5 + Update FML: 43d3042 + 43d3042 Clean up a patch + fec221f Update FML for MC 1.4.5 + b0f0635 Fix for ModLoader static overrides not displaying. + 23a2513 Fix up derpy file name handling: closes #127 Fix up duping childmods: cl + a6eaa2b Fix spelling issue. + c6a0741 FML setup should now download and verify all the minecraft files needed + 5a1930e Small fix to some MCP metadata for pre2 + 418deba Update to MC 1.4.4 + 4ff2cff Fix bug when a modloader mod is run on a dedicated server and has a conn + +Build 6.3.0.378: + Christian: + Some liquid events. Non-API breaking. Add them at your leisure. This helps liquids know + what's happening to them. In case they're volatile or something ;) + +Build 6.3.0.377: + Christian: Another difference + +Build 6.3.0.376: + Christian: + Fix fillLiquidContainer - return null, not the empty container for + previous API compatibility + +Build 6.3.0.375: + LexManos: Update FML to fix ModLoader/addOverride functionality. + +Build 6.3.0.374: + kinglemming: + Fixed oversights in liquid registry, added functionality for instant checks as requested by CJ. + Liquid list return is now secure. + + Signed-off-by: King Lemming + Christian: Change name to LiquidContainerRegistry. Fix up missing API. This better be it now! + +Build 6.3.0.373: + kinglemming: + Liquid Manager Rewrite - slightly more memory usage, loads more efficient at runtime. + Added default Lava and Water registrations to Liquid Manager. + Removed method which relied on flawed assumption that a given liquid only had a single type of container. + + Signed-off-by: King Lemming + Christian: Rename some liquid stuff for more sensible naming. Tweak API slightly. + +Build 6.3.0.372: + Christian: + Add in the basic IBlockLiquid interface. The actual block implementation + will follow. + +Build 6.3.0.371: + Christian: + Add an ItemStack sensitive version of getIconForRenderPass, defers to + existing by default. Should allow NBT data to affect multipass icon rendering. + +Build 6.3.0.370: + Christian: Change getLeft to getRotation, around any axis. + +Build 6.3.0.369: + Christian: Some new stuff on the liquid API for better RP2 interaction. Coming soon: blocks! + +Build 6.3.0.367: + Christian: Tweak liquidcontainer API for sidedness capability + +Build 6.3.0.366: + LexManos: Updated FML, Fixed spelling issues in logs, and file name issues. + LexManos: Added saplings and leaves to the ore dict. PR: #242 + LexManos: Mods can use custom textures for Slot background overlay, instead of only items.png PR #245 and #246 + LexManos: Fix issue where players would spawn in the ground. + LexManos: Allow for modders to decide whether or not players are positioned on ridingEntities similarly to pigs PR #244 + LexManos: Fix breaking despite cancel in creative mode for PlayerInteractEvent OR #247 + +Build 6.3.0.364: + Christian: + As agreed, liquid API from BuildCraft has been migrated to minecraft forge. There will be cleanups to follow, + including sided handling and client rendering tweaks. Stay tuned! + Tweak forgedirection for a couple of naming constants + +Build 6.3.0.363: + Christian: Add toLeft rotational data to ForgeDirection + +Build 6.3.0.362: + LexManos: New field in ForgeDirection to hold just the valid directions. And made getOrientation a bit more efficient. + +Build 6.3.0.361: + LexManos: Fix entity items rendering on the ground. + LexManos: Fix crops not droping seeds properly. + +Build 6.3.0.360: + LexManos: Update to 1.4.4 + LexManos: Bumped version number for 1.4.4 + +Build 6.2.1.358: + LexManos: Ore Dictionary Improvements, replaces vanilla recipes with OreDict recipes for some vanilla items. Thanks Covert. + +Build 6.2.1.357: + LexManos: Made Item constructor public, and made setTextureFile chainable, requires mods to recompile, but as this is for 1.4.3 i'm not concerned. + +Build 6.2.1.356: + Christian: + Temporary update for 1.4.3 + Update FML: bd2123c + bd2123c Clean up some patch fuzz + c2a603c Update joined.exc file from latest conf + db12af4 Update to 1.4.3 + LexManos: + Readdaed teleporter sensitive versions of the teleport function + Added per-world list of custom teleporters, Modders, use World.Load to populate this list. + Changed the definition of our version schemes. + +Build 6.0.1.355: + Christian: + Update FML: 8356fe9 + 8356fe9 FUUUUUU! Stupid ticking. STOP REGISTERING TICK HANDLERS IN YOUR CONSTRUC + 6edce8b Patch a file handle leak in RegionFileCache handling when under memory p + ca2bbe0 Update MCP mapings again, yay bad syncs. + c8941a7 Updated MCP mapings. + 5e20c03 StartServer is now useable in merged code base. + +Build 6.0.1.354: + LexManos: Update FML: Updated MCP mapings, and fixed StartServer + +Build 6.0.1.353: + Christian: + Update FML: b19e882 + b19e882 Remove some debug, closes #123 + 9d7d32a Fix up tick management outside of mod loading phases for ModLoader mods. + d512539 Negatively cache failed class lookups, should help with @SideOnly performance issues. + +Build 6.0.1.351: + Christian: + This update fixes some world corrupting vanilla error handling, mostly caused by + mods doing something derpy. Hopefully, your world saves will thank me. + Note that if the mod does derp, it's data is lost. It's not FML or Minecraft Forge's + responsibility if "DirtChest 2000 Mk5" can't write their TileEntity method correctly + and you lose your 100000 diamonds. + + Update FML: a3a93f3 + a3a93f3 Fix some whitespace issues, handle possibly bugged entities as well + a7eb5dc Vanilla/mod bug fixes: CME on entity processing, TileEntity resetting chunk on save/load. + +Build 6.0.1.350: + LexManos: Fix cast issue when mods attempt to make fake worlds. + LexManos: Fix a vanilla bug related to certian seeds and stronholds. + LexManos: Cleanup some debug in the script, and fix version number for the current build. + +Build 6.0.1.349: + LexManos: Change logs should now be bundled with downloads, as well as avalible on files.minecraftforge.net + +Build 6.0.1.348: + Christian: + Update FML:b23081d + b23081d Support for ModLoader 1.4.2. Good job Risu! + 66db4ec Add in an exclusion list tag for @Mod. The backend code isn't yet implemented, but shows the basic idea. + +Build 6.0.1.345: + LexManos: EntityLiving.experianceValue private->public for Issue #225 + LexManos: Changeable name tag render distance for PR: 174 + LexManos: Remove some debug code + LexManos: New hook to allow items to be on multiple creative tabs PR 176 + LexManos: Fix issue where scroll bar would not render when switching tab pages. + LexManos: Added metadata sensitve experience to furnace recipies and added Item callback to determine experience gain. + LexManos: Exposed functions for adding superflat presets. + LexManos: New hook to allow for custom beacon support blocks. + CovertJaguar: + Added vanilla wood + dye to the Ore Dict + + Should help simplify interaction between mods that add similar items. + LexManos: Added Stonghold, Village, and Spawn biome management helpers for PR 207 + LexManos: Fix compile issue. + +Build 6.0.1.343: + csendek: Add event to cancel or change chat messages sent from server + csendek: Add event to cancel or change chat messages sent from server + +Build 6.0.1.342: + LexManos: Pickblock will new compare NBT data, should allow mods to refine there result better. + LexManos: Added system to place all configs that use Forge's Configuration function into a single file on disc. Optional config to enable this. Blame MattaBase for this idea.. + +Build 6.0.1.341: + LexManos: Fix ItemSeed placement to take into account the IPlantable interface. + +Build 6.0.1.339: + LexManos: Added a per-world MapStorage feature that provides a method to store data files associated with a specific world, as well as fixes the issue with villagers loosing there village. {Where villagers wouldn't go inside at night} + +Build 6.0.1.338: + pahimar: Update patches/common/net/minecraft/src/SlotCrafting.java.patch + Christian: + Fix the accessor and type on World.getPersistentChunksFor() + Update FML: 8bd98c3 + 8bd98c3 Fix a small problem with the new MCP container- it can cause NPEs. Nice. + 34cc42d Fix up some javadoc complaints + +Build 6.0.1.337: + Christian: + MCP information is now included in Minecraft Forge. They deserve the credit :) + + Update FML: 09eade4 + 09eade4 Update build - include MCP information in the source pack + 9bfe7df MCP deserves lots of credit. So here it is. + +Build 6.0.1.332: + Christian: + Update FML: 8006b77 + 8006b77 Fix instantiation bug + 7cc91cf Simple InterMod comms. Send a message using FMLInterModComms.sendMessage(). Receive messages through an @IMCCallback + 24d7285 Update for MC 1.4.2 + cedf3d5 Duplicate Mod display screen. + +Build 6.0.1.331: + LexManos: Downgrade to FML 415, issue with new IMC system. + +Build 6.0.1.330: + LexManos: Update to 1.4.2, obf stayed the same, so only small revision. + +Build 6.0.0.329: + LexManos: Update World patch to fix map provider issue. + +Build 6.0.0.328: + Christian: + Add an access transform for Block.setBlockBounds - should help a lot of code that uses this. + + Update FML: d915f39 + d915f39 Fix typo in access transformer + 346691c Fix the merge for forge + 6dadc1d Fix up references to minecraftDir in obf code + 8a55f68 Update FML for Minecraft 1.4.1 + 5645fa5 First update to 1.4.1, patches need updating. + ff0f00f Add some null checks, and throw descriptive exception when SideTransformer prevents a class from loading. + +Build 6.0.0.327: + LexManos: Update to MC 1.4.1 and Forge 6.0.0 + +Build 5.0.0.326: + LexManos: Fix color issues with Dyed Leather armor. + +Build 5.0.0.325: + LexManos: Remove deprecated code. + LexManos: Cleanup mirrored things in ShapedOreRecipe to address issue 208 and issue 210 + LexManos: Fix up the setHandeled/setHandled for events, it is now a generalized setResult, the meaning of which is defined by each event. + +Build 5.0.0.324: + LexManos: Fix NPE issue when mods add null EntityFX's to be rendererd. + +Build 5.0.0.323: + Christian: + Update FML: 7a34246 + 7a34246 Ship a client only class so the merge works both sides. + +Build 5.0.0.322: + Christian: Fix install.py so it can be installed properly from src distribution + +Build 5.0.0.321: + Christian: + Update FML (entire change log since last by me): 62a6b52 + 62a6b52 Fix RenderRegistry render ID - now at 36 Fix SpriteMaps - they're running out fast! Switch to forge if you can! RenderBiped now has an armo + b845cde Fix up FML python script for forge + 2c36dfb Update to MCP pre 3. Fixes some weirdnesses with explosions. + acd880d Merge branch '1.4' + e6f57e5 Update for MCP release + b1de0fc Remove fuzz from patches for INetworkManager change + ad44619 Fix for new names INetworkManager and ITexturePack. I also provide refactoring scripts for both, for your use... + 3a94211 Add a script to ignore git complaining about the eclipse workspace changing - run when you first open the eclipse workspace + 9386e23 Update gitignore - ignore the files that will change or be deleted + 10b318c Add in "starter" image for eclipse workspace + 995d5b7 Eclipse workspace fixup 2? + bbb12c8 Clean up eclipse workspace- part 1 + b50058e Clean up a bit of patch fuzz + 4a0bfa9 Fix CommonHandler for rename of the server thread class + 4d1ec66 Update with RC2 MCP. Use the joined.exc file directly since MCP now provides it. + b52e3d0 Fix exception for CodecMus + a1011c9 Fix some compilation issues. Requires resolving the worldclient abstract method + 0ebd4f3 Inital patch update to 1.4 + 89c68c4 Moved into EntityVillager + e4702cb Fix line ending detection during checkout. + 6e64fd7 We don't need logging here... + 014b3f4 remove useless -Server projects + 7628c67 Updated the AT config and Marker config for 1.4 obf + 54a322c Updae build to copy files that may decompile differently but are actually the same, and updated for 1.4 values. + aadf396 Update MCP Merge config. + 81e1855 Pull in MCP's 1.4 conf files. + 5686fd4 Fix error in merging of exec's + +Build 5.0.0.320: + LexManos: FML Update for 1.4 + LexManos: Fix recompile call for 1.4 MCP change + LexManos: Update Forge's AT for 1.4 names. + LexManos: Update for new names in 1.4 + LexManos: Remove final from 'villageCollectionObj' to allow for delayed setup of Map source objects. + LexManos: Moved to common where it should be + LexManos: No longer needed, getRenderDistance removed because Vanilla has it now, TileEntity.func_82115_m + LexManos: Forge spawn protection removed, now a vanilla feature. + LexManos: Patches that applied with little to no functional changes. + LexManos: Updated Render patches, Bipeds now have the ability to have helmets, of either blocks, or the new 'heads' + LexManos: BlockSnow now pretty much just passes harvestBlock to it's super. + LexManos: Entities have a new function to determine explosion strength that they create, and implemented Item frame pickblock. + LexManos: Patches removing forge spawn protection, now a vanilla feature. + LexManos: BlockCrops is now the parent class of multiple types of crops, Wheat, Potatoes, and Carrots, updated getBlockDropped patch to reflect. + LexManos: Removed Forge's TileEntity.getRenderDistance, now a vanilla feature: TileEntity.func_82115_m + LexManos: Teleporting has a new function (func_82448_a), made it so that you can supply your own teleporter to that function, and so it works with dimension movement factors. + LexManos: Updated World patch, there are a lot of new things happening int he constructor, xcomp should probably vet this. + LexManos: Updated Forge version to 5.0.0, for 1.4 + LexManos: Update release script for mcp changes, releases now build. + +Build 4.3.5.318: + LexManos: Remove some test code. + LexManos: Bump version to 4.3, final for 1.3.2 + +Build 4.2.5.317: + LexManos: Added ability for mods to cleanly define and display new creative tabs. + +Build 4.2.5.316: + Christian: Fix classloading issue preventing JRockit from running forge + +Build 4.2.5.315: + Christian: + Forge build change: the universal jar, if installed alongside a server jar file, can be executed to load forge. No server side merging required! + Update FML: 989ab3e + 989ab3e Update build.xml - add a classpath to the manifest. This means the universal jar is now a server side launche + 88f1dc9 Typos! + +Build 4.2.5.314: + Christian: + Update FML: 470a185 + 470a185 Try and avoid an NPE in crash reports + 0029518 Fix logging problems- log death messages and re-route the server through FML logs properly. + fe7a832 Fix the test mod + a2bc30b Coremods can be specified via the command line: fml.coreMod.load= This will help with developing coremods + bae1f74 Fix classpath for server + 887aa27 Add in the ability for a client to throw a custom exception that displays a custom gui instead of the default error message. + e17f267 Update FML internal classpath. Helpful for coremod devs + 3b9972a Don't use File to separate the last element of the path. It's a URL, they're always separated by '/' + 5c96afe Changed RelauchLibraryManager so that files with different paths on the same baseURL can be implemented in one ILibrarySet. + 1bca393 FML as a whole is now subject to transformers. + 27cf731 Bonus extra character. thanks randomitter! + 94c84cd Merge pull request #116 from Vazkii/patch-1 + c2d3195 Add Null check to FMLClientHandler.sendPacket + +Build 4.2.5.313: + LexManos: Make Item.createEntity only call when its specifically a EntityItem, not a subclass of it. + +Build 4.2.5.312: + LexManos: New Block hook to determine if it can be destroied by the ender dragon, for PR 199 + LexManos: Ship forgeversion.properties with release zips. Same format as fmlversion.properties. + LexManos: Dll files are binary as well. + +Build 4.2.5.311: + LexManos: Fill out the .gitattributes to help with line endings how they should be. + LexManos: Change the Crafting damage check to be the same as the usage damage check. (>= -> >) + LexManos: Allow hook into GuiSlot for background rendering for PR #203 + +Build 4.2.5.310: + Christian: Reorganize the forced chunks a bit- offload the cost of immutable map building to the mods, rather than the chunk tick + +Build 4.2.5.307: + Christian: Remove @SideOnly from removePotionEffect. Hi RichardG! + +Build 4.2.5.306: + LexManos: Add some accessors to teh ChunkLoader tickets. + +Build 4.2.5.305: + ohai.iChun: Fix not passing right render pass to Item class. + +Build 4.2.5.303: + Christian: Fix bounds checking on chunkcache. Should fix a bunch of rp2 and maybe other extended tile entity code + +Build 4.2.5.302: + Christian: + Use weak references to the worlds in our maps. WorldClient would otherwise + leak all over the show. + +Build 4.2.5.299: + mehvids: Add some of the model subsystem to the server. The part that doesn't require openGL. This allows for systems that dual models as collision/selection boxes etc. + xcompwiz: + Improves DimensionManager + + Adds handling for unloading and hotloading of worlds, fixes some typos, + allows for dimensions to be unregistered (allowing save specific + dimension registrations), general changes to match these features. + xcompwiz: + Adds world unloading and hotloading calls + + Adds world unloaded message to MinecraftServer on save. + Adds world unloading calls to chunk provider/manager when all chunks are + unloaded. + Adds call in MinecraftServer getWorld to hotload world if it isn't + loaded. + xcompwiz: + MapStorage Fix + + Fixes setting and timing of map storage object to allow for the + WorldProvider to use it during initialization + Forces single instance of map storage object (per side) + Moves setting of spawn to after provider setup + xcompwiz: + Lighting Time fix + + score_under's lighting fix that limits and fairly distributes the amount + of time spent on recalculating lighting + xcompwiz: + Server player concurrency fix + + Fixes an issue where the server can move a player while the player is + moving, process the player's last move (putting the player back where + they were before the teleport), and then complain about the player + moving too fast when the client catches up to it's new position. Also + fixes this issue while riding an entity. Only affects player + client/server movement sync. + Christian: + Remove dead WorldInfo patch. Tweak dimension code a bit for better naming, and use the new FML world loading facilities + Update FML: d0e7c9e + d0e7c9e Update patches *sigh* + f3e1cac Add in a savehandler strategy for reading and writing data to the world save. This service is only available to coremods via the WorldAccessConta + 51fb513 Add in some bukkit supporting code. Most of this is unimplemented until the bukkit coremod is complete. + 65c9fdd New stuff on the ModLoader! Risu has been busy. Closes #114 + c1d4458 Mods can now declare a range of minecraft versions they will run against + Christian: Update forge to 4.2 + +Build 4.1.4.298: + LexManos: Fix issue where light would not properly recalculate. + LexManos: Fix issue where mushrooms would not check the proper soil block. + +Build 4.1.4.297: + LexManos: Expanded DungeonHooks to allow for adding of custom DungeonLoot values directly, allowing for better control over the generated items. + +Build 4.1.4.296: + LexManos: Made PlayerEvent.BreakSpeed fire when a player cannot harvest the block. Issues #191 and #188 + +Build 4.1.4.295: + Christian: Dormant chunk cache might actually work now, and not mix chunks across worlds + Christian: + Update FML: ca1ca4f + ca1ca4f Fix maps supporting greater than byte() dimension sizing + 15ee8bf Fix language registry additions, closes #113 + a08b5b1 Merge pull request #112 from pahimar/master + 8dac58f Added ability to query the Language Registry by key and language for specific localized text, as well as loading in localization text f + +Build 4.1.4.294: + LexManos: Fix buckets, need to rethink for bukkit compatibility. + LexManos: Fix vanilla bug where the player would load chunks outside its range that would be 'abandoned' and never unloaded. + LexManos: Forgot comment, you see nothing... + +Build 4.1.4.292: + Christian: + A few requested features of ForgeChunkManager. Mods can specify a + chunkloading config directly in the config file, including chunk + loading overrides if they wish (and the config allows them). + Also added "player" tied tickets that bind to the player and not the + mod's quota. + +Build 4.1.4.291: + LexManos: Missing updates from last commit + LexManos: Location aware version og Block.lightOpacity for PR #169 + +Build 4.1.4.290: + LexManos: Fix bug in last commit that caused block to not break. + LexManos: Added preliminarty Player Interact event heavily based on the bukkit event. + +Build 4.1.4.289: + LexManos: Add PlayerEvent.HarvestCheck and PlayerEvent.BreakSpeed for dealing with things related to a player harvesting a block. + +Build 4.1.4.288: + LexManos: Fix bug where breaking texture would not apply to top/bottom of beds. + +Build 4.1.4.287: + Christian: Add in an "EntityEvent.EnteringChunk" event. Useful for your entity chunkloading stuff. + +Build 4.1.4.286: + LexManos: Support for no BOM. + +Build 4.1.4.285: + Christian: + Update FML: f083707 + f083707 Extreme headless mode is back! + +Build 4.1.4.284: + Christian: + Update FML: dd39ae5 + dd7502a Fix parent child counts showing properly. Closes #107 thanks scott! + b36d447 It's useMetadata, not usesMetadata. thanks myrathi and psx. closes #110 + efb1066 Fix random shuffling when manipulating biomes by using a LinkedHashSet to preserve iteration order. Closes #111 + Christian: + Some more tweaks to the chunkloading code. The world.load event fires slightly later- once the entity watcher is + set up, so entities can actually load into the server world. Also, tickets actually save and load properly + and null entities don't break the server + +Build 4.1.4.282: + LexManos: > != >= + +Build 4.1.4.281: + LexManos: Fix Configuration.getItem to return pre-shifted values suitible to pass into Item constructors. + +Build 4.1.4.280: + LexManos: Fire off PlayerDestroyItemEvent for crafting contianer items that get damaged to much. PR #183 + +Build 4.1.4.279: + LexManos: Configuration will now attempt to detect the encoding of the file using the Byte Order Mark. + LexManos: + Changed Configuration to use overloaded methods, and changed the order of arguments to be Category, Key, Value instead of Key, Category, Value to hopefully help cleanup some peopels code. + Added function to get a free Item id. Will only accept values that are not in the block space. Needs testing. + Marked all the old getOrCreate* functions as deprecated. + +Build 4.1.4.278: + Christian: Fix some errors if the config is unparseable. It should log an exception and carry on with defaults. + Christian: Support quoting in property and category names for almost all possible characters allowed + Christian: Fix up some config file handling to be even more resilient. + +Build 4.1.4.277: + Christian: + More modifications to the ticket callback handling system. There are up to two callbacks during world loading now. One to allow + selective preference for ticket types. The other to actually allow the mod to force chunks. + +Build 4.1.4.276: + Christian: + Update FML: dd39ae5 + dd39ae5 Try and fix the newline capture so consoles show on the server on windows again + b39f808 Readd ancient searge name so dan200 and computercraft can run again. REMOVE THAT CODE DAN. + Christian: + Some changes to the ForgeChunkManager. + Null modData is allowed now. + The entity id is actually properly persisted in the ticket now. + There is a new "orderedLoadingCallback" that allows you to provide a preferred ticket loading order in case of "excess tickets". Also, tickets + that are not in the returned list are now unregistered. + There is a way to resort the chunks in the forced chunklist on a ticket now. + Log the dormant cache configuration + +Build 4.1.4.275: + Christian: Simple chunkloading implementation + Christian: Working cross dimensional implementation of chunkloading for Forge. + Christian: + A lot of tweaks to the chunkloading for entity behaviour. Entities are now bound by a new + persistent id they *all* have, on the server side. + Christian: Remove @SideOnly flag for function now required on the server + Christian: Fix NPE in ForgeChunkManager + Christian: And a concurrentmodificationexception in the same code + Christian: + Simple chunk caching capability for the chunkloader. This will store "dormant" chunks in a + configurable cache, potentially saving the cost of reloading them from disk. + Christian: Delete some debug code + Christian: Some more fixes for chunkloading code. Works very reliably now. + Christian: + Update FML: a2c059e + a2c059e Fix missing import. Thanks ichun :( + 19316a0 Version file searching should work for directories too + fbc7a5c Fix bug causing NPE if non-whitelisted player joins an FML server without FML installed + e9cfd10 Merge pull request #103 from iChun/patch-2 + 1424883 Fixed ModTextureAnimation not updating and not binding to correct image. + +Build 4.1.4.274: + mitchpetrie29: + Update patches/common/net/minecraft/src/WorldProvider.java.patch + + Fixed WorldProvider.setDimension() setting the wrong variable. + LexManos: Fix patch errors in merge of last PR -.- + +Build 4.1.4.272: + LexManos: Fix accedental doubling of shift, Fixes saplings/flowers planting a space above where they should + +Build 4.1.4.271: + LexManos: New Plant API that allows for custom plants/soils. + +Build 4.1.3.270: + LexManos: Added new hooks for modifying the items generated in chests during world gen. + +Build 4.1.2.269: + LexManos: Redirect a lot of functions through WorldProvider for Mystcraft, allowing them to be overriden by the provider. + +Build 4.1.2.268: + CovertJaguar: Fixed Entity Item render helper + +Build 4.1.2.267: + ohai.iChun: Fix pick block key giving invalid spawn eggs + ohai.iChun: Logic derped + ohai.iChun: Logic derp (again) + +Build 4.1.2.266: + LexManos: Added side sensitivity to standard EntityDiggingFX, added Block functions to override spawning of digging and breaking effects. + +Build 4.1.2.265: + LexManos: Fix potential NPE in Custom item entity span code caused by item id misconfigurations. + +Build 4.1.2.264: + LexManos: Fix recursion issue with new special item entity code. + +Build 4.1.2.263: + Christian: + Update FML: 6c746ec + 6c746ec Tidy code + aacbfeb Change version.properties search slightly, allow access to found file from the preinit event + 1513b36 Add in the capability to read an internal version as .version from a file in the zip call versi + 35852a6 Fix up reversed assignment for version fallback + +Build 4.1.2.261: + pahimar: Changes to how PotionEffects are removed, now each PotionEffect can specify which ItemStacks can remove it's effect + pahimar: Inverted logic derp + +Build 4.1.2.260: + LexManos: Package all of paulscode/ with the universal jar to help mac users who cant understand how to merge folders -.- + +Build 4.1.2.259: + LexManos: Bump version to 4.1.2 to mark the end of todays changes. + +Build 4.1.1.258: + LexManos: Fix potential issue with custom events where the constructor is not visible from the EventBus class, Should never arise but meh. + LexManos: Read/Write config files as UTF-8 instead of ANSII, should fix issue with Turkish people. + LexManos: Allow for respawning in different dimensions. + LexManos: Move spawn fuzz to WorldProvider/WorldType, useful for VoidWorld types. + +Build 4.1.1.257: + LexManos: Make EntityJoinWorldEvent Cancelable properly + LexManos: Move Forge init message to MinecraftForge.initalize + LexManos: Add ability for Items to create custom Entities for themselves when added to the world, PR: #151 + +Build 4.1.1.256: + admin: Allow flight,player sensitive + +Build 4.1.1.255: + LexManos: Fix a few patch fuzzes + LexManos: Implemented isBlockFoliage for pull #141 + +Build 4.1.1.254: + LexManos: Clean up some javadoc warnings. + LexManos: + New EntityItem related events + Fixed player death event in SMP + Added Player specific drops event + Added generic EntityJoinWorldEvent + +Build 4.1.1.253: + LexManos: Fix FillBucketEvent to work with stacked buckets. New change in 1.3 + LexManos: EntityLiving variation of drawBlockDamageTexture to allow for Non-player viewports. + +Build 4.1.1.252: + Christian: Remove all references to ModLoader + Christian: + Update FML: 89b8236 + 89b8236 Fix onConnectionClosed not being called on the client side of a connection + +Build 4.1.1.251: + LexManos: Bump version to 4.1.1 + +Build 4.0.0.250: + Christian: + Update FML: 290a3c9 + 290a3c9 Merge pull request #94 from iChun/patch-1 + 9485dc5 Fix handleTinyPacket using short instead of int. + Christian: + Update FML: 70f55c5 + 70f55c5 Add in exclusion list for IFMLLoadingPlugin. + 1c1716d Remove debug cruft + d567f79 To properly align with packet9respawn, make packet1login's dimension an int as well + ecd4e46 Attempt to build some protocol negotiation, and fix packet1login so that the dimension is a short, matching packet9respawn + 16fe495 Compatibility level is now passed from server to client - and the client tracks it. This means certain packet changes can be made without b + 4f70d23 Fix dependency checking: you can depend on specific versions of FML + +Build 4.0.0.249: + Christian: + Update FML: e6abb69 + e6abb69 Fix up tiny packet handler to actually work + e862052 Allow javax to be shipped by mods. Should allow some more modloader mods to work unaltered + 4071ad1 Add in a little bit of protocol cleanup. Start work on allowing multiple protocol versions + 6061964 Give a way to build the packet131mapdata packet correctly populated + b818769 Capture and leverage Packet131MapData + +Build 4.0.0.248: + LexManos: Fix placing torches and the like on inverted woden slabs. + +Build 4.0.0.247: + Christian: + Update FML: 12bc4ba + 12bc4ba Make console logging pass through a single logging thread to avoid concurrency problems with launchers and stuff + 8fccfa2 Overlooked chat message support *sigh*. Fixes wierd mods that communicate through custom chat messages rather than + a697d04 Rescan mod packages where there was a possible mod identified to try and make sure we load it. Fixes Matmos r16 + +Build 4.0.0.246: + Christian: + Update FML: 9d812f1 + 9d812f1 And handle the other way to globally register an entity + 869cf78 Fix up mods trying to register entities outside of modloading. Now you'll get a big fat warning for doing such a de + 186680c Fix CJB mod compatibilty for real. Gui container registration can now happen in the constructor. YUK! + 5aed6d9 Fix compatibility with ModLoader dispenser hook. Fixes a bug with IDispenseHandler too - though it means that inter + 3d7a665 Fix headless operation, hopefully + +Build 4.0.0.245: + Christian: + Update FML: 10a7169 + + 10a7169 Fix up trying to re-add stuff to the classpath when it's already there + 0eb7180 Fix out of range entity id handling for ModLoader mods a bit more. Thanks Herobrine mod! + b1b4c61 Expose GuiMerchantButton + 359cfb5 Log a big fat warning for the developer in the case the network version is not acceptable to the mod itself. (This can happen because of a bad range specifier for example) + +Build 4.0.0.243: + Christian: + Update FML: 8656fd5 + 8656fd5 Also, make missing entity not blow things up + 25a4dcb Fix entity tracker "update" packet not computing correctly. Should work now.. + +Build 4.0.0.242: + Christian: + Update FML: c90a853 + c90a853 Fix up addRenderer to catch exceptions from the basemod, also, addrenderer now supplies a list of the default renderers from MC for editing and will note the + 18069d8 Change download location for FML libraries to files.minecraftforge.net, add an encoding param to the javac command line to force utf 8 + a40f4a7 Add in random jar/zip files to the classpath. UGH this is so fucking ugly it's not funny. + 5b6460b Use a null socket and try to prefer the result of getLocalHost in the broadcast data. + +Build 4.0.0.240: + Christian: + Update FML: c0d1348 + c0d1348 Add in an ItemRenderer null check so FML can run render adding mods + 482c163 Inverted boolean logic. Grrr. + 221d113 ModLoader mob spawns use packet 24- build a bypass system so that they can still use it + f19f426 Remove debug statements + +Build 4.0.0.239: + Christian: + Update FML: 9dd9b6e + 9dd9b6e Fix keybindings not loading properly from gamesettings file after restart + +Build 4.0.0.238: + LexManos: Fix silk touch on Ender Chests. + +Build 4.0.0.237: + t.tomkins: + Update patches/common/net/minecraft/src/NetServerHandler.java.patch + + Update patches/common/net/minecraft/src/NetServerHandler.java.patch + + Server mods can now use noClip to push players through solid blocks without is being an invalid move and resetting the players position. + + Useful for creating semi-solid blocks like quicksand. + +Build 4.0.0.236: + LexManos: Fix Issue #140: Custom items not properly having texture applied for partical effects. + +Build 4.0.0.235: + Christian: + Update FML: acb0b21 + acb0b21 Fix so we always send received packets to handlers. Renders 250 filtering useless unless i can figure a way to intercept + +Build 4.0.0.234: + Christian: + Update FML: b17dd3c + b17dd3c Some tests + fa66ffa Fix trying to load the client side packet handler, when on the server, hopefully? + b106420 Fix up network negotiation - now it will disconnect with a nice error screen if there are missing mods on the client vs se + +Build 4.0.0.233: + Christian: + Update FML: c971adb + c971adb Fix missing addCommand call: thanks "spawnwolf test command" + d6326de Fix a couple of modloader mods. Thanks! + 483667c Some functionality fixes for @Instance injection. + 8bef512 Versions now have two flavours: the @Mod(version) which is the "programmatic version" and is used for all version relationship calculatio + 501009c Always for ML mods into "public" class accessibility - we don't call from the default package like ML does. + d3d4308 Add in a convenience method for getting a class instance based on existence of another Mod. Useful for soft dependencies. + +Build 4.0.0.232: + Christian: + Update FML: 2d9b88b + 2d9b88b And more mod sorting fixes. + 93d5934 Actually *use* the sorted mod list + +Build 4.0.0.231: + LexManos: Fix FillBucketEvent to actually fire. + +Build 4.0.0.230: + LexManos: Fix call to createTileEntity on blocks that extend BlockContainer. + +Build 4.0.0.229: + Christian: + Update FML: 180a279 + 180a279 Merge pull request #82 from Chicken-Bones/master + cf38461 The access transformer will now handle classes in packages. + 2c85539 Reverse the meaning of state in fml.modStates system property and fmlModState.properties - it was very derpy before. Now: true is enabled, false is disabled, as you would expect + d651189 Actually fix the corrupt JSON problem + f6a8cd5 Fix isModLoaded for "disabled" mods, and the toposort as well + 3bde961 A bit more information for dependency handling + 6396bea Fix up handing corrupt mcmod.info + 6bc6def Fix a problem with network ids + 7328610 Fix up version handling properly. Hopefully, and the error screen. + 9fcc452 Only active mods should have dependencies checked, and be sorted + 26302a6 Fix oddity with Screen, print a version out in the sorted list! + +Build 4.0.0.228: + Christian: + Update FML: 62dbfb3 + 62dbfb3 Fix metadata + +Build 4.0.0.227: + Christian: + Update FML: b91cbe9 + b91cbe9 Fix up versioned dependencies so they work a lot better, also add in a missing mods screen + +Build 4.0.0.226: + Christian: + Update FML: 93b8ba9 + 93b8ba9 Fix missing serverSendPacket + 23fdbbd Trading support for ModLoader - thanks Herblore! + d7a74d8 Close the jar, for cleanliness sake + 58e6dd9 Fix authors - it'll read both "authors" and "authorList" from the json now + 907cf2d More ML compatibility - fix up dragon mounts, thanks! + ee48a36 Fix up loading mods that are grandchildren of BaseMod + c6f362b Fix entity handling for ModLoader mods, thanks parachute mod! + +Build 4.0.0.225: + LexManos: Fix lighting issue for air related to 4096 fix. + +Build 4.0.0.224: + LexManos: Made helper hooks for EntityLiving and EntityRenderer hooks for Optifine + LexManos: Removed deprecated ISpawnHandler, that never worked in 1.3.2 so noone should be using it. See FML's replacement. + +Build 4.0.0.223: + Christian: + Update FML: 6e01c59 + 6e01c59 Merge ChickenBones pull into FML - adds player trackers + a0cbd37 More precise error handling when an invalid class is present + 12323e2 Fix textures not applying properly + 789a4a3 Fix up entity spawning - hopefully they won't warp anymore. + a87d045 Add in a helper on the server start event for adding commands to the server. + 82e9309 Move villager trading hook up a bit. thanks sengir. + 8deaa37 Fix LAN to try hard to find a real network interface, not just localhost most of the time + b5363e3 Update build to not bother building client jar. Universal is everything now. + +Build 4.0.0.222: + LexManos: Pickblock now replaces the currently selected item if it could not find a empty space. + +Build 4.0.0.221: + dvrabel: + Use original minecart drag co-efficients for regular carts. + + Since the amount of speed lost is 1 - co-eff, rounding 0.997 to 0.99 + makes a big difference to the distance a minecart will travel (less + than half of the distance in vanilla 1.25). + +Build 4.0.0.220: + LexManos: + Update FML to 304: + Client side only classes are properly annotated, and denied loading on server side + Added missing client side only ModLoader.getContainerGUI function + Guis work for FML mods now. + Fixed MLProp handeling of null info + Fix up dispenser handling, add in new params for the dispenser: breaks IDispenseHandler, sorry + Christian: + Update FML: 28a10ac + 28a10ac Null protection for ticks() -- probably should uses EnumSet.noneOf() but you can also use null now to stop ticking. closes #77 + c349d51 Automatic mod entity registration into the global entity list. This might break entity code out there, sorry, but this way for most entities you no longer need to manage the global mod entity stuff at all. just remove it. FML will take care of the rest (note, worlds won't load the old entities) + ef01745 Add in a utility function that *might* tell you the context you're running in on either client or server: FMLCommonHandler.getEffectiveSide + c97d6a6 Try and stop sendPacketToAllAround from being crashy + 2062273 Mods can add mod specific crash information to the crash report now Forge needs to implement MinecraftForge.getCrashCallable + 6e6436e Fix up dispenser handling, add in new params for the dispenser: breaks IDispenseHandler, sorry + 38f4a22 Fix up MLProp handling for null info + 3a8b047 GUIs working in FML for ML mods + 52483ee Support gui opening for Shelf mod + dce1cbc Updated MCPMerger to annotate unique classes with there sides, and SideTransformer to null out any class that is loaded on the wrong side. + +Build 4.0.0.217: + LexManos: Updated onItemUseFirst call to include the new hit vector information, and updated readme. + +Build 4.0.0.216: + LexManos: Added missing server side onBlockStartBreak hook, fixes Sheers. + +Build 4.0.0.215: + LexManos: Fixed Forge's 4096 block filler initalization. + +Build 4.0.0.214: + LexManos: Fix IndexOutOfBounds exception, Major derp. + +Build 4.0.0.213: + Christian: + Update FML: 46c563a + + 46c563a Expose more of the village construction parts for building village piece + 1380c2e Allow access to the type "ComponentVillage" + 71a3818 Documentation and registration for villager stuff + e3a343c Fix javadoc derp + 195b1a0 Villager trading, manipulation and village enhancement. Still WIP but sh + 69e66c3 Fix exception based logging to actually log the exception! + +Build 4.0.0.212: + Christian: + Update FML: + 885637c Fix up keyboard events for modloader + 90a7c8f Pickup notification + +Build 4.0.0.211: + LexManos: Changed order in which EntityItemPickupEvent is called, it will no longer be called if the 'delay' on the item is still active. Also EntityItems that are in the world with invalid item stacks will now kill themselves. + +Build 4.0.0.210: + mitchel.pyl: Adds a SkyProvider class that can handle the rendering of the sky + +Build 4.0.0.209: + Christian: + Move and add a few AT for forge: rail and leaves stuff mostly + Update FML (reorg some AT for FML vs forge): + 2171c0c Update fml_at with new transforms + 924a6f9 Fix derp where client sided packet handler would be created on a dedi server env + ad4cffb Add in support for "dummy" keybindings- ones that are added to the list but never do anything so the mod can handle it all themselves. + cf77ffb Don't complain about minecraft source code being in "net.minecraft.src". Derp. + b2fdcd7 Fix ModLoader add XP Smelting + 094ce2a Actually register client/server packetspecs as their correct sides! fixes #71 + +Build 4.0.0.208: + LexManos: Fix MC packet bugs for remote servers that use blocks with ids > 256 + +Build 4.0.0.207: + LexManos: Fixed bug in EntityMinecart that would cause them to fall through the ground at the bottom of slopes. + +Build 4.0.0.206: + Christian: + Update FML: + + e8cb2c1 Error if channel name is invalid - either too short, or too long + 9c6c56c Add a connect and read timeout for downloading libraries. This should really stop the "waiting forever" at startup screen. + 0d5affe GIANT FAT WARNINGS if you use any code in net.minecraft.src or any subpackage thereof. Get it out of there, now! + 13f210f Fix up ML GUI ticking. Thanks sharose! + +Build 4.0.0.205: + LexManos: Fixed EntityEvent.CanUpdate + LexManos: Fix EntityItemPickupEvent 'pop' sound spamming. + LexManos: Added timeout to MC's download of sound resouces. + LexManos: Update WorldProvider.path diff. + +Build 4.0.0.204: + Christian: + Update fml: + c61ad51 Organize ALL the imports + c0842b0 Expose the server in serverstart event + 2851079 Fix up directory injection of log file locations + 5197524 Refer to FMLLog, not FMLRelaunchLog + 78efd1a Tidy up server launch - reflection not required anymore + eee0a99 Also, log what the directory discoverer finds for mcmod.info + 10c96c3 And log the exception if it has a problem reading the jar file + 07cc3fb Fix jar loader failing to inject any metadata at all if mcmod.info is not found. + e31f143 Change install.cmd to install.bat, why, cuz people are .... Updated readme to mention needing server and client. + +Build 4.0.0.200: + LexManos: Allow white space in the property name. + Christian: + Update FML to include some ML compatibility fixes. Minimap should run, assuming he + recompiles against standard ML interfaces. + This updates to official MCP 7.2, so you'll need to rebuild your workspace (some + small but important patches to MCP went in) + +Build 4.0.0.199: + Christian: Update FML, make the .sh scripts executable + +Build 4.0.0.196: + LexManos: Update FML to 285 + +Build 4.0.0.194: + draake: Added additional sound events to allow manipulation of a sound source at its creation. + draake: Removed SoundSetListenerEvent implementation. + +Build 4.0.0.193: + LexManos: Fix potential index exception in ForgeDirection + LexManos: Whops + +Build 4.0.0.192: + LexManos: Rename Orientation to ForgeDirection {Damn MCP naming a class Direction already} + +Build 4.0.0.191: + LexManos: Update FML again for mod screen blending fix. + +Build 4.0.0.190: + LexManos: Updated Orientation with new helper functionality. + LexManos: Fix ItemBlock placement, should fix RP Deployers placing blocks 1 tile down. + LexManos: Seperated block placmenet logic in ItemBlock as immibis requested: https://github.com/MinecraftForge/MinecraftForge/pull/110 + LexManos: New Command event. + LexManos: Fix issue with default getContainerItemStack + LexManos: Add render distance property to TileEntity. + +Build 4.0.0.189: + LexManos: Updated FML, should fix the new included eclipse workspace. + +Build 4.0.0.188: + LexManos: Cleanup repo, delete old code + LexManos: Update FML to 278, MC 1.3.2 + LexManos: Cleaned up forge scripts, and updated AT config for 1.3.2, deleted any reference to server specific code. + LexManos: Updated patches to 1.3.2 + LexManos: Fixed bug in DimensionManager that would cause Index error for custom dimensions, also made WorldProviders aware of what dimension they are. + +Build 4.0.0.187: + LexManos: Readded patch to allow for use of custom teleporter for transfering dimensions. + +Build 4.0.0.186: + LexManos: Update FML with entity spawning fixes + +Build 4.0.0.185: + LexManos: Updated FML, should fix 'derp?' RuntimeError + +Build 4.0.0.184: + LexManos: Fix PickBlock 'ghost item' bug when picking with a item selected. + +Build 4.0.0.183: + LexManos: Update FML, Tons of bug fixes and proper merging of client and server. + LexManos: Delete Forge server projects + LexManos: Update debug settings to use Client's internal MinecraftServer.main to debug dedi-server env. + LexManos: Update release script to create universal binary distro. + +Build 4.0.0.182: + j.marini: Fix bug where default bonemeal behavior wouldn't trigger. Only return if the event was canceled. + +Build 4.0.0.181: + LexManos: Update FML, new AT features, and error info. + +Build 4.0.0.180: + LexManos: Fixed ItemRenderer not grabbing custom texture files properly for block items + LexManos: Updated FML + LexManos: Delete dead IGuiHandler + LexManos: Update AT config to expose some block functions and a few extras. + +Build 4.0.0.179: + LexManos: Should fix commands.py patching not working properly first run. + +Build 4.0.0.178: + LexManos: + Updated FML, Should fix a lot of installing issues for MCP. + Made patches error and not apply if the target file is not found. + Updated Event Transformer to add a default constructor... + Fixed 4096 setup code in MinecraftForge.initalize() + +Build 4.0.0.177: + LexManos: Fix issue in install script for users with spaces in there paths. + +Build 4.0.0.176: + LexManos: Update FML, server should run now. Still issue with NPE with no mods installed. + LexManos: Updated FML, fixed custom tool hooks, and spawn protection/player reach hooks. + +Build 4.0.0.173: + LexManos: Fixed Diemsnion API related NPEs, and updated FML to 231. + +Build 4.0.0.172: + LexManos: Get rid of all old patches + LexManos: Added a better eclipse workspace for deving Forge + LexManos: inital push of updated setup script and cleaned up forge.py + LexManos: Dump old mcp config + LexManos: New Start.java which allows the user to login using a legit account for testing on servers. + LexManos: Committing inital work on generating sanitized MCP conf data. + LexManos: Add the direct copied files from MCP conf + LexManos: Add newids to that list + LexManos: Helper function grab all unique searge names that are shared client and server + LexManos: Added merging fields/methods/param csv files. And updated FML to 197 + LexManos: Remove eclipse files from old eclipse projects + LexManos: Updated build.py + LexManos: Update FML + LexManos: + Moved logo to new client folder + Added blank Access Transformer config for Forge + Implemented version storage + Added basic dummy FML mod container to remove the need for mod metadata file + Added beggining work on Forge event system + Updated and moved EnumHelper + LexManos: Updated update_patches.py, and made first patch! + LexManos: Moved paulscode to new client folder + LexManos: First push of some small patches and introduction of basic events. As well as the first cases for Forge's Access Transformer + LexManos: Missed a file + LexManos: Moved in OreDictionary stuff to new system. IOreHandler is replaced by OreDictionary.OreRegisterEvent + LexManos: Renamed MinecraftForge.eventBus to EVENT_BUS as it's constant. + LexManos: Implemented BonemealEvent (IBonemealHandler replacement), and bonemeal making grass. + LexManos: Implemeneted adding grass seeds, as well as IShearable for BlockTallGrass + LexManos: More progress on converting patches from 1.2.5 + LexManos: Some more patch migration before bed. + LexManos: + More patches converted. + Refactored some of the events to be a better hiarachy. + LexManos: A bulk of more patches converted, updated fml + LexManos: Moved some files. + LexManos: More work, moved over packet stuff, need to change everything to use new NetworkMod system + LexManos: More conversions, added all the entity living events. + LexManos: Finished World and EntityMinecart patches. + LexManos: Removed a lot of old files + LexManos: Updated Client side patches for the new Merged MCP workspace. + LexManos: Nope, unneeded patch + LexManos: Cleaned up some more, fixed infinite loop with cancelable annotation, Client now compiles and enters world just fine. + LexManos: Delete conf, server compile, update fml, and fix install script. + LexManos: Copy forge files over in install. + LexManos: Update fml + LexManos: Moved over Configuration + LexManos: Fix oreientation bug causing levers not being able to place. + LexManos: Added new pick block hook for blocks and entites to allow for better grained control of the result. + LexManos: Include Forge's AT config into redist zips. + LexManos: Update fml, impelemnted Diemsnion API stuff. + LexManos: Updated FML, updated patches + +Build 3.4.9.171: + Christian: Normalize the repo + LexManos: Rebase + LexManos: Bumped version to 3.4.9, final commit for 1.2.5. + +Build 3.3.8.170: + someh4x0r: Fix BlockTrapDoor.disableValidation on server + +Build 3.3.8.164: + LexManos: Should fix NPE on older ISoundHandlers EXA: http://minecraftforge.net/forum/index.php/topic,759.html + +Build 3.3.8.163: + Christian: Update fml with recent tick fix + +Build 3.3.8.162: + truebrain: + -Add: sync serverPos[XYZ] on spawning of entity + + This fixes the issue that, up to 400 ticks from getting in range, + entities have a wrong offset (because server and client don't agree on + the position to calculate relative updates from) + truebrain: -Fix: check for null where needed + truebrain: -Codechange: applied LexManos' request + +Build 3.3.8.161: + LexManos: Fixed a improper rounding in EntityMinecart + LexManos: Made WorldGenMinable metadata sensitive. + +Build 3.3.8.160: + Christian: Update fml to 175- fixes some weird ticking behaviours for ML mods, adds in new ticking behaviours for smart mods + +Build 3.3.8.159: + LexManos: Moved licenses and credits into install folder. + LexManos: Removed symlink files, shouldn't be in the repo. + LexManos: Updated some remaining scripts to call there python versions. + +Build 3.3.8.158: + LexManos: Fix furnaces not smelting the proper number of results after the first one. Damn you tahg, fix this! Keeps falling through my cracks. + +Build 3.3.8.157: + Christian: + Fix server check "blockHasTileEntity" used to determine if getDescriptionPacket + is sent for the block to be metadata sensitive. Thanks iChun! + +Build 3.3.8.156: + Christian: Fix ghost players who appear if they don't have the 4096 fix installed + +Build 3.3.8.155: + LexManos: Fix container creative to not add Blocks above 256 unless it's told to. + +Build 3.3.8.154: + Christian: + Fix world provider behaviour: WorldProvider.byDimension should always return + a new instance- otherwise you can end up with worlds overwriting one another + +Build 3.3.8.153: + LexManos: Fixed isBlockReplaceable and placing ItemBlocks' + +Build 3.3.8.152: + LexManos: Fucking spelling nazis + +Build 3.3.8.151: + LexManos: Fix bitmask bug related to 4096 in multi-block change. + LexManos: Updated FML to build 153 + +Build 3.3.8.150: + LexManos: Fix NPE related to server/client not having block ids synced properly. + LexManos: Add option to randomize potential spawn locations to have a more randomly dispersed spawn patern, useful for games like FTB vs. + LexManos: Added configuration option to disable the darkroom mechanic. For servers who wish to not risk destruction at one broken pipe. + +Build 3.3.8.148: + LexManos: FML 150, more tick related work. + +Build 3.3.8.147: + LexManos: Close inputstream + +Build 3.3.8.146: + LexManos: More bugfixes related to portal generation. Should be all now. + +Build 3.3.8.145: + LexManos: Some 4096 I missed in custom renderers. + LexManos: Updated to FML 149, should fix all ticking issues with ModLoader mods + LexManos: Fix Vanilla bug where nether portals would not work above 127 + +Build 3.3.8.144: + LexManos: Updated to FML build #142, fixed FML compilation issue causing missing files when reobfing. + +Build 3.3.8.143: + LexManos: Updated release script to automatically inject version info into .info file. + +Build 3.3.8.142: + LexManos: Updated to FML 141, should fix ticking issues with certian mods, and crash issue with TropiCraft + +Build 3.3.8.141: + LexManos: Bumped version number for new IEntityLiving interface. + +Build 3.3.7.140: + pahimar: Typo in the new EntityLivingHandler code + +Build 3.3.7.139: + LexManos: Made setFailsafeFieldValue public for Rob + LexManos: Implemented enchanced EntityLiving events. Thanks Atomic for parts of it. + +Build 3.3.7.138: + LexManos: Few more cases for 4096, thanks TrueBrain + +Build 3.3.7.137: + LexManos: Forgot Configuration in 4096 change. + +Build 3.3.7.136: + LexManos: Configurable kick message when you don't have forge. + LexManos: Initial 4096 fix based of mDiyo's work. + +Build 3.3.7.135: + LexManos: Fixed bug in new entity sound hook. + +Build 3.3.7.134: + LexManos: Updated to FML #135 {Fixed ModList rendering issue, and incorrect arument on crafting hook} + LexManos: Added new ISoundHandler.onPlaySoundAtEntity hook. Should be backwards compatible with any older ISoundHandler implementations. + LexManos: New onChunkUnload event for TileEntities, for psxlover. + LexManos: Bumped version number to 3.3.7 for full release. + +Build 3.2.6.132: + LexManos: Fixed concurent modification exception in the ore registry. + +Build 3.2.6.131: + LexManos: Fix for potential concurancy modification exceptions + +Build 3.2.6.130: + LexManos: Fixed possible NPE when blocks havent fully initalized yet. + +Build 3.2.6.129: + LexManos: Updated FML to 132, TextureFX fix, and bumped revision to 6. + +Build 3.2.5.128: + LexManos: Added bouncer functions for functions we removed. Makes MagicLauncher shut up about missing functions {not actually missing}, and therefor makes users stop thinking its a life or death error. + +Build 3.2.5.127: + LexManos: New Ore Dictionary recipies. Allows for simpler Ore Dictionary integration with recipies. IOreHandler should no longer be used. + +Build 3.2.5.126: + LexManos: Updated to FML 130 + LexManos: Added hackish workaround for Tessellator.textureID to provent crashing while we wait for Optifine to update. + +Build 3.2.5.125: + LexManos: Server side of ITextureProvider for Block/Item for compilations sake. + +Build 3.2.5.124: + LexManos: Backwards compatibility fix for ITextureProvider + +Build 3.2.5.123: + LexManos: Updated FML to 121 to fix world tick issues. + +Build 3.2.5.122: + LexManos: Updated MCP mapings. Moved the bulk of custom logic from RenderItem to ForgeHooksClient. + LexManos: All Items and Blocks now implement ITextureProvider, and have a setTextureFile(String) function, to support cleaner code in Mods and in Forge. + LexManos: Tag each Tessellator with it's associated texture ID. + +Build 3.2.5.121: + LexManos: Added kick info to disconnect event, updated to FML 120, keybindings, better image rendering in ModList ui. + +Build 3.2.5.120: + LexManos: Fix bug in cart functions where would always return null. + +Build 3.2.5.119: + LexManos: Fixed some inverted logic causing tress to not gen correctly. + +Build 3.2.5.118: + LexManos: Update FML to 117 + +Build 3.2.5.117: + LexManos: New Hooks addedf for custom tree/leaves. And better interaction with trees growing and rerplacing certain blocks. Should allow for ExtraBiomes to behave nicer, and RedPower to make there blocks un-breakable by trees. + LexManos: Also, new hook in last commit for blocks to determine if they are able to be replaced by ores, for any mod that adds new world gen. Bumped revision up. + +Build 3.2.4.116: + LexManos: We now bundle CodexIBXM from PaulsCode. See http://paulscode.com http://www.paulscode.com/forum/index.php?topic=4.0 and the included license files for more info. + LexManos: Updated to FML 115, added Forge Logo to the client dist, and in-game ModInfo page. + +Build 3.2.4.115: + LexManos: Updated to FML build 114 + +Build 3.2.4.114: + LexManos: Included fmlversion.properties in the release zips. + +Build 3.2.4.111: + LexManos: Added FML ReadMe, Credits, and License to release zips + +Build 3.2.4.110: + LexManos: Update FML to 92, this include full client side support, ModLoader nolonger needed. + LexManos: Added new source clean step to fix linux vs windows astyle issues. + LexManos: Cleaned up names for Minecraft Forge's text files so they dont clash with other mods. Fixed up the release script to include the license text, and executable permissions for install.sh. + LexManos: Added FML mod info file + LexManos: Updated MCP Mapings and patches. + LexManos: Updated patches for FML, moved some extranious code to Forge classes instead of patches. + LexManos: Updated to FML Build 95 + +Build 3.2.3.108: + LexManos: Bump version number for official release. + +Build 3.1.3.107: + LexManos: Fixed AudioMod compatibility with MultiMC style launchers. + +Build 3.1.3.106: + LexManos: Bit masked the entity ID to change the range from -127-127 to 0-255 + +Build 3.1.3.105: + LexManos: Updated MCP Mapings + +Build 3.1.3.104: + LexManos: Added forge identifier to statistics collection. + +Build 3.1.3.103: + LexManos: Fix for furnaces not smelting the final item in full stacks. + +Build 3.1.3.102: + CovertJaguar: static final vars are inlined during the compile step, making the version variables useless at runtime. + LexManos: Fixed Levers droping off the backs of stairs client side. + +Build 3.1.3.101: + LexManos: New block hooks for creating custom beds. + +Build 3.1.3.100: + cpw: Update to FML 74: fixes an important issue with MLProp + +Build 3.1.3.99: + LexManos: Bumped revision to 3 + +Build 3.1.2.98: + LexManos: Fixed Vinella mob spawning bug that prevented mobs from spawning on the top most chunk. Added new Block function to determine if a Mob can naturally spawn on the block. Add new hook to allow for special case handeling on natural entity spawn. + +Build 3.1.2.97: + LexManos: Fix for loading Minecart Entities in worlds that were last accessed before Forge was installed. + +Build 3.1.2.96: + LexManos: Moved MLMP compatibility functions to ModCompatibilityClient, and fixed issue where no vehicles would be spawned. + +Build 3.1.2.95: + LexManos: + New ISoundHandler interface, useful for adding custom sounds and dealign with sound based events. + Includes basuic AudioMod compatibility. + +Build 3.1.2.94: + LexManos: Fixed vinella bugs when trying to access chunk information with a y < 0 + +Build 3.1.2.93: + LexManos: Updated to FML build #73 + LexManos: Added MLMP hook invocation for vehicle spawn and opening GUI's to provide compatibility for clients that have both ModLoaderMP and forge installed. + +Build 3.1.2.92: + LexManos: Exposed TileEntityData packet to TileEntities. And added helper sender function. + +Build 3.1.2.91: + LexManos: Added metadata sensitive Chunk constructor for Bioxx + +Build 3.1.2.90: + LexManos: Added MinecraftApplet.clas to the force output list because users cant understand the concept of only replacing files they are told to. And bumped version to 3.1.2 + +Build 3.0.1.89: + LexManos: made the ID in PacketEntitySpawn unsigned. + LexManos: Added generic packet sending function to MinecraftForge class. + LexManos: Fixed shift-clicking issue with items that utilized the new ItemStack sensitive smelting system. + LexManos: Implemented a 'small' packet system for those mods that need to send rapid, small data packets and who are concered about the overhead of the 250 payload packet. It uses packet 131. + +Build 3.0.1.88: + LexManos: Implemented RichardG's Paged Achivement list GUI modifications. + +Build 3.0.1.87: + t.tomkins: Edits enable use of EntityPlayer.canHarvestBlock (for PlayerAPI) when the ToolClass has no rules for the block. + +Build 3.0.1.86: + LexManos: MAX_ENTITY_RADIUS Now works on the Y axis + LexManos: Respawning in dimensions should now properly set the dimension ID for the new player instance. + +Build 3.0.1.85: + LexManos: Fix for vanilla crash for chunk generation with block ID's above 127. + +Build 3.0.1.84: + cpw: Update fml to build 68: fixes a ticking issue and soft vs hard dependencies + +Build 3.0.1.83: + LexManos: + Changed entity Forge spawning code works to be more in line with normal spawning: + (World, double, double double) constructor is nolonger called, normal (World) constructor, and setPositionAndRotation is called afterwords. + yaw, pitch, and yawHead is sent (if the entity isn't a EntityLiving yawHead isn't used) + The datawatcher data is also sent like a normal Entity. + +Build 3.0.1.82: + LexManos: Fixed bug in BlockFire's old fields. + LexManos: Added variable entity radius to World, to be used if a mod make really large entities. + +Build 3.0.1.81: + LexManos: Fixed TileEntity bug that was causing Ghost tile entities. + +Build 3.0.1.80: + LexManos: Multi-pass item rendering now uese proper render pass number. + +Build 3.0.1.79: + LexManos: Added slope velocity hook for Covert + +Build 3.0.1.78: + LexManos: Fixed bugs in the Dimension transfer code, Now displays proper join message, and respawning in dimensions other then 0 works. + +Build 3.0.1.77: + CovertJaguar: Added a function for checking block harvest levels without having to resort to reflection. + LexManos: Try to fix jenkins build. + +Build 3.0.1.75: + LexManos: Added ItemStack sensitive burn time hook. + +Build 3.0.1.74: + LexManos: + Added new Item function to allow for multiple rendering passes. + Fixed a vinella bug where item layters would not line up for EntityItem's + Added new IItemRendere helper flag for 3d block translations. + +Build 3.0.1.73: + cpw: Update fml to 62- provision a server console command and fix mod loading order + cpw: Update FML for new hooks: onPlayerLogout and onPlayerDimensionChanged + LexManos: + Rewrote IItemRenderer to be a more generic and expandable version, Breaks previous interfaces, but this should be the last time the interface changes. + Implemented the MapRender hook ChickenBones requested. + +Build 3.0.0.72: + cpw: Fix separated login/announce handler + cpw: FML 59: don't send a zero length register packet, add mod channels + +Build 3.0.0.71: + cpw: Update to FML 57: fixes FML not calling it's login handler code + +Build 3.0.0.70: + LexManos: MCP Conf update for 1.2.5 + LexManos: Initial patch update to FML and MC 1.2.5 + LexManos: Deleted patches + LexManos: Fixed update_patches.py to now delete old patch files that have no working src relation + LexManos: Updated repo scripts to python, allowing more flexability and less code duplication. + LexManos: Finished up converting the source dist install scripts to python. Fixed a couple issues with the other scripts. + cpw: Update patches for FML fix. + cpw: Fix release script to import "inject_version" + cpw: Add in recent fml with fixes + cpw: Delete the old one too + LexManos: Rewrote the login code to delay full login untill forge fnishes negotiating network IDs. Should fix entities not having proper ID mapings. + LexManos: Added ChickenBones's request ITextureLoadHandler hook + LexManos: Updated patch for mapings + LexManos: Implemented ISaveEventHandler as ChickenBones's requested. + LexManos: Add server spawn protection config option as per someh4x0r's request. + LexManos: Couple of output fixups and added script to be executed by Jenkins during the build. First test build. + LexManos: Changed IGuiHandler's signature to be compatible with both sides. Took out ModLoaderMp reference in README. + +Build 2.0.0.68: + LexManos: Fix some shadowing warnings. + LexManos: Some cleanups to update_patches, should run properly on any system now. + LexManos: Add IChunkLoadHandler.canEntityUpdate() function to allow entities to update while in custom loaded chunks. + LexManos: Implemented a chat event handler system to allow for manipulating and handeling the various chat/command events. + +Build 2.0.0.67: + LexManos: Changed update_patches script to use python for the bulk, Prevents making 1800 temporary useless files. + LexManos: Fixed camelcasing in IConnectionHandler, ment to do during first upgrade. + +Build 2.0.0.66: + LexManos: Fixed typo bug in MinecraftForge.getEntityTrackerInfo + +Build 2.0.0.65: + LexManos: + Updated to MC: 1.2.4 MLMP: 1.2.4 v1 + Removed all code that was marked as deprecated, IE: ICustomItemRenderer, and the functions in Configuration + +Build 1.4.1.64: + LexManos: Reworked EntityPlayerMP.openGui to hopefully be more compatible with PlayerAPI + +Build 1.4.1.63: + LexManos: Cleanup the EffectRenderer patches, Allows custom food items to have the proper particals. Cleaned up special case class in favor of basic java generics. + +Build 1.4.1.62: + CovertJaguar: Added the ability to define custom categories for config files. + CovertJaguar: Removed createCategory() function and changed it to create categories as they are encountered. + LexManos: Updated MCP mapings + LexManos: + Fixed a couple of bugs in the Configuration categories pull request. + Added helper functions to Property for standard int/boolean usage. + LexManos: Added rider sit pull request. + +Build 1.4.1.61: + LexManos: Fixed NPE on CustomPayload packets with 0 data + LexManos: Changed logic in Configuration to allow for extended block ID mods easier access to change that. Just use reflection to change Configuration.configBlocks to whatever length you want. + LexManos: Implemented Pheenixm pull request allowing for more control over the camera. + LexManos: + Added MinecraftForge.isClient() function that returns true if you are in the Minecraft Client, (As defined as net.minecraft.client.Minecraft existing) false otherwise. + Fixed a typo on PacketEntitySpawn that caused speed to be assigned improperly. + A little code cleanup. + +Build 1.4.1.60: + LexManos: Fixed a few typos that CovertJaguire found in The Forge entity handeling code. And re-wrote the connection sequance so that clients get a list of mod ids before anything else. + +Build 1.4.1.59: + LexManos: Readded the deprecated interface ICustomItemRenderer. Added method to enforce deprecation cross Minecraft versions. + +Build 1.4.1.58: + newthead: Added new item render interfaces to Forge client + newthead: Added hook for rendering equipped items + newthead: Clarified render option for inventory items + newthead: Added remaining item render hooks, and fixed a static method access + newthead: Added render code for inventory items and entity items. + newthead: Cleanup/fix item render hooks + newthead: Added additional flag for rendering entity item bobbing + newthead: Merged item rendering interfaces into a single IItemRenderer + newthead: Updated render hooks and registration to use the IItemRenderer interface + newthead: Modified patches to use new item render hooks + newthead: Merged item rendering interfaces into a single IItemRenderer + CovertJaguar: Fix for network code. + newthead: Changed render hook checks to all use ItemStack instead of itemID + newthead: Reverted vanilla texture binding to an explicit if() statement based on item ID + LexManos: Fixed dyes showing twice in creative list + LexManos: Bumped version number to 1.4.1 + +Build 1.4.0.57: + LexManos: Fixed tile entities not properly being removed for blocks that do not extend BlockContainer, or override BlockContainer.onBlockRemoval + +Build 1.4.0.56: + LexManos: Fixed excessive need for user interaction in the install script. + LexManos: Fixed a class to a deprecated method to fix tool effectiveness. + +Build 1.4.0.55: + LexManos: Reworked the workspace scripts so the build should fail on compile errors. This build should fail as a test. + LexManos: Fixed IOException not found error in CovertJaguires pull request. Updated scripts so that build should now be fixed + +Build 1.4.0.53: + CovertJaguar: Added throws clause to ISpawnHandler functions to keep the functions consistent with similar functions and increase ease of use. Exceptions are already being caught everywhere these functions are called, so no further changes required. + LexManos: Fixed onTakenFromCrafting hooks to be called once per stack taken. Sadly due to how shift-click is handled, the passed in item stack is not garenteed to be the stack that the result was added to. + +Build 1.4.0.52: + LexManos: Fixed forgotten type identifier in clean_src + LexManos: New EntityInteract hook for handeling player vs entity interaction on the global level vs the item level. + LexManos: Fixed sides of grass not getting biome colors + LexManos: Fixed type on patch conversion messing up tile entities + LexManos: Proper fix for SDK's invalid bit shifts of parameters for chunk population + LexManos: Made BlockStairs, BlockFarmland, and BlockStep have proper sided-solidity. Can now place torches on any solid side of those blocks. + +Build 1.4.0.51: + cpw: + Fix worldgen doubleshifting in ModLoaderMP until SDK fixes it. + + This means mods can generate surface and nether in SMP again. + +Build 1.4.0.50: + eloraam: Fixed a merge error. + LexManos: + New script to fix decompile differences between windows and linux/osx. + Removed the MLProp special case, no longer needed as MLProp decompiles fine. + Updated patches to work on all systems. + Added warning and exit if the user does not say yes to the cleanup. + +Build 1.4.0.49: + eloraam: MCP Update. Fixed a few small bugs in the linux scripts. + +Build 1.4.0.48: + LexManos: Fixed the inverted logic in the missing mod check. + LexManos: Fixed a wrong argument for dimensions, should fix entity tracking. + LexManos: Custom dimensions should now honor the canRespawnHere function for respawning. + +Build 1.4.0.47: + LexManos: Fix up Configuration ids to only work for 256 ids until Jeb finishes the 4096 conversion. + +Build 1.4.0.46: + LexManos: Fixed a bug where vines were not shearable. + +Build 1.4.0.45: + CovertJaguar: Fixed a minor bug with the Minecart Dictionary. + +Build 1.4.0.44: + LexManos: 1.4.0 official release. + +Build 1.3.4.42: + LexManos: Updated to MLMPv3 + +Build 1.3.4.41: + LexManos: Hack-fix for players getting stuck during logins. Detailed fix when bug is actually tracked down. + LexManos: Implemented ChickenBone's Chunk handler + +Build 1.3.4.39: + LexManos: Fixed client side bonemeal on grass only making flowers + LexManos: Updated to latest MCP + +Build 1.3.4.38: + LexManos: Fixed MLMP thinking Network mods need a client side when they dont. + LexManos: Fixed a generic tile entity line i missed on the server side. + LexManos: Removed improper tile entity negation + +Build 1.3.4.37: + LexManos: Updated to SDK MLMP v2 + +Build 1.3.4.36: + LexManos: Fixed missing double array in MLMP's packet server side. Also, fixed the creative code again, brain failed. + +Build 1.3.4.35: + LexManos: Got my comparitor turned around + LexManos: Updated to SDK's 1.2.3 MLMP, Mush cleaner, no longer supporting Flan's. + +Build 1.3.4.34: + LexManos: Updated gitignore, fixed digging particles, fixed creative container showing to many blocks, fixed wrong argument for custom renderers. + +Build 1.3.4.33: + LexManos: Updated MCP's patch files. Fixes hangs on running MC as applet. + LexManos: ItemBlock now implements ITextureProvider so that blocks with custom textures will showup properly when being held. + +Build 1.3.4.32: + LexManos: Fixed NPE in the login handler + LexManos: Fixed directory issues in the setup script + LexManos: Cleanup of ModLoaderMP and proper update to the latest version of ModLoader + +Build 1.3.4.31: + LexManos: Fixed missing space in linux scripts + LexManos: No longer mark forge packets as chunk packets. + LexManos: Updated MCP mapings files + +Build 1.3.4.30: + LexManos: Updated scripts so that we use Fernflower now. Added a small python script to download fernflower for the user. And the scripts exit out if it fails. + LexManos: Deleted modLoaderMP.patch, unneeded now that we use Fernflower + LexManos: Updated eclipse project for MCP 1.2.3's inclusion of the Start folder in the src folder. + LexManos: Updated The Json enum helper to point to the new packaged names. And fixed a casing change in ModLoader + LexManos: Made mod_MinecraftForge extend NetworkMod, and changed NetworkMod to extend BaseModMP server side. + LexManos: Fixed unneeded imports in ForgePacket + LexManos: removed unneeded import, and fixed casing of args in IShearable + LexManos: Deleted EntityPigZombie patches, Who needed these? Why could you not do this via reflection? + LexManos: Conf for 1.2.3 + LexManos: Same patch diff, files. + LexManos: No longer needed, bug was fixed + LexManos: Client side initial patch update to Fernflower and MC 1.2.3 + LexManos: Bit of a cleanup of the client patches + LexManos: Couple of things I missed client side + LexManos: Deleted unneeded server side patches, Packet250 bug was fixed. And the others got moved to AnvilSaveHandler + LexManos: First push of server side patch updates for 1.2.3. MLMP is still not updated so it does not include those changes, and will not compile. + LexManos: Small imports cleanup + LexManos: Missed damageCarryover on the server + LexManos: Made the scripts forge updating md5s/mcp/names + LexManos: Updated for MLMP 1.2.3 v1 + +Build 1.3.4.29: + LexManos: Bumped version to 1.3.4, final commit for Minecraft v1.1 + +Build 1.3.3.28: + LexManos: Fixed bug in build script that caused the Minecraft/MinecraftServer classes to not be included. + +Build 1.3.3.27: + LexManos: Client side of the new Dimension support. + +Build 1.3.3.26: + thedeveducer: Fixed spelling mistake ('Frequancy') + LexManos: Fixed ITextureprovider for multi-textured items when rendering on the GUI. + LexManos: Fixed compile error for the spelling pull request. + +Build 1.3.3.24: + LexManos: Fixed up Shearable blocks to play nicer with sub-classes. + LexManos: Fixed line endings in windows update_patches + LexManos: Deleted Deprecated interfaces. + LexManos: Ran AStyle over forge code for uniform code formatting, and refactored old code a bit to have cleaner names. + +Build 1.3.3.23: + connor: People may think the server needs the mods to continue and not the client. + +Build 1.3.3.22: + LexManos: Fixed a bug in update_patches that caused apostrphies to be removed. Causing the last patch to be generated incorrectly. + +Build 1.3.3.21: + LexManos: + Initial attempt at server side extra dimensions support. + Mods must register there dimensions on load, by calling DimensionManager.registerDimension(uniqueID, WorldProvier, boolean) + Mods are resposible for writing there own transporter blocks. + Initial commit, needs some more testing and design thoughts. + +Build 1.3.3.20: + LexManos: Added new Item.getIconIndex context sensitive version. + LexManos: Implemented a response to Methuselah96's Arrow hook request. See IArrowNockHandler and IArrowLooseHandler + +Build 1.3.3.19: + LexManos: Changed the layout of the missing mods gui a little. Still needs a lot of work to look good. + LexManos: Marked forge packets as 'chunk' packets. Giving them a higher priority making the initial mod list check more reliable. + LexManos: Introduced some debugging info into Forge packets. And a debug flag in the client and server packet handlers. + LexManos: Moved Client side EntityPlayer.openGui work code to EntityPlayer for compatibility between player API. + +Build 1.3.3.16: + eloraam: Linux scripts fixed, TE bug fix. + eloraam: Fixed linux scripts, fixed TE bug. + +Build 1.3.3.15: + LexManos: Exposed getters for NetServerHandler.playerEntity and NetworkManager.netHandler + LexManos: + Introuduced NetworkMod, a BaseMod extension and replacement for BaseModMP. All mods that are designed to work in the server environment should extend this. + NetworkMods will be assigned unique ModIDs by the server, and those IDs will be sent to the client upon connection. + Refactored Forge packets to the net.minecraft.src.forge.packets package. And introduced the base ForgePacket class. + Added initial ModList request/response. + LexManos: + Expanded the Mod check to test for missing mods and display a GUI screen for the client if it is missing any. + The client now downloads NetworkMod ID's from the server upon connecting. + LexManos: Implemented a generic EntityPlayer.openGui system, and the network backend for it to work on server and client. + +Build 1.3.3.14: + LexManos: + Fixed up the install scripts. The linux script no longer needs sed. Should fix some issues on OSX's without gsed. + Also forge sources will only be copied to sides that were downloaded. + Also, install scripts now prompt for input to cleanup. + +Build 1.3.3.13: + LexManos: Split mod_MinecraftForge so that Clients arnt required to have MLMP installed if they don't use a MP mod. + +Build 1.3.3.12: + LexManos: Update MCP Mapings + LexManos: Small update to update_patches.bat, to skip patch reject files. + LexManos: Bumped version to 1.3.3 + +Build 1.3.2.10: + LexManos: + Refactored so that ISpecialArmor items do not see the factor of 25 on the damage. + The value returned form ISpecialArmor.getProperties is now copied, so mod items are free to re-use there return values. + +Build 1.3.2.9: + LexManos: + Reworked ISpecialArmor to provide better functionality as requested by IC2 devs. + Armor can now be prioritized over other armor. + It can deal with damaging it's own itemstacks. + Also impkemented the ISpecialArmor.getArmorDisplay + +Build 1.3.2.8: + LexManos: Lowered the amount of build log spam, and fixed the inject_version script for use on other systems. + LexManos: Fixed ITextureProvider support for items that have multiple colored overlays. + LexManos: Added Item.onLeftClickEntity hook. Used to intercept and cancel the 'attack' action within items. + LexManos: Implemented item.onBlockStartBreak call for creative single player. + LexManos: Implimented a new IShearable system. This allows mods to create both new shear-like items/blocks. As well as new Entities/Blocks that work with other mod's shear-like items. + +Build 1.3.2.7: + LexManos: Missed a caluse, ISpecialArmor should work as intended now. And not destroy Armor instanatly. + +Build 1.3.2.6: + LexManos: + Implmented Sengir's IPickupHandler. + http://www.mod-buildcraft.com/forums/topic/hook-intercept-item-pickups-by-player-entities/?view=all + +Build 1.3.2.5: + LexManos: + Merged in the change to ISpecialArmor to introduce the DamageSource argument. + As well as the concept of damage absorption vs reduction. + +Build 1.3.2.4: + LexManos: + Created a Entity tracking ans spawning system. + Mod creators should call MinecraftForge.registerEntity to register a entity. + All entity ID numbers are Mod Unique. Meaning two mods can have Entity #1. + Added client and server side packet handlers for the 'Forge' channel. For use in internal packets such as the new Spawn packet. + Updated the build scripts to copy over unique server source files now that there actually are some. + For modders: + If you have a entity that used MLMP's 'owner' system, you should have your entity implement IThrowableEntity + If you have a entity that implments MLMLP's ISpawnable, you should implement ISpawnHandler. + They provide the same functionality, just in a cleaner, more orginized way and will be the method used when we eventually drop MLMP. + +Build 1.3.2.3: + LexManos: Fixed return value for un/registerChannel. Now returns properly indicate when un/register commands should be sent. + +Build 1.3.2.2: + LexManos: + Setup .gitignore for eclipse bin dirs. + Fixed line endings in install.sh + Added mod_MinecraftForge for simpler logging of minecraft version in crash reports + Added new hooks for connection events, See IConnectionHandler for more details. + Added Packet250CustomPayload handeling and channel registraction management, see MessageManager and IPacketHandler for more details. + Forge now uses unsed fields in C->S Packet1Login to identify itself. None Forge clients will get a graceful disconnect message instead of the 'Unknown packet 230' + diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e9b9fd5 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..d3b8398 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..60e10df --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Feb 16 02:09:04 PST 2022 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..27309d9 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..b6dd883 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,91 @@ +set JAVA_HOME=runtime +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/runClient.bat b/runClient.bat new file mode 100644 index 0000000..0ef3491 --- /dev/null +++ b/runClient.bat @@ -0,0 +1,3 @@ +@ECHO OFF +gradlew runclient +pause \ No newline at end of file diff --git a/runtime/ASSEMBLY_EXCEPTION b/runtime/ASSEMBLY_EXCEPTION new file mode 100644 index 0000000..065b8d9 --- /dev/null +++ b/runtime/ASSEMBLY_EXCEPTION @@ -0,0 +1,27 @@ + +OPENJDK ASSEMBLY EXCEPTION + +The OpenJDK source code made available by Oracle America, Inc. (Oracle) at +openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU +General Public License version 2 +only ("GPL2"), with the following clarification and special exception. + + Linking this OpenJDK Code statically or dynamically with other code + is making a combined work based on this library. Thus, the terms + and conditions of GPL2 cover the whole combination. + + As a special exception, Oracle gives you permission to link this + OpenJDK Code with certain code licensed by Oracle as indicated at + http://openjdk.java.net/legal/exception-modules-2007-05-08.html + ("Designated Exception Modules") to produce an executable, + regardless of the license terms of the Designated Exception Modules, + and to copy and distribute the resulting executable under GPL2, + provided that the Designated Exception Modules continue to be + governed by the licenses under which they were offered by Oracle. + +As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code +to build an executable that includes those portions of necessary code that +Oracle could not provide under GPL2 (or that Oracle has provided under GPL2 +with the Classpath exception). If you modify or add to the OpenJDK code, +that new GPL2 code may still be combined with Designated Exception Modules +if the new code is made subject to this exception by its copyright holder. diff --git a/runtime/LICENSE b/runtime/LICENSE new file mode 100644 index 0000000..8b400c7 --- /dev/null +++ b/runtime/LICENSE @@ -0,0 +1,347 @@ +The GNU General Public License (GPL) + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public License is intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. This General Public License applies to +most of the Free Software Foundation's software and to any other program whose +authors commit to using it. (Some other Free Software Foundation software is +covered by the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom to +distribute copies of free software (and charge for this service if you wish), +that you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs; and that you know you +can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny +you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for +a fee, you must give the recipients all the rights that you have. You must +make sure that they, too, receive or can get the source code. And you must +show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) +offer you this license which gives you legal permission to copy, distribute +and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients to +know that what they have is not the original, so that any problems introduced +by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program proprietary. +To prevent this, we have made it clear that any patent must be licensed for +everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms of +this General Public License. The "Program", below, refers to any such program +or work, and a "work based on the Program" means either the Program or any +derivative work under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with modifications and/or +translated into another language. (Hereinafter, translation is included +without limitation in the term "modification".) Each licensee is addressed as +"you". + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running the Program is +not restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made by +running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as +you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and give any other recipients of the +Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may +at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus +forming a work based on the Program, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or + in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of + this License. + + c) If the modified program normally reads commands interactively when run, + you must cause it, when started running for such interactive use in the + most ordinary way, to print or display an announcement including an + appropriate copyright notice and a notice that there is no warranty (or + else, saying that you provide a warranty) and that users may redistribute + the program under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive but does + not normally print such an announcement, your work based on the Program is + not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be reasonably +considered independent and separate works in themselves, then this License, and +its terms, do not apply to those sections when you distribute them as separate +works. But when you distribute the same sections as part of a whole which is a +work based on the Program, the distribution of the whole must be on the terms +of this License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise the +right to control the distribution of derivative or collective works based on +the Program. + +In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or +distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 and +2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 above + on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only + for noncommercial distribution and only if you received the program in + object code or executable form with such an offer, in accord with + Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and installation +of the executable. However, as a special exception, the source code +distributed need not include anything that is normally distributed (in either +source or binary form) with the major components (compiler, kernel, and so on) +of the operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the source +code from the same place counts as distribution of the source code, even though +third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate +your rights under this License. However, parties who have received copies, or +rights, from you under this License will not have their licenses terminated so +long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not +accept this License. Therefore, by modifying or distributing the Program (or +any work based on the Program), you indicate your acceptance of this License to +do so, and all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance by +third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions +are imposed on you (whether by court order, agreement or otherwise) that +contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not distribute the Program at all. +For example, if a patent license would not permit royalty-free redistribution +of the Program by all those who receive copies directly or indirectly through +you, then the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In +such case, this License incorporates the limitation as if written in the body +of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the +General Public License from time to time. Such new versions will be similar in +spirit to the present version, but may differ in detail to address new problems +or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any later +version", you have the option of following the terms and conditions either of +that version or of any later version published by the Free Software Foundation. +If the Program does not specify a version number of this License, you may +choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, +write to the Free Software Foundation; we sometimes make exceptions for this. +Our decision will be guided by the two goals of preserving the free status of +all derivatives of our free software and of promoting the sharing and reuse of +software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, +YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR +INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA +BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER +OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively convey the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + + Copyright (C) + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it +starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes + with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free + software, and you are welcome to redistribute it under certain conditions; + type 'show c' for details. + +The hypothetical commands 'show w' and 'show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may be +called something other than 'show w' and 'show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the program, if necessary. Here +is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + 'Gnomovision' (which makes passes at compilers) written by James Hacker. + + signature of Ty Coon, 1 April 1989 + + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General Public +License instead of this License. + + +"CLASSPATH" EXCEPTION TO THE GPL + +Certain source files distributed by Oracle America and/or its affiliates are +subject to the following clarification and special exception to the GPL, but +only where Oracle has expressly included in the particular source file's header +the words "Oracle designates this particular file as subject to the "Classpath" +exception as provided by Oracle in the LICENSE file that accompanied this code." + + Linking this library statically or dynamically with other modules is making + a combined work based on this library. Thus, the terms and conditions of + the GNU General Public License cover the whole combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules, + and to copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent module, + the terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. If + you modify this library, you may extend this exception to your version of + the library, but you are not obligated to do so. If you do not wish to do + so, delete this exception statement from your version. diff --git a/runtime/NOTICE b/runtime/NOTICE new file mode 100644 index 0000000..c5725da --- /dev/null +++ b/runtime/NOTICE @@ -0,0 +1,63 @@ +# Notices for Eclipse Temurin + +This content is produced and maintained by the Eclipse Temurin project. + + * Project home: https://projects.eclipse.org/projects/adoptium.temurin + +## Trademarks + +Eclipse Temurin is a trademark of the Eclipse Foundation. Eclipse, and the +Eclipse Logo are registered trademarks of the Eclipse Foundation. + +Java and all Java-based trademarks are trademarks of Oracle Corporation in +the United States, other countries, or both. + +## Copyright + +All content is the property of the respective authors or their employers. +For more information regarding authorship of content, please consult the +listed source code repository logs. + +## Declared Project Licenses + +This program and the accompanying materials are made available under the terms +of the GNU General Public License, version 2, with the Classpath Exception. + +Additional information relating to the program and accompanying materials +license and usage is available as follows. + * For Eclipse Temurin version 8 see the LICENSE and ASSEMBLY_EXCEPTION files +in the top level directory of the installation. + * For Eclipse Temurin version 9 or later see the files under the legal/ +directory in the top level directory of the installation. + +SPDX-License-Identifier: GPL-2.0 WITH Classpath-exception-2.0 + +## Source Code + +The project maintains the following source code repositories which may be +relevant to this content: + + * https://github.com/adoptium/temurin-build + * https://github.com/adoptium/jdk + * https://github.com/adoptium/jdk8u + * https://github.com/adoptium/jdk11u + * https://github.com/adoptium/jdk16u + * https://github.com/adoptium/jdk17u + * and so on + +## Third-party Content + +This program and accompanying materials contains third-party content. + * For Eclipse Temurin version 8 see the THIRD_PARTY_LICENSE file in the +top level directory of the installation. + * For Eclipse Temurin version 9 or later see the files under the legal/ +directory in the top level directory of the installation. + +## Cryptography + +Content may contain encryption software. The country in which you are currently +may have restrictions on the import, possession, and use, and/or re-export to +another country, of encryption software. BEFORE using any encryption software, +please check the country's laws, regulations and policies concerning the import, +possession, or use, and re-export of encryption software, to see if this is +permitted. diff --git a/runtime/THIRD_PARTY_README b/runtime/THIRD_PARTY_README new file mode 100644 index 0000000..d19de8a --- /dev/null +++ b/runtime/THIRD_PARTY_README @@ -0,0 +1,3318 @@ +DO NOT TRANSLATE OR LOCALIZE. +----------------------------- + +%% This notice is provided with respect to ASM Bytecode Manipulation +Framework v5.0.3, which may be included with JRE 8, and JDK 8, and +OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2000-2011 France T??l??com +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to BSDiff v4.3, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright 2003-2005 Colin Percival +All rights reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted providing that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to CodeViewer 1.0, which may be +included with JDK 8. + +--- begin of LICENSE --- + +Copyright 1999 by CoolServlets.com. + +Any errors or suggested improvements to this class can be reported as +instructed on CoolServlets.com. We hope you enjoy this program... your +comments will encourage further development! This software is distributed +under the terms of the BSD License. Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +Neither name of CoolServlets.com nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Cryptix AES 3.2.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Cryptix General License + +Copyright (c) 1995-2005 The Cryptix Foundation Limited. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND +CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to CUP Parser Generator for +Java 0.11b, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both the +copyright notice and this permission notice and warranty disclaimer appear in +supporting documentation, and that the names of the authors or their +employers not be used in advertising or publicity pertaining to distribution of +the software without specific, written prior permission. + +The authors and their employers disclaim all warranties with regard to +this software, including all implied warranties of merchantability and fitness. +In no event shall the authors or their employers be liable for any special, +indirect or consequential damages or any damages whatsoever resulting from +loss of use, data or profits, whether in an action of contract, negligence or +other tortious action, arising out of or in connection with the use or +performance of this software. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to DejaVu fonts v2.34, which may be +included with JRE 8, and JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +TeX Gyre DJV Math +----------------- +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + +Math extensions done by B. Jackowski, P. Strzelczyk and P. Pianowski +(on behalf of TeX users groups) are in public domain. + +Letters imported from Euler Fraktur from AMSfonts are (c) American +Mathematical Society (see below). +Bitstream Vera Fonts Copyright +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera +is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated documentation +files (the "Font Software"), to reproduce and distribute the Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit persons +to whom the Font Software is furnished to do so, subject to the following +conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the +fonts are renamed to names not containing either the words "Bitstream" +or the word "Vera". + +This License becomes null and void to the extent applicable to Fonts or +Font Software that has been modified and is distributed under the +"Bitstream Vera" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN +THE FONT SOFTWARE. +Except as contained in this notice, the names of GNOME, the GNOME +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the GNOME Foundation or +Bitstream Inc., respectively. +For further information, contact: fonts at gnome dot org. + +AMSFonts (v. 2.2) copyright + +The PostScript Type 1 implementation of the AMSFonts produced by and +previously distributed by Blue Sky Research and Y&Y, Inc. are now freely +available for general use. This has been accomplished through the +cooperation +of a consortium of scientific publishers with Blue Sky Research and Y&Y. +Members of this consortium include: + +Elsevier Science IBM Corporation Society for Industrial and Applied +Mathematics (SIAM) Springer-Verlag American Mathematical Society (AMS) + +In order to assure the authenticity of these fonts, copyright will be +held by the American Mathematical Society. This is not meant to restrict +in any way the legitimate use of the fonts, such as (but not limited to) +electronic distribution of documents containing these fonts, inclusion of +these fonts into other public domain or commercial font collections or computer +applications, use of the outline data to create derivative fonts and/or +faces, etc. However, the AMS does require that the AMS copyright notice be +removed from any derivative versions of the fonts which have been altered in +any way. In addition, to ensure the fidelity of TeX documents using Computer +Modern fonts, Professor Donald Knuth, creator of the Computer Modern faces, +has requested that any alterations which yield different font metrics be +given a different name. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Document Object Model (DOM) Level 2 +& 3, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +W3C SOFTWARE NOTICE AND LICENSE + +http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +This work (and included software, documentation such as READMEs, or other +related items) is being provided by the copyright holders under the following +license. By obtaining, using and/or copying this work, you (the licensee) +agree that you have read, understood, and will comply with the following terms +and conditions. + +Permission to copy, modify, and distribute this software and its +documentation, with or without modification, for any purpose and without fee +or royalty is hereby granted, provided that you include the following on ALL +copies of the software and documentation or portions thereof, including +modifications: + + 1.The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. + + 2.Any pre-existing intellectual property disclaimers, notices, or terms and + conditions. If none exist, the W3C Software Short Notice should be included + (hypertext is preferred, text is permitted) within the body of any + redistributed or derivative code. + + 3.Notice of any changes or modifications to the files, including the date + changes were made. (We recommend you provide URIs to the location from + which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS +MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR +PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY +THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL +OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR +DOCUMENTATION. The name and trademarks of copyright holders may NOT be used +in advertising or publicity pertaining to the software without specific, +written prior permission. Title to copyright in this software and any +associated documentation will at all times remain with copyright holders. + +____________________________________ + +This formulation of W3C's notice and license became active on December 31 +2002. This version removes the copyright ownership notice such that this +license can be used with materials other than those owned by the W3C, reflects +that ERCIM is now a host of the W3C, includes references to this specific +dated version of the license, and removes the ambiguous grant of "use". +Otherwise, this version is the same as the previous version and is written so +as to preserve the Free Software Foundation's assessment of GPL compatibility +and OSI's certification under the Open Source Definition. Please see our +Copyright FAQ for common questions about using materials from our site, +including specific terms and conditions for packages like libwww, Amaya, and +Jigsaw. Other questions about this notice can be directed to +site-policy@w3.org. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Dynalink v0.5, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2009-2013, Attila Szegedi + +All rights reserved.Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met:* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. * Redistributions in +binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or other +materials provided with the distribution. * Neither the name of Attila +Szegedi nor the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Elliptic Curve Cryptography, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +You are receiving a copy of the Elliptic Curve Cryptography library in source +form with the JDK 8 and OpenJDK 8 source distributions, and as object code in +the JRE 8 & JDK 8 runtimes. + +In the case of the JRE & JDK runtimes, the terms of the Oracle license do +NOT apply to the Elliptic Curve Cryptography library; it is licensed under the +following license, separately from Oracle's JDK & JRE. If you do not wish to +install the Elliptic Curve Cryptography library, you may delete the +Elliptic Curve Cryptography library: + - On Solaris and Linux systems: delete $(JAVA_HOME)/lib/libsunec.so + - On Windows systems: delete $(JAVA_HOME)\bin\sunec.dll + - On Mac systems, delete: + for JRE: /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/libsunec.dylib + for JDK: $(JAVA_HOME)/jre/lib/libsunec.dylib + +Written Offer for ECC Source Code + For third party technology that you receive from Oracle in binary form + which is licensed under an open source license that gives you the right + to receive the source code for that binary, you can obtain a copy of + the applicable source code from this page: + http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/native/sun/security/ec/impl + + If the source code for the technology was not provided to you with the + binary, you can also receive a copy of the source code on physical + media by submitting a written request to: + + Oracle America, Inc. + Attn: Associate General Counsel, + Development and Engineering Legal + 500 Oracle Parkway, 10th Floor + Redwood Shores, CA 94065 + + Or, you may send an email to Oracle using the form at: + http://www.oracle.com/goto/opensourcecode/request + + Your request should include: + - The name of the component or binary file(s) for which you are requesting + the source code + - The name and version number of the Oracle product containing the binary + - The date you received the Oracle product + - Your name + - Your company name (if applicable) + - Your return mailing address and email and + - A telephone number in the event we need to reach you. + + We may charge you a fee to cover the cost of physical media and processing. + Your request must be sent (i) within three (3) years of the date you + received the Oracle product that included the component or binary + file(s) that are the subject of your request, or (ii) in the case of + code licensed under the GPL v3, for as long as Oracle offers spare + parts or customer support for that product model. + +--- begin of LICENSE --- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to ECMAScript Language +Specification ECMA-262 Edition 5.1 which may be included with +JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright notice +Copyright ?? 2011 Ecma International +Ecma International +Rue du Rhone 114 +CH-1204 Geneva +Tel: +41 22 849 6000 +Fax: +41 22 849 6001 +Web: http://www.ecma-international.org + +This document and possible translations of it may be copied and furnished to +others, and derivative works that comment on or otherwise explain it or assist +in its implementation may be prepared, copied, published, and distributed, in +whole or in part, without restriction of any kind, provided that the above +copyright notice and this section are included on all such copies and derivative +works. However, this document itself may not be modified in any way, including +by removing the copyright notice or references to Ecma International, except as +needed for the purpose of developing any document or deliverable produced by +Ecma International (in which case the rules applied to copyrights must be +followed) or as required to translate it into languages other than English. The +limited permissions granted above are perpetual and will not be revoked by Ecma +International or its successors or assigns. This document and the information +contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL +DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY +WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP +RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE." Software License + +All Software contained in this document ("Software)" is protected by copyright +and is being made available under the "BSD License", included below. This +Software may be subject to third party rights (rights from parties other than +Ecma International), including patent rights, and no licenses under such third +party rights are granted under this license even if the third party concerned is +a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS +AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR +INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO +IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the authors nor Ecma International may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to freebXML Registry 3.0 & 3.1, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +freebxml: Copyright (c) 2001 freebxml.org. All rights reserved. + +The names "The freebXML Registry Project" and "freebxml Software +Foundation" must not be used to endorse or promote products derived +from this software or be used in a product name without prior +written permission. For written permission, please contact +ebxmlrr-team@lists.sourceforge.net. + +This software consists of voluntary contributions made by many individuals +on behalf of the the freebxml Software Foundation. For more information on +the freebxml Software Foundation, please see . + +This product includes software developed by the Apache Software Foundation +(http://www.apache.org/). + +The freebxml License, Version 1.1 5 +Copyright (c) 2001 freebxml.org. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The end-user documentation included with the redistribution, if + any, must include the following acknowlegement: + "This product includes software developed by + freebxml.org (http://www.freebxml.org/)." + Alternately, this acknowlegement may appear in the software itself, + if and wherever such third-party acknowlegements normally appear. + + 4. The names "The freebXML Registry Project", "freebxml Software + Foundation" must not be used to endorse or promote products derived + from this software without prior written permission. For written + permission, please contact ebxmlrr-team@lists.sourceforge.net. + + 5. Products derived from this software may not be called "freebxml", + "freebXML Registry" nor may freebxml" appear in their names without + prior written permission of the freebxml Group. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE freebxml SOFTWARE FOUNDATION OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to IAIK PKCS#11 Wrapper, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +IAIK PKCS#11 Wrapper License + +Copyright (c) 2002 Graz University of Technology. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: + + "This product includes software developed by IAIK of Graz University of + Technology." + + Alternately, this acknowledgment may appear in the software itself, if and + wherever such third-party acknowledgments normally appear. + +4. The names "Graz University of Technology" and "IAIK of Graz University of + Technology" must not be used to endorse or promote products derived from this + software without prior written permission. + +5. Products derived from this software may not be called "IAIK PKCS Wrapper", + nor may "IAIK" appear in their name, without prior written permission of + Graz University of Technology. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 1995-2010 International Business Machines Corporation and others + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +provided that the above copyright notice(s) and this permission notice appear +in all copies of the Software and that both the above copyright notice(s) and +this permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE +LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. +All trademarks and registered trademarks mentioned herein are the property of +their respective owners. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to IJG JPEG 6b, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Jing 20030619, which may +be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2001-2003 Thai Open Source Software Center Ltd All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the name of the Thai Open Source Software Center Ltd nor +the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Joni v2.1.16, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2017 JRuby Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to JOpt-Simple v3.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + Copyright (c) 2004-2009 Paul R. Holser, Jr. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kerberos functionality, which +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + (C) Copyright IBM Corp. 1999 All Rights Reserved. + Copyright 1997 The Open Group Research Institute. All rights reserved. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kerberos functionality from +FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + Copyright (C) 1998 by the FundsXpress, INC. + + All rights reserved. + + Export of this software from the United States of America may require + a specific license from the United States Government. It is the + responsibility of any person or organization contemplating export to + obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of FundsXpress. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. FundsXpress makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kronos OpenGL headers, which may be +included with JDK 8 and OpenJDK 8 source distributions. + +--- begin of LICENSE --- + + Copyright (c) 2007 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and/or associated documentation files (the "Materials"), to + deal in the Materials without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Materials, and to permit persons to whom the Materials are + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE + MATERIALS. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Portions Copyright Eastman Kodak Company 1991-2003 + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to libpng 1.6.37, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + +TRADEMARK: + +The name "libpng" has not been registered by the Copyright owner +as a trademark in any jurisdiction. However, because libpng has +been distributed and maintained world-wide, continually since 1995, +the Copyright owner claims "common-law trademark protection" in any +jurisdiction where common-law trademark is recognized. + +OSI CERTIFICATION: + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is +a certification mark of the Open Source Initiative. OSI has not addressed +the additional disclaimers inserted at version 1.0.7. + +EXPORT CONTROL: + +The Copyright owner believes that the Export Control Classification +Number (ECCN) for libpng is EAR99, which means not subject to export +controls or International Traffic in Arms Regulations (ITAR) because +it is open source, publicly available software, that does not contain +any encryption software. See the EAR, paragraphs 734.3(b)(3) and +734.7(b). + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +July 15, 2018 + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to GIFLIB 5.2.1 & libungif 4.1.3, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Little CMS 2.11, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Little CMS +Copyright (c) 1998-2020 Marti Maria Saguer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Lucida is a registered trademark or trademark of Bigelow & Holmes in the +U.S. and other countries. + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Mesa 3D Graphics Library v4.1, +which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions. + +--- begin of LICENSE --- + + Mesa 3-D Graphics Library v19.2.1 + + Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Attention, Contributors + +When contributing to the Mesa project you must agree to the licensing terms +of the component to which you're contributing. +The following section lists the primary components of the Mesa distribution +and their respective licenses. +Mesa Component Licenses + + + +Component Location License +------------------------------------------------------------------ +Main Mesa code src/mesa/ MIT +Device drivers src/mesa/drivers/* MIT, generally + +Gallium code src/gallium/ MIT + +Ext headers GL/glext.h Khronos + GL/glxext.h Khronos + GL/wglext.h Khronos + KHR/khrplatform.h Khronos + +***************************************************************************** + +---- +include/GL/gl.h : + + + Mesa 3-D graphics library + + Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + Copyright (C) 2009 VMware, Inc. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ***************************************************************************** + +---- +include/GL/glext.h +include/GL/glxext.h +include/GL/wglxext.h : + + + Copyright (c) 2013 - 2018 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + + ***************************************************************************** + +---- +include/KHR/khrplatform.h : + + Copyright (c) 2008 - 2018 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + + ***************************************************************************** + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Mozilla Network Security +Services (NSS), which is supplied with the JDK test suite in the OpenJDK +source code repository. It is licensed under Mozilla Public License (MPL), +version 2.0. + +The NSS libraries are supplied in executable form, built from unmodified +NSS source code labeled with the "NSS_3_16_RTM" HG tag. + +The NSS source code is available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/src + +The NSS libraries are available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/lib + +--- begin of LICENSE --- + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to PC/SC Lite v1.8.26, +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +--- begin of LICENSE --- + +Copyright (c) 1999-2003 David Corcoran +Copyright (c) 2001-2011 Ludovic Rousseau +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +Changes to this license can be made only by the copyright author with +explicit written consent. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to PorterStemmer v4, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +See: http://tartarus.org/~martin/PorterStemmer + +The software is completely free for any purpose, unless notes at the head of +the program text indicates otherwise (which is rare). In any case, the notes +about licensing are never more restrictive than the BSD License. + +In every case where the software is not written by me (Martin Porter), this +licensing arrangement has been endorsed by the contributor, and it is +therefore unnecessary to ask the contributor again to confirm it. + +I have not asked any contributors (or their employers, if they have them) for +proofs that they have the right to distribute their software in this way. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Relax NG Object/Parser v.20050510, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) Kohsuke Kawaguchi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to RelaxNGCC v1.12, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: + + "This product includes software developed by Daisuke Okajima + and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)." + +Alternately, this acknowledgment may appear in the software itself, if and +wherever such third-party acknowledgments normally appear. + +4. The names of the copyright holders must not be used to endorse or promote + products derived from this software without prior written permission. For + written permission, please contact the copyright holders. + +5. Products derived from this software may not be called "RELAXNGCC", nor may + "RELAXNGCC" appear in their name, without prior written permission of the + copyright holders. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE APACHE +SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Relax NG Datatype 1.0, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to SoftFloat version 2b, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM. + +--- begin of LICENSE --- + +Use of any of this software is governed by the terms of the license below: + +SoftFloat was written by me, John R. Hauser. This work was made possible in +part by the International Computer Science Institute, located at Suite 600, +1947 Center Street, Berkeley, California 94704. Funding was partially +provided by the National Science Foundation under grant MIP-9311980. The +original version of this code was written as part of a project to build +a fixed-point vector processor in collaboration with the University of +California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. + +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL +LOSSES, COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO +FURTHERMORE EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER +SCIENCE INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, +COSTS, OR OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE +SOFTWARE. + +Derivative works are acceptable, even for commercial purposes, provided +that the minimal documentation requirements stated in the source code are +satisfied. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Sparkle 1.5, +which may be included with JRE 8 on Mac OS X. + +--- begin of LICENSE --- + +Copyright (c) 2012 Sparkle.org and Andy Matuschak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Portions licensed from Taligent, Inc. + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Thai Dictionary, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (C) 1982 The Royal Institute, Thai Royal Government. + +Copyright (C) 1998 National Electronics and Computer Technology Center, +National Science and Technology Development Agency, +Ministry of Science Technology and Environment, +Thai Royal Government. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1 +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Unicode Terms of Use + +For the general privacy policy governing access to this site, see the Unicode +Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and +Trademark Usage Policy. + +A. Unicode Copyright. + 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. + + 2. Certain documents and files on this website contain a legend indicating + that "Modification is permitted." Any person is hereby authorized, + without fee, to modify such documents and files to create derivative + works conforming to the Unicode?? Standard, subject to Terms and + Conditions herein. + + 3. Any person is hereby authorized, without fee, to view, use, reproduce, + and distribute all documents and files solely for informational + purposes in the creation of products supporting the Unicode Standard, + subject to the Terms and Conditions herein. + + 4. Further specifications of rights and restrictions pertaining to the use + of the particular set of data files known as the "Unicode Character + Database" can be found in Exhibit 1. + + 5. Each version of the Unicode Standard has further specifications of + rights and restrictions of use. For the book editions (Unicode 5.0 and + earlier), these are found on the back of the title page. The online + code charts carry specific restrictions. All other files, including + online documentation of the core specification for Unicode 6.0 and + later, are covered under these general Terms of Use. + + 6. No license is granted to "mirror" the Unicode website where a fee is + charged for access to the "mirror" site. + + 7. Modification is not permitted with respect to this document. All copies + of this document must be verbatim. + +B. Restricted Rights Legend. Any technical data or software which is licensed + to the United States of America, its agencies and/or instrumentalities + under this Agreement is commercial technical data or commercial computer + software developed exclusively at private expense as defined in FAR 2.101, + or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, + duplication, or disclosure by the Government is subject to restrictions as + set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov + 1995) and this Agreement. For Software, in accordance with FAR 12-212 or + DFARS 227-7202, as applicable, use, duplication or disclosure by the + Government is subject to the restrictions set forth in this Agreement. + +C. Warranties and Disclaimers. + 1. This publication and/or website may include technical or typographical + errors or other inaccuracies . Changes are periodically added to the + information herein; these changes will be incorporated in new editions + of the publication and/or website. Unicode may make improvements and/or + changes in the product(s) and/or program(s) described in this + publication and/or website at any time. + + 2. If this file has been purchased on magnetic or optical media from + Unicode, Inc. the sole and exclusive remedy for any claim will be + exchange of the defective media within ninety (90) days of original + purchase. + + 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS + PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, + OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. + UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR + OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH + ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. + +D. Waiver of Damages. In no event shall Unicode or its licensors be liable for + any special, incidental, indirect or consequential damages of any kind, or + any damages whatsoever, whether or not Unicode was advised of the + possibility of the damage, including, without limitation, those resulting + from the following: loss of use, data or profits, in connection with the + use, modification or distribution of this information or its derivatives. + +E.Trademarks & Logos. + 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, + Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of + Unicode, Inc. Use of the information and materials found on this + website indicates your acknowledgement of Unicode, Inc.???s exclusive + worldwide rights in the Unicode Word Mark, the Unicode Logo, and the + Unicode trade names. + + 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark + Policy???) are incorporated herein by reference and you agree to abide by + the provisions of the Trademark Policy, which may be changed from time + to time in the sole discretion of Unicode, Inc. + + 3. All third party trademarks referenced herein are the property of their + respective owners. + +Miscellaneous. + 1. Jurisdiction and Venue. This server is operated from a location in the + State of California, United States of America. Unicode makes no + representation that the materials are appropriate for use in other + locations. If you access this server from other locations, you are + responsible for compliance with local laws. This Agreement, all use of + this site and any claims and damages resulting from use of this site are + governed solely by the laws of the State of California without regard to + any principles which would apply the laws of a different jurisdiction. + The user agrees that any disputes regarding this site shall be resolved + solely in the courts located in Santa Clara County, California. The user + agrees said courts have personal jurisdiction and agree to waive any + right to transfer the dispute to any other forum. + + 2. Modification by Unicode. Unicode shall have the right to modify this + Agreement at any time by posting it to this site. The user may not + assign any part of this Agreement without Unicode???s prior written + consent. + + 3. Taxes. The user agrees to pay any taxes arising from access to this + website or use of the information herein, except for those based on + Unicode???s net income. + + 4. Severability. If any provision of this Agreement is declared invalid or + unenforceable, the remaining provisions of this Agreement shall remain + in effect. + + 5. Entire Agreement. This Agreement constitutes the entire agreement + between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF +online code charts under the directory http://www.unicode.org/Public/. +Software includes any source code published in the Unicode Standard or under +the directories http://www.unicode.org/Public/, +http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. + +NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, +INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA +FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO +BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT +AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR +SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the +Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and any associated documentation (the "Data Files") +or Unicode software and any associated documentation (the "Software") to deal +in the Data Files or Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, and/or +sell copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that (a) the above +copyright notice(s) and this permission notice appear with all copies of the +Data Files or Software, (b) both the above copyright notice(s) and this +permission notice appear in associated documentation, and (c) there is clear +notice in each modified Data File or in the Software as well as in the +documentation associated with the Data File(s) or Software that the data or +software has been modified. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN +THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE +DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. + +Unicode and the Unicode logo are trademarks of Unicode, Inc. in the United +States and other countries. All third party trademarks referenced herein are +the property of their respective owners. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to UPX v3.01, which may be included +with JRE 8 on Windows. + +--- begin of LICENSE --- + +Use of any of this software is governed by the terms of the license below: + + + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar + http://wildsau.idv.uni-linz.ac.at/mfx/upx.html + http://www.nexus.hu/upx + http://upx.tsx.org + + +PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN +TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. + + +ABSTRACT +======== + + UPX and UCL are copyrighted software distributed under the terms + of the GNU General Public License (hereinafter the "GPL"). + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + As a special exception we grant the free usage of UPX for all + executables, including commercial programs. + See below for details and restrictions. + + +COPYRIGHT +========= + + UPX and UCL are copyrighted software. All rights remain with the authors. + + UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + UPX is Copyright (C) 1996-2000 Laszlo Molnar + + UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + + +GNU GENERAL PUBLIC LICENSE +========================== + + UPX and the UCL library are free software; you can redistribute them + and/or modify them under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + UPX and UCL are distributed in the hope that they will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + + +SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES +============================================ + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special + permission to freely use and distribute all UPX compressed programs + (including commercial ones), subject to the following restrictions: + + 1. You must compress your program with a completely unmodified UPX + version; either with our precompiled version, or (at your option) + with a self compiled version of the unmodified UPX sources as + distributed by us. + 2. This also implies that the UPX stub must be completely unmodfied, i.e. + the stub imbedded in your compressed program must be byte-identical + to the stub that is produced by the official unmodified UPX version. + 3. The decompressor and any other code from the stub must exclusively get + used by the unmodified UPX stub for decompressing your program at + program startup. No portion of the stub may get read, copied, + called or otherwise get used or accessed by your program. + + +ANNOTATIONS +=========== + + - You can use a modified UPX version or modified UPX stub only for + programs that are compatible with the GNU General Public License. + + - We grant you special permission to freely use and distribute all UPX + compressed programs. But any modification of the UPX stub (such as, + but not limited to, removing our copyright string or making your + program non-decompressible) will immediately revoke your right to + use and distribute a UPX compressed program. + + - UPX is not a software protection tool; by requiring that you use + the unmodified UPX version for your proprietary programs we + make sure that any user can decompress your program. This protects + both you and your users as nobody can hide malicious code - + any program that cannot be decompressed is highly suspicious + by definition. + + - You can integrate all or part of UPX and UCL into projects that + are compatible with the GNU GPL, but obviously you cannot grant + any special exceptions beyond the GPL for our code in your project. + + - We want to actively support manufacturers of virus scanners and + similar security software. Please contact us if you would like to + incorporate parts of UPX or UCL into such a product. + + + +Markus F.X.J. Oberhumer Laszlo Molnar +markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu + +Linz, Austria, 25 Feb 2000 + +Additional License(s) + +The UPX license file is at http://upx.sourceforge.net/upx-license.html. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Xfree86-VidMode Extension 1.0, +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +--- begin of LICENSE --- + +Version 1.1 of XFree86 ProjectLicence. + +Copyright (C) 1994-2004 The XFree86 Project, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicence, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so,subject to the following conditions: + + 1. Redistributions of source code must retain the above copyright + notice,this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution, and in the same place + and form as other copyright, license and disclaimer information. + + 3. The end-user documentation included with the redistribution, if any,must + include the following acknowledgment: "This product includes + software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and + its contributors", in the same place and form as other third-party + acknowledgments. Alternately, this acknowledgment may appear in the software + itself, in the same form and location as other such third-party + acknowledgments. + + 4. Except as contained in this notice, the name of The XFree86 Project,Inc + shall not be used in advertising or otherwise to promote the sale, use + or other dealings in this Software without prior written authorization from + The XFree86 Project, Inc. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to xwd v1.0.7, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +xwd utility + +--- begin of LICENSE --- + +Copyright 1994 Hewlett-Packard Co. +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +--- end of LICENSE --- +_____________________________ +Copyright notice for HPkeysym.h: +/* + +Copyright 1987, 1998 The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Hewlett Packard +or Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD +TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. Hewlett-Packard shall not be liable for errors +contained herein or direct, indirect, special, incidental or +consequential damages in connection with the furnishing, +performance, or use of this material. + +*/ + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to zlib v1.2.11, which may be included +with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to the following which may be +included with JRE 8, JDK 8, and OpenJDK 8. + + Apache Commons Math 3.2 + Apache Derby 10.11.1.2 + Apache Jakarta BCEL 5.1 + Apache Santuario XML Security for Java 2.1.3 + Apache Xalan-Java 2.7.2 + Apache Xerces Java 2.10.0 + Apache XML Resolver 1.1 + + +--- begin of LICENSE --- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to OASIS PKCS #11 Cryptographic Token +Interface v3.0, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright © OASIS Open 2020. All Rights Reserved. + + All capitalized terms in the following text have the meanings +assigned to them in the OASIS Intellectual Property Rights Policy (the +"OASIS IPR Policy"). The full Policy may be found at the OASIS website: +[http://www.oasis-open.org/policies-guidelines/ipr] + + This document and translations of it may be copied and furnished to +others, and derivative works that comment on or otherwise explain it or +assist in its implementation may be prepared, copied, published, and +distributed, in whole or in part, without restriction of any kind, +provided that the above copyright notice and this section are included +on all such copies and derivative works. However, this document itself +may not be modified in any way, including by removing the copyright +notice or references to OASIS, except as needed for the purpose of +developing any document or deliverable produced by an OASIS Technical +Committee (in which case the rules applicable to copyrights, as set +forth in the OASIS IPR Policy, must be followed) or as required to +translate it into languages other than English. + + The limited permissions granted above are perpetual and will not be +revoked by OASIS or its successors or assigns. + + This document and the information contained herein is provided on an +"AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE +INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED +WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS +AND ITS MEMBERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR ANY +PART THEREOF. + + [OASIS requests that any OASIS Party or any other party that +believes it has patent claims that would necessarily be infringed by +implementations of this OASIS Standards Final Deliverable, to notify +OASIS TC Administrator and provide an indication of its willingness to +grant patent licenses to such patent claims in a manner consistent with +the IPR Mode of the OASIS Technical Committee that produced this +deliverable.] + + [OASIS invites any party to contact the OASIS TC Administrator if it +is aware of a claim of ownership of any patent claims that would +necessarily be infringed by implementations of this OASIS Standards +Final Deliverable by a patent holder that is not willing to provide a +license to such patent claims in a manner consistent with the IPR Mode +of the OASIS Technical Committee that produced this OASIS Standards +Final Deliverable. OASIS may include such claims on its website, but +disclaims any obligation to do so.] + + [OASIS takes no position regarding the validity or scope of any +intellectual property or other rights that might be claimed to pertain +to the implementation or use of the technology described in this OASIS +Standards Final Deliverable or the extent to which any license under +such rights might or might not be available; neither does it represent +that it has made any effort to identify any such rights. Information on +OASIS' procedures with respect to rights in any document or deliverable +produced by an OASIS Technical Committee can be found on the OASIS +website. Copies of claims of rights made available for publication and +any assurances of licenses to be made available, or the result of an +attempt made to obtain a general license or permission for the use of +such proprietary rights by implementers or users of this OASIS Standards +Final Deliverable, can be obtained from the OASIS TC Administrator. +OASIS makes no representation that any information or list of +intellectual property rights will at any time be complete, or that any +claims in such list are, in fact, Essential Claims.] + +--- end of LICENSE --- + +------------------------------------------------------------------------------- diff --git a/runtime/include/classfile_constants.h b/runtime/include/classfile_constants.h new file mode 100644 index 0000000..1fa6e3c --- /dev/null +++ b/runtime/include/classfile_constants.h @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef CLASSFILE_CONSTANTS_H +#define CLASSFILE_CONSTANTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Classfile version number for this information */ +#define JVM_CLASSFILE_MAJOR_VERSION 52 +#define JVM_CLASSFILE_MINOR_VERSION 0 + +/* Flags */ + +enum { + JVM_ACC_PUBLIC = 0x0001, + JVM_ACC_PRIVATE = 0x0002, + JVM_ACC_PROTECTED = 0x0004, + JVM_ACC_STATIC = 0x0008, + JVM_ACC_FINAL = 0x0010, + JVM_ACC_SYNCHRONIZED = 0x0020, + JVM_ACC_SUPER = 0x0020, + JVM_ACC_VOLATILE = 0x0040, + JVM_ACC_BRIDGE = 0x0040, + JVM_ACC_TRANSIENT = 0x0080, + JVM_ACC_VARARGS = 0x0080, + JVM_ACC_NATIVE = 0x0100, + JVM_ACC_INTERFACE = 0x0200, + JVM_ACC_ABSTRACT = 0x0400, + JVM_ACC_STRICT = 0x0800, + JVM_ACC_SYNTHETIC = 0x1000, + JVM_ACC_ANNOTATION = 0x2000, + JVM_ACC_ENUM = 0x4000 +}; + +/* Used in newarray instruction. */ + +enum { + JVM_T_BOOLEAN = 4, + JVM_T_CHAR = 5, + JVM_T_FLOAT = 6, + JVM_T_DOUBLE = 7, + JVM_T_BYTE = 8, + JVM_T_SHORT = 9, + JVM_T_INT = 10, + JVM_T_LONG = 11 +}; + +/* Constant Pool Entries */ + +enum { + JVM_CONSTANT_Utf8 = 1, + JVM_CONSTANT_Unicode = 2, /* unused */ + JVM_CONSTANT_Integer = 3, + JVM_CONSTANT_Float = 4, + JVM_CONSTANT_Long = 5, + JVM_CONSTANT_Double = 6, + JVM_CONSTANT_Class = 7, + JVM_CONSTANT_String = 8, + JVM_CONSTANT_Fieldref = 9, + JVM_CONSTANT_Methodref = 10, + JVM_CONSTANT_InterfaceMethodref = 11, + JVM_CONSTANT_NameAndType = 12, + JVM_CONSTANT_MethodHandle = 15, // JSR 292 + JVM_CONSTANT_MethodType = 16, // JSR 292 + JVM_CONSTANT_InvokeDynamic = 18 +}; + +/* JVM_CONSTANT_MethodHandle subtypes */ +enum { + JVM_REF_getField = 1, + JVM_REF_getStatic = 2, + JVM_REF_putField = 3, + JVM_REF_putStatic = 4, + JVM_REF_invokeVirtual = 5, + JVM_REF_invokeStatic = 6, + JVM_REF_invokeSpecial = 7, + JVM_REF_newInvokeSpecial = 8, + JVM_REF_invokeInterface = 9 +}; + +/* StackMapTable type item numbers */ + +enum { + JVM_ITEM_Top = 0, + JVM_ITEM_Integer = 1, + JVM_ITEM_Float = 2, + JVM_ITEM_Double = 3, + JVM_ITEM_Long = 4, + JVM_ITEM_Null = 5, + JVM_ITEM_UninitializedThis = 6, + JVM_ITEM_Object = 7, + JVM_ITEM_Uninitialized = 8 +}; + +/* Type signatures */ + +enum { + JVM_SIGNATURE_ARRAY = '[', + JVM_SIGNATURE_BYTE = 'B', + JVM_SIGNATURE_CHAR = 'C', + JVM_SIGNATURE_CLASS = 'L', + JVM_SIGNATURE_ENDCLASS = ';', + JVM_SIGNATURE_ENUM = 'E', + JVM_SIGNATURE_FLOAT = 'F', + JVM_SIGNATURE_DOUBLE = 'D', + JVM_SIGNATURE_FUNC = '(', + JVM_SIGNATURE_ENDFUNC = ')', + JVM_SIGNATURE_INT = 'I', + JVM_SIGNATURE_LONG = 'J', + JVM_SIGNATURE_SHORT = 'S', + JVM_SIGNATURE_VOID = 'V', + JVM_SIGNATURE_BOOLEAN = 'Z' +}; + +/* Opcodes */ + +enum { + JVM_OPC_nop = 0, + JVM_OPC_aconst_null = 1, + JVM_OPC_iconst_m1 = 2, + JVM_OPC_iconst_0 = 3, + JVM_OPC_iconst_1 = 4, + JVM_OPC_iconst_2 = 5, + JVM_OPC_iconst_3 = 6, + JVM_OPC_iconst_4 = 7, + JVM_OPC_iconst_5 = 8, + JVM_OPC_lconst_0 = 9, + JVM_OPC_lconst_1 = 10, + JVM_OPC_fconst_0 = 11, + JVM_OPC_fconst_1 = 12, + JVM_OPC_fconst_2 = 13, + JVM_OPC_dconst_0 = 14, + JVM_OPC_dconst_1 = 15, + JVM_OPC_bipush = 16, + JVM_OPC_sipush = 17, + JVM_OPC_ldc = 18, + JVM_OPC_ldc_w = 19, + JVM_OPC_ldc2_w = 20, + JVM_OPC_iload = 21, + JVM_OPC_lload = 22, + JVM_OPC_fload = 23, + JVM_OPC_dload = 24, + JVM_OPC_aload = 25, + JVM_OPC_iload_0 = 26, + JVM_OPC_iload_1 = 27, + JVM_OPC_iload_2 = 28, + JVM_OPC_iload_3 = 29, + JVM_OPC_lload_0 = 30, + JVM_OPC_lload_1 = 31, + JVM_OPC_lload_2 = 32, + JVM_OPC_lload_3 = 33, + JVM_OPC_fload_0 = 34, + JVM_OPC_fload_1 = 35, + JVM_OPC_fload_2 = 36, + JVM_OPC_fload_3 = 37, + JVM_OPC_dload_0 = 38, + JVM_OPC_dload_1 = 39, + JVM_OPC_dload_2 = 40, + JVM_OPC_dload_3 = 41, + JVM_OPC_aload_0 = 42, + JVM_OPC_aload_1 = 43, + JVM_OPC_aload_2 = 44, + JVM_OPC_aload_3 = 45, + JVM_OPC_iaload = 46, + JVM_OPC_laload = 47, + JVM_OPC_faload = 48, + JVM_OPC_daload = 49, + JVM_OPC_aaload = 50, + JVM_OPC_baload = 51, + JVM_OPC_caload = 52, + JVM_OPC_saload = 53, + JVM_OPC_istore = 54, + JVM_OPC_lstore = 55, + JVM_OPC_fstore = 56, + JVM_OPC_dstore = 57, + JVM_OPC_astore = 58, + JVM_OPC_istore_0 = 59, + JVM_OPC_istore_1 = 60, + JVM_OPC_istore_2 = 61, + JVM_OPC_istore_3 = 62, + JVM_OPC_lstore_0 = 63, + JVM_OPC_lstore_1 = 64, + JVM_OPC_lstore_2 = 65, + JVM_OPC_lstore_3 = 66, + JVM_OPC_fstore_0 = 67, + JVM_OPC_fstore_1 = 68, + JVM_OPC_fstore_2 = 69, + JVM_OPC_fstore_3 = 70, + JVM_OPC_dstore_0 = 71, + JVM_OPC_dstore_1 = 72, + JVM_OPC_dstore_2 = 73, + JVM_OPC_dstore_3 = 74, + JVM_OPC_astore_0 = 75, + JVM_OPC_astore_1 = 76, + JVM_OPC_astore_2 = 77, + JVM_OPC_astore_3 = 78, + JVM_OPC_iastore = 79, + JVM_OPC_lastore = 80, + JVM_OPC_fastore = 81, + JVM_OPC_dastore = 82, + JVM_OPC_aastore = 83, + JVM_OPC_bastore = 84, + JVM_OPC_castore = 85, + JVM_OPC_sastore = 86, + JVM_OPC_pop = 87, + JVM_OPC_pop2 = 88, + JVM_OPC_dup = 89, + JVM_OPC_dup_x1 = 90, + JVM_OPC_dup_x2 = 91, + JVM_OPC_dup2 = 92, + JVM_OPC_dup2_x1 = 93, + JVM_OPC_dup2_x2 = 94, + JVM_OPC_swap = 95, + JVM_OPC_iadd = 96, + JVM_OPC_ladd = 97, + JVM_OPC_fadd = 98, + JVM_OPC_dadd = 99, + JVM_OPC_isub = 100, + JVM_OPC_lsub = 101, + JVM_OPC_fsub = 102, + JVM_OPC_dsub = 103, + JVM_OPC_imul = 104, + JVM_OPC_lmul = 105, + JVM_OPC_fmul = 106, + JVM_OPC_dmul = 107, + JVM_OPC_idiv = 108, + JVM_OPC_ldiv = 109, + JVM_OPC_fdiv = 110, + JVM_OPC_ddiv = 111, + JVM_OPC_irem = 112, + JVM_OPC_lrem = 113, + JVM_OPC_frem = 114, + JVM_OPC_drem = 115, + JVM_OPC_ineg = 116, + JVM_OPC_lneg = 117, + JVM_OPC_fneg = 118, + JVM_OPC_dneg = 119, + JVM_OPC_ishl = 120, + JVM_OPC_lshl = 121, + JVM_OPC_ishr = 122, + JVM_OPC_lshr = 123, + JVM_OPC_iushr = 124, + JVM_OPC_lushr = 125, + JVM_OPC_iand = 126, + JVM_OPC_land = 127, + JVM_OPC_ior = 128, + JVM_OPC_lor = 129, + JVM_OPC_ixor = 130, + JVM_OPC_lxor = 131, + JVM_OPC_iinc = 132, + JVM_OPC_i2l = 133, + JVM_OPC_i2f = 134, + JVM_OPC_i2d = 135, + JVM_OPC_l2i = 136, + JVM_OPC_l2f = 137, + JVM_OPC_l2d = 138, + JVM_OPC_f2i = 139, + JVM_OPC_f2l = 140, + JVM_OPC_f2d = 141, + JVM_OPC_d2i = 142, + JVM_OPC_d2l = 143, + JVM_OPC_d2f = 144, + JVM_OPC_i2b = 145, + JVM_OPC_i2c = 146, + JVM_OPC_i2s = 147, + JVM_OPC_lcmp = 148, + JVM_OPC_fcmpl = 149, + JVM_OPC_fcmpg = 150, + JVM_OPC_dcmpl = 151, + JVM_OPC_dcmpg = 152, + JVM_OPC_ifeq = 153, + JVM_OPC_ifne = 154, + JVM_OPC_iflt = 155, + JVM_OPC_ifge = 156, + JVM_OPC_ifgt = 157, + JVM_OPC_ifle = 158, + JVM_OPC_if_icmpeq = 159, + JVM_OPC_if_icmpne = 160, + JVM_OPC_if_icmplt = 161, + JVM_OPC_if_icmpge = 162, + JVM_OPC_if_icmpgt = 163, + JVM_OPC_if_icmple = 164, + JVM_OPC_if_acmpeq = 165, + JVM_OPC_if_acmpne = 166, + JVM_OPC_goto = 167, + JVM_OPC_jsr = 168, + JVM_OPC_ret = 169, + JVM_OPC_tableswitch = 170, + JVM_OPC_lookupswitch = 171, + JVM_OPC_ireturn = 172, + JVM_OPC_lreturn = 173, + JVM_OPC_freturn = 174, + JVM_OPC_dreturn = 175, + JVM_OPC_areturn = 176, + JVM_OPC_return = 177, + JVM_OPC_getstatic = 178, + JVM_OPC_putstatic = 179, + JVM_OPC_getfield = 180, + JVM_OPC_putfield = 181, + JVM_OPC_invokevirtual = 182, + JVM_OPC_invokespecial = 183, + JVM_OPC_invokestatic = 184, + JVM_OPC_invokeinterface = 185, + JVM_OPC_invokedynamic = 186, + JVM_OPC_new = 187, + JVM_OPC_newarray = 188, + JVM_OPC_anewarray = 189, + JVM_OPC_arraylength = 190, + JVM_OPC_athrow = 191, + JVM_OPC_checkcast = 192, + JVM_OPC_instanceof = 193, + JVM_OPC_monitorenter = 194, + JVM_OPC_monitorexit = 195, + JVM_OPC_wide = 196, + JVM_OPC_multianewarray = 197, + JVM_OPC_ifnull = 198, + JVM_OPC_ifnonnull = 199, + JVM_OPC_goto_w = 200, + JVM_OPC_jsr_w = 201, + JVM_OPC_MAX = 201 +}; + +/* Opcode length initializer, use with something like: + * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER; + */ +#define JVM_OPCODE_LENGTH_INITIALIZER { \ + 1, /* nop */ \ + 1, /* aconst_null */ \ + 1, /* iconst_m1 */ \ + 1, /* iconst_0 */ \ + 1, /* iconst_1 */ \ + 1, /* iconst_2 */ \ + 1, /* iconst_3 */ \ + 1, /* iconst_4 */ \ + 1, /* iconst_5 */ \ + 1, /* lconst_0 */ \ + 1, /* lconst_1 */ \ + 1, /* fconst_0 */ \ + 1, /* fconst_1 */ \ + 1, /* fconst_2 */ \ + 1, /* dconst_0 */ \ + 1, /* dconst_1 */ \ + 2, /* bipush */ \ + 3, /* sipush */ \ + 2, /* ldc */ \ + 3, /* ldc_w */ \ + 3, /* ldc2_w */ \ + 2, /* iload */ \ + 2, /* lload */ \ + 2, /* fload */ \ + 2, /* dload */ \ + 2, /* aload */ \ + 1, /* iload_0 */ \ + 1, /* iload_1 */ \ + 1, /* iload_2 */ \ + 1, /* iload_3 */ \ + 1, /* lload_0 */ \ + 1, /* lload_1 */ \ + 1, /* lload_2 */ \ + 1, /* lload_3 */ \ + 1, /* fload_0 */ \ + 1, /* fload_1 */ \ + 1, /* fload_2 */ \ + 1, /* fload_3 */ \ + 1, /* dload_0 */ \ + 1, /* dload_1 */ \ + 1, /* dload_2 */ \ + 1, /* dload_3 */ \ + 1, /* aload_0 */ \ + 1, /* aload_1 */ \ + 1, /* aload_2 */ \ + 1, /* aload_3 */ \ + 1, /* iaload */ \ + 1, /* laload */ \ + 1, /* faload */ \ + 1, /* daload */ \ + 1, /* aaload */ \ + 1, /* baload */ \ + 1, /* caload */ \ + 1, /* saload */ \ + 2, /* istore */ \ + 2, /* lstore */ \ + 2, /* fstore */ \ + 2, /* dstore */ \ + 2, /* astore */ \ + 1, /* istore_0 */ \ + 1, /* istore_1 */ \ + 1, /* istore_2 */ \ + 1, /* istore_3 */ \ + 1, /* lstore_0 */ \ + 1, /* lstore_1 */ \ + 1, /* lstore_2 */ \ + 1, /* lstore_3 */ \ + 1, /* fstore_0 */ \ + 1, /* fstore_1 */ \ + 1, /* fstore_2 */ \ + 1, /* fstore_3 */ \ + 1, /* dstore_0 */ \ + 1, /* dstore_1 */ \ + 1, /* dstore_2 */ \ + 1, /* dstore_3 */ \ + 1, /* astore_0 */ \ + 1, /* astore_1 */ \ + 1, /* astore_2 */ \ + 1, /* astore_3 */ \ + 1, /* iastore */ \ + 1, /* lastore */ \ + 1, /* fastore */ \ + 1, /* dastore */ \ + 1, /* aastore */ \ + 1, /* bastore */ \ + 1, /* castore */ \ + 1, /* sastore */ \ + 1, /* pop */ \ + 1, /* pop2 */ \ + 1, /* dup */ \ + 1, /* dup_x1 */ \ + 1, /* dup_x2 */ \ + 1, /* dup2 */ \ + 1, /* dup2_x1 */ \ + 1, /* dup2_x2 */ \ + 1, /* swap */ \ + 1, /* iadd */ \ + 1, /* ladd */ \ + 1, /* fadd */ \ + 1, /* dadd */ \ + 1, /* isub */ \ + 1, /* lsub */ \ + 1, /* fsub */ \ + 1, /* dsub */ \ + 1, /* imul */ \ + 1, /* lmul */ \ + 1, /* fmul */ \ + 1, /* dmul */ \ + 1, /* idiv */ \ + 1, /* ldiv */ \ + 1, /* fdiv */ \ + 1, /* ddiv */ \ + 1, /* irem */ \ + 1, /* lrem */ \ + 1, /* frem */ \ + 1, /* drem */ \ + 1, /* ineg */ \ + 1, /* lneg */ \ + 1, /* fneg */ \ + 1, /* dneg */ \ + 1, /* ishl */ \ + 1, /* lshl */ \ + 1, /* ishr */ \ + 1, /* lshr */ \ + 1, /* iushr */ \ + 1, /* lushr */ \ + 1, /* iand */ \ + 1, /* land */ \ + 1, /* ior */ \ + 1, /* lor */ \ + 1, /* ixor */ \ + 1, /* lxor */ \ + 3, /* iinc */ \ + 1, /* i2l */ \ + 1, /* i2f */ \ + 1, /* i2d */ \ + 1, /* l2i */ \ + 1, /* l2f */ \ + 1, /* l2d */ \ + 1, /* f2i */ \ + 1, /* f2l */ \ + 1, /* f2d */ \ + 1, /* d2i */ \ + 1, /* d2l */ \ + 1, /* d2f */ \ + 1, /* i2b */ \ + 1, /* i2c */ \ + 1, /* i2s */ \ + 1, /* lcmp */ \ + 1, /* fcmpl */ \ + 1, /* fcmpg */ \ + 1, /* dcmpl */ \ + 1, /* dcmpg */ \ + 3, /* ifeq */ \ + 3, /* ifne */ \ + 3, /* iflt */ \ + 3, /* ifge */ \ + 3, /* ifgt */ \ + 3, /* ifle */ \ + 3, /* if_icmpeq */ \ + 3, /* if_icmpne */ \ + 3, /* if_icmplt */ \ + 3, /* if_icmpge */ \ + 3, /* if_icmpgt */ \ + 3, /* if_icmple */ \ + 3, /* if_acmpeq */ \ + 3, /* if_acmpne */ \ + 3, /* goto */ \ + 3, /* jsr */ \ + 2, /* ret */ \ + 99, /* tableswitch */ \ + 99, /* lookupswitch */ \ + 1, /* ireturn */ \ + 1, /* lreturn */ \ + 1, /* freturn */ \ + 1, /* dreturn */ \ + 1, /* areturn */ \ + 1, /* return */ \ + 3, /* getstatic */ \ + 3, /* putstatic */ \ + 3, /* getfield */ \ + 3, /* putfield */ \ + 3, /* invokevirtual */ \ + 3, /* invokespecial */ \ + 3, /* invokestatic */ \ + 5, /* invokeinterface */ \ + 5, /* invokedynamic */ \ + 3, /* new */ \ + 2, /* newarray */ \ + 3, /* anewarray */ \ + 1, /* arraylength */ \ + 1, /* athrow */ \ + 3, /* checkcast */ \ + 3, /* instanceof */ \ + 1, /* monitorenter */ \ + 1, /* monitorexit */ \ + 0, /* wide */ \ + 4, /* multianewarray */ \ + 3, /* ifnull */ \ + 3, /* ifnonnull */ \ + 5, /* goto_w */ \ + 5 /* jsr_w */ \ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* CLASSFILE_CONSTANTS */ diff --git a/runtime/include/jawt.h b/runtime/include/jawt.h new file mode 100644 index 0000000..e0f682f --- /dev/null +++ b/runtime/include/jawt.h @@ -0,0 +1,299 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef _JAVASOFT_JAWT_H_ +#define _JAVASOFT_JAWT_H_ + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * AWT native interface (new in JDK 1.3) + * + * The AWT native interface allows a native C or C++ application a means + * by which to access native structures in AWT. This is to facilitate moving + * legacy C and C++ applications to Java and to target the needs of the + * community who, at present, wish to do their own native rendering to canvases + * for performance reasons. Standard extensions such as Java3D also require a + * means to access the underlying native data structures of AWT. + * + * There may be future extensions to this API depending on demand. + * + * A VM does not have to implement this API in order to pass the JCK. + * It is recommended, however, that this API is implemented on VMs that support + * standard extensions, such as Java3D. + * + * Since this is a native API, any program which uses it cannot be considered + * 100% pure java. + */ + +/* + * AWT Native Drawing Surface (JAWT_DrawingSurface). + * + * For each platform, there is a native drawing surface structure. This + * platform-specific structure can be found in jawt_md.h. It is recommended + * that additional platforms follow the same model. It is also recommended + * that VMs on Win32 and Solaris support the existing structures in jawt_md.h. + * + ******************* + * EXAMPLE OF USAGE: + ******************* + * + * In Win32, a programmer wishes to access the HWND of a canvas to perform + * native rendering into it. The programmer has declared the paint() method + * for their canvas subclass to be native: + * + * + * MyCanvas.java: + * + * import java.awt.*; + * + * public class MyCanvas extends Canvas { + * + * static { + * System.loadLibrary("mylib"); + * } + * + * public native void paint(Graphics g); + * } + * + * + * myfile.c: + * + * #include "jawt_md.h" + * #include + * + * JNIEXPORT void JNICALL + * Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics) + * { + * JAWT awt; + * JAWT_DrawingSurface* ds; + * JAWT_DrawingSurfaceInfo* dsi; + * JAWT_Win32DrawingSurfaceInfo* dsi_win; + * jboolean result; + * jint lock; + * + * // Get the AWT + * awt.version = JAWT_VERSION_1_3; + * result = JAWT_GetAWT(env, &awt); + * assert(result != JNI_FALSE); + * + * // Get the drawing surface + * ds = awt.GetDrawingSurface(env, canvas); + * assert(ds != NULL); + * + * // Lock the drawing surface + * lock = ds->Lock(ds); + * assert((lock & JAWT_LOCK_ERROR) == 0); + * + * // Get the drawing surface info + * dsi = ds->GetDrawingSurfaceInfo(ds); + * + * // Get the platform-specific drawing info + * dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo; + * + * ////////////////////////////// + * // !!! DO PAINTING HERE !!! // + * ////////////////////////////// + * + * // Free the drawing surface info + * ds->FreeDrawingSurfaceInfo(dsi); + * + * // Unlock the drawing surface + * ds->Unlock(ds); + * + * // Free the drawing surface + * awt.FreeDrawingSurface(ds); + * } + * + */ + +/* + * JAWT_Rectangle + * Structure for a native rectangle. + */ +typedef struct jawt_Rectangle { + jint x; + jint y; + jint width; + jint height; +} JAWT_Rectangle; + +struct jawt_DrawingSurface; + +/* + * JAWT_DrawingSurfaceInfo + * Structure for containing the underlying drawing information of a component. + */ +typedef struct jawt_DrawingSurfaceInfo { + /* + * Pointer to the platform-specific information. This can be safely + * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a + * JAWT_X11DrawingSurfaceInfo on Solaris. On Mac OS X this is a + * pointer to a NSObject that conforms to the JAWT_SurfaceLayers + * protocol. See jawt_md.h for details. + */ + void* platformInfo; + /* Cached pointer to the underlying drawing surface */ + struct jawt_DrawingSurface* ds; + /* Bounding rectangle of the drawing surface */ + JAWT_Rectangle bounds; + /* Number of rectangles in the clip */ + jint clipSize; + /* Clip rectangle array */ + JAWT_Rectangle* clip; +} JAWT_DrawingSurfaceInfo; + +#define JAWT_LOCK_ERROR 0x00000001 +#define JAWT_LOCK_CLIP_CHANGED 0x00000002 +#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004 +#define JAWT_LOCK_SURFACE_CHANGED 0x00000008 + +/* + * JAWT_DrawingSurface + * Structure for containing the underlying drawing information of a component. + * All operations on a JAWT_DrawingSurface MUST be performed from the same + * thread as the call to GetDrawingSurface. + */ +typedef struct jawt_DrawingSurface { + /* + * Cached reference to the Java environment of the calling thread. + * If Lock(), Unlock(), GetDrawingSurfaceInfo() or + * FreeDrawingSurfaceInfo() are called from a different thread, + * this data member should be set before calling those functions. + */ + JNIEnv* env; + /* Cached reference to the target object */ + jobject target; + /* + * Lock the surface of the target component for native rendering. + * When finished drawing, the surface must be unlocked with + * Unlock(). This function returns a bitmask with one or more of the + * following values: + * + * JAWT_LOCK_ERROR - When an error has occurred and the surface could not + * be locked. + * + * JAWT_LOCK_CLIP_CHANGED - When the clip region has changed. + * + * JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed. + * + * JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed + */ + jint (JNICALL *Lock) + (struct jawt_DrawingSurface* ds); + /* + * Get the drawing surface info. + * The value returned may be cached, but the values may change if + * additional calls to Lock() or Unlock() are made. + * Lock() must be called before this can return a valid value. + * Returns NULL if an error has occurred. + * When finished with the returned value, FreeDrawingSurfaceInfo must be + * called. + */ + JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo) + (struct jawt_DrawingSurface* ds); + /* + * Free the drawing surface info. + */ + void (JNICALL *FreeDrawingSurfaceInfo) + (JAWT_DrawingSurfaceInfo* dsi); + /* + * Unlock the drawing surface of the target component for native rendering. + */ + void (JNICALL *Unlock) + (struct jawt_DrawingSurface* ds); +} JAWT_DrawingSurface; + +/* + * JAWT + * Structure for containing native AWT functions. + */ +typedef struct jawt { + /* + * Version of this structure. This must always be set before + * calling JAWT_GetAWT() + */ + jint version; + /* + * Return a drawing surface from a target jobject. This value + * may be cached. + * Returns NULL if an error has occurred. + * Target must be a java.awt.Component (should be a Canvas + * or Window for native rendering). + * FreeDrawingSurface() must be called when finished with the + * returned JAWT_DrawingSurface. + */ + JAWT_DrawingSurface* (JNICALL *GetDrawingSurface) + (JNIEnv* env, jobject target); + /* + * Free the drawing surface allocated in GetDrawingSurface. + */ + void (JNICALL *FreeDrawingSurface) + (JAWT_DrawingSurface* ds); + /* + * Since 1.4 + * Locks the entire AWT for synchronization purposes + */ + void (JNICALL *Lock)(JNIEnv* env); + /* + * Since 1.4 + * Unlocks the entire AWT for synchronization purposes + */ + void (JNICALL *Unlock)(JNIEnv* env); + /* + * Since 1.4 + * Returns a reference to a java.awt.Component from a native + * platform handle. On Windows, this corresponds to an HWND; + * on Solaris and Linux, this is a Drawable. For other platforms, + * see the appropriate machine-dependent header file for a description. + * The reference returned by this function is a local + * reference that is only valid in this environment. + * This function returns a NULL reference if no component could be + * found with matching platform information. + */ + jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo); + +} JAWT; + +/* + * Get the AWT native structure. This function returns JNI_FALSE if + * an error occurs. + */ +_JNI_IMPORT_OR_EXPORT_ +jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt); + +#define JAWT_VERSION_1_3 0x00010003 +#define JAWT_VERSION_1_4 0x00010004 +#define JAWT_VERSION_1_7 0x00010007 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !_JAVASOFT_JAWT_H_ */ diff --git a/runtime/include/jdwpTransport.h b/runtime/include/jdwpTransport.h new file mode 100644 index 0000000..32ccdea --- /dev/null +++ b/runtime/include/jdwpTransport.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Java Debug Wire Protocol Transport Service Provider Interface. + */ + +#ifndef JDWPTRANSPORT_H +#define JDWPTRANSPORT_H + +#include "jni.h" + +enum { + JDWPTRANSPORT_VERSION_1_0 = 0x00010000 +}; + +#ifdef __cplusplus +extern "C" { +#endif + +struct jdwpTransportNativeInterface_; + +struct _jdwpTransportEnv; + +#ifdef __cplusplus +typedef _jdwpTransportEnv jdwpTransportEnv; +#else +typedef const struct jdwpTransportNativeInterface_ *jdwpTransportEnv; +#endif /* __cplusplus */ + +/* + * Errors. Universal errors with JVMTI/JVMDI equivalents keep the + * values the same. + */ +typedef enum { + JDWPTRANSPORT_ERROR_NONE = 0, + JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT = 103, + JDWPTRANSPORT_ERROR_OUT_OF_MEMORY = 110, + JDWPTRANSPORT_ERROR_INTERNAL = 113, + JDWPTRANSPORT_ERROR_ILLEGAL_STATE = 201, + JDWPTRANSPORT_ERROR_IO_ERROR = 202, + JDWPTRANSPORT_ERROR_TIMEOUT = 203, + JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE = 204 +} jdwpTransportError; + + +/* + * Structure to define capabilities + */ +typedef struct { + unsigned int can_timeout_attach :1; + unsigned int can_timeout_accept :1; + unsigned int can_timeout_handshake :1; + unsigned int reserved3 :1; + unsigned int reserved4 :1; + unsigned int reserved5 :1; + unsigned int reserved6 :1; + unsigned int reserved7 :1; + unsigned int reserved8 :1; + unsigned int reserved9 :1; + unsigned int reserved10 :1; + unsigned int reserved11 :1; + unsigned int reserved12 :1; + unsigned int reserved13 :1; + unsigned int reserved14 :1; + unsigned int reserved15 :1; +} JDWPTransportCapabilities; + + +/* + * Structures to define packet layout. + * + * See: http://java.sun.com/j2se/1.5/docs/guide/jpda/jdwp-spec.html + */ + +enum { + /* + * If additional flags are added that apply to jdwpCmdPacket, + * then debugLoop.c: reader() will need to be updated to + * accept more than JDWPTRANSPORT_FLAGS_NONE. + */ + JDWPTRANSPORT_FLAGS_NONE = 0x0, + JDWPTRANSPORT_FLAGS_REPLY = 0x80 +}; + +typedef struct { + jint len; + jint id; + jbyte flags; + jbyte cmdSet; + jbyte cmd; + jbyte *data; +} jdwpCmdPacket; + +typedef struct { + jint len; + jint id; + jbyte flags; + jshort errorCode; + jbyte *data; +} jdwpReplyPacket; + +typedef struct { + union { + jdwpCmdPacket cmd; + jdwpReplyPacket reply; + } type; +} jdwpPacket; + +/* + * JDWP functions called by the transport. + */ +typedef struct jdwpTransportCallback { + void *(*alloc)(jint numBytes); /* Call this for all allocations */ + void (*free)(void *buffer); /* Call this for all deallocations */ +} jdwpTransportCallback; + +typedef jint (JNICALL *jdwpTransport_OnLoad_t)(JavaVM *jvm, + jdwpTransportCallback *callback, + jint version, + jdwpTransportEnv** env); + + + +/* Function Interface */ + +struct jdwpTransportNativeInterface_ { + /* 1 : RESERVED */ + void *reserved1; + + /* 2 : Get Capabilities */ + jdwpTransportError (JNICALL *GetCapabilities)(jdwpTransportEnv* env, + JDWPTransportCapabilities *capabilities_ptr); + + /* 3 : Attach */ + jdwpTransportError (JNICALL *Attach)(jdwpTransportEnv* env, + const char* address, + jlong attach_timeout, + jlong handshake_timeout); + + /* 4: StartListening */ + jdwpTransportError (JNICALL *StartListening)(jdwpTransportEnv* env, + const char* address, + char** actual_address); + + /* 5: StopListening */ + jdwpTransportError (JNICALL *StopListening)(jdwpTransportEnv* env); + + /* 6: Accept */ + jdwpTransportError (JNICALL *Accept)(jdwpTransportEnv* env, + jlong accept_timeout, + jlong handshake_timeout); + + /* 7: IsOpen */ + jboolean (JNICALL *IsOpen)(jdwpTransportEnv* env); + + /* 8: Close */ + jdwpTransportError (JNICALL *Close)(jdwpTransportEnv* env); + + /* 9: ReadPacket */ + jdwpTransportError (JNICALL *ReadPacket)(jdwpTransportEnv* env, + jdwpPacket *pkt); + + /* 10: Write Packet */ + jdwpTransportError (JNICALL *WritePacket)(jdwpTransportEnv* env, + const jdwpPacket* pkt); + + /* 11: GetLastError */ + jdwpTransportError (JNICALL *GetLastError)(jdwpTransportEnv* env, + char** error); + +}; + + +/* + * Use inlined functions so that C++ code can use syntax such as + * env->Attach("mymachine:5000", 10*1000, 0); + * + * rather than using C's :- + * + * (*env)->Attach(env, "mymachine:5000", 10*1000, 0); + */ +struct _jdwpTransportEnv { + const struct jdwpTransportNativeInterface_ *functions; +#ifdef __cplusplus + + jdwpTransportError GetCapabilities(JDWPTransportCapabilities *capabilities_ptr) { + return functions->GetCapabilities(this, capabilities_ptr); + } + + jdwpTransportError Attach(const char* address, jlong attach_timeout, + jlong handshake_timeout) { + return functions->Attach(this, address, attach_timeout, handshake_timeout); + } + + jdwpTransportError StartListening(const char* address, + char** actual_address) { + return functions->StartListening(this, address, actual_address); + } + + jdwpTransportError StopListening(void) { + return functions->StopListening(this); + } + + jdwpTransportError Accept(jlong accept_timeout, jlong handshake_timeout) { + return functions->Accept(this, accept_timeout, handshake_timeout); + } + + jboolean IsOpen(void) { + return functions->IsOpen(this); + } + + jdwpTransportError Close(void) { + return functions->Close(this); + } + + jdwpTransportError ReadPacket(jdwpPacket *pkt) { + return functions->ReadPacket(this, pkt); + } + + jdwpTransportError WritePacket(const jdwpPacket* pkt) { + return functions->WritePacket(this, pkt); + } + + jdwpTransportError GetLastError(char** error) { + return functions->GetLastError(this, error); + } + + +#endif /* __cplusplus */ +}; + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* JDWPTRANSPORT_H */ diff --git a/runtime/include/jni.h b/runtime/include/jni.h new file mode 100644 index 0000000..2e83cb7 --- /dev/null +++ b/runtime/include/jni.h @@ -0,0 +1,1960 @@ +/* + * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * We used part of Netscape's Java Runtime Interface (JRI) as the starting + * point of our design and implementation. + */ + +/****************************************************************************** + * Java Runtime Interface + * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved. + *****************************************************************************/ + +#ifndef _JAVASOFT_JNI_H_ +#define _JAVASOFT_JNI_H_ + +#include +#include + +/* jni_md.h contains the machine-dependent typedefs for jbyte, jint + and jlong */ + +#include "jni_md.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * JNI Types + */ + +#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H + +typedef unsigned char jboolean; +typedef unsigned short jchar; +typedef short jshort; +typedef float jfloat; +typedef double jdouble; + +typedef jint jsize; + +#ifdef __cplusplus + +class _jobject {}; +class _jclass : public _jobject {}; +class _jthrowable : public _jobject {}; +class _jstring : public _jobject {}; +class _jarray : public _jobject {}; +class _jbooleanArray : public _jarray {}; +class _jbyteArray : public _jarray {}; +class _jcharArray : public _jarray {}; +class _jshortArray : public _jarray {}; +class _jintArray : public _jarray {}; +class _jlongArray : public _jarray {}; +class _jfloatArray : public _jarray {}; +class _jdoubleArray : public _jarray {}; +class _jobjectArray : public _jarray {}; + +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef _jthrowable *jthrowable; +typedef _jstring *jstring; +typedef _jarray *jarray; +typedef _jbooleanArray *jbooleanArray; +typedef _jbyteArray *jbyteArray; +typedef _jcharArray *jcharArray; +typedef _jshortArray *jshortArray; +typedef _jintArray *jintArray; +typedef _jlongArray *jlongArray; +typedef _jfloatArray *jfloatArray; +typedef _jdoubleArray *jdoubleArray; +typedef _jobjectArray *jobjectArray; + +#else + +struct _jobject; + +typedef struct _jobject *jobject; +typedef jobject jclass; +typedef jobject jthrowable; +typedef jobject jstring; +typedef jobject jarray; +typedef jarray jbooleanArray; +typedef jarray jbyteArray; +typedef jarray jcharArray; +typedef jarray jshortArray; +typedef jarray jintArray; +typedef jarray jlongArray; +typedef jarray jfloatArray; +typedef jarray jdoubleArray; +typedef jarray jobjectArray; + +#endif + +typedef jobject jweak; + +typedef union jvalue { + jboolean z; + jbyte b; + jchar c; + jshort s; + jint i; + jlong j; + jfloat f; + jdouble d; + jobject l; +} jvalue; + +struct _jfieldID; +typedef struct _jfieldID *jfieldID; + +struct _jmethodID; +typedef struct _jmethodID *jmethodID; + +/* Return values from jobjectRefType */ +typedef enum _jobjectType { + JNIInvalidRefType = 0, + JNILocalRefType = 1, + JNIGlobalRefType = 2, + JNIWeakGlobalRefType = 3 +} jobjectRefType; + + +#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */ + +/* + * jboolean constants + */ + +#define JNI_FALSE 0 +#define JNI_TRUE 1 + +/* + * possible return values for JNI functions. + */ + +#define JNI_OK 0 /* success */ +#define JNI_ERR (-1) /* unknown error */ +#define JNI_EDETACHED (-2) /* thread detached from the VM */ +#define JNI_EVERSION (-3) /* JNI version error */ +#define JNI_ENOMEM (-4) /* not enough memory */ +#define JNI_EEXIST (-5) /* VM already created */ +#define JNI_EINVAL (-6) /* invalid arguments */ + +/* + * used in ReleaseScalarArrayElements + */ + +#define JNI_COMMIT 1 +#define JNI_ABORT 2 + +/* + * used in RegisterNatives to describe native method name, signature, + * and function pointer. + */ + +typedef struct { + char *name; + char *signature; + void *fnPtr; +} JNINativeMethod; + +/* + * JNI Native Method Interface. + */ + +struct JNINativeInterface_; + +struct JNIEnv_; + +#ifdef __cplusplus +typedef JNIEnv_ JNIEnv; +#else +typedef const struct JNINativeInterface_ *JNIEnv; +#endif + +/* + * JNI Invocation Interface. + */ + +struct JNIInvokeInterface_; + +struct JavaVM_; + +#ifdef __cplusplus +typedef JavaVM_ JavaVM; +#else +typedef const struct JNIInvokeInterface_ *JavaVM; +#endif + +struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + void *reserved3; + jint (JNICALL *GetVersion)(JNIEnv *env); + + jclass (JNICALL *DefineClass) + (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, + jsize len); + jclass (JNICALL *FindClass) + (JNIEnv *env, const char *name); + + jmethodID (JNICALL *FromReflectedMethod) + (JNIEnv *env, jobject method); + jfieldID (JNICALL *FromReflectedField) + (JNIEnv *env, jobject field); + + jobject (JNICALL *ToReflectedMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (JNICALL *GetSuperclass) + (JNIEnv *env, jclass sub); + jboolean (JNICALL *IsAssignableFrom) + (JNIEnv *env, jclass sub, jclass sup); + + jobject (JNICALL *ToReflectedField) + (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (JNICALL *Throw) + (JNIEnv *env, jthrowable obj); + jint (JNICALL *ThrowNew) + (JNIEnv *env, jclass clazz, const char *msg); + jthrowable (JNICALL *ExceptionOccurred) + (JNIEnv *env); + void (JNICALL *ExceptionDescribe) + (JNIEnv *env); + void (JNICALL *ExceptionClear) + (JNIEnv *env); + void (JNICALL *FatalError) + (JNIEnv *env, const char *msg); + + jint (JNICALL *PushLocalFrame) + (JNIEnv *env, jint capacity); + jobject (JNICALL *PopLocalFrame) + (JNIEnv *env, jobject result); + + jobject (JNICALL *NewGlobalRef) + (JNIEnv *env, jobject lobj); + void (JNICALL *DeleteGlobalRef) + (JNIEnv *env, jobject gref); + void (JNICALL *DeleteLocalRef) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsSameObject) + (JNIEnv *env, jobject obj1, jobject obj2); + jobject (JNICALL *NewLocalRef) + (JNIEnv *env, jobject ref); + jint (JNICALL *EnsureLocalCapacity) + (JNIEnv *env, jint capacity); + + jobject (JNICALL *AllocObject) + (JNIEnv *env, jclass clazz); + jobject (JNICALL *NewObject) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *NewObjectV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *NewObjectA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jclass (JNICALL *GetObjectClass) + (JNIEnv *env, jobject obj); + jboolean (JNICALL *IsInstanceOf) + (JNIEnv *env, jobject obj, jclass clazz); + + jmethodID (JNICALL *GetMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallObjectMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jobject (JNICALL *CallObjectMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jobject (JNICALL *CallObjectMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jboolean (JNICALL *CallBooleanMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jboolean (JNICALL *CallBooleanMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jboolean (JNICALL *CallBooleanMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jbyte (JNICALL *CallByteMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jbyte (JNICALL *CallByteMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jbyte (JNICALL *CallByteMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallCharMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jchar (JNICALL *CallCharMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jchar (JNICALL *CallCharMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallShortMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jshort (JNICALL *CallShortMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jshort (JNICALL *CallShortMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallIntMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jint (JNICALL *CallIntMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jint (JNICALL *CallIntMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallLongMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jlong (JNICALL *CallLongMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jlong (JNICALL *CallLongMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallFloatMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jfloat (JNICALL *CallFloatMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jfloat (JNICALL *CallFloatMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallDoubleMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + jdouble (JNICALL *CallDoubleMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + jdouble (JNICALL *CallDoubleMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallVoidMethod) + (JNIEnv *env, jobject obj, jmethodID methodID, ...); + void (JNICALL *CallVoidMethodV) + (JNIEnv *env, jobject obj, jmethodID methodID, va_list args); + void (JNICALL *CallVoidMethodA) + (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); + + jobject (JNICALL *CallNonvirtualObjectMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallNonvirtualObjectMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jobject (JNICALL *CallNonvirtualObjectMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jboolean (JNICALL *CallNonvirtualBooleanMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallNonvirtualBooleanMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jboolean (JNICALL *CallNonvirtualBooleanMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jbyte (JNICALL *CallNonvirtualByteMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallNonvirtualByteMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jbyte (JNICALL *CallNonvirtualByteMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jchar (JNICALL *CallNonvirtualCharMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallNonvirtualCharMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jchar (JNICALL *CallNonvirtualCharMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jshort (JNICALL *CallNonvirtualShortMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallNonvirtualShortMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jshort (JNICALL *CallNonvirtualShortMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jint (JNICALL *CallNonvirtualIntMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallNonvirtualIntMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jint (JNICALL *CallNonvirtualIntMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jlong (JNICALL *CallNonvirtualLongMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallNonvirtualLongMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jlong (JNICALL *CallNonvirtualLongMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jfloat (JNICALL *CallNonvirtualFloatMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallNonvirtualFloatMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jfloat (JNICALL *CallNonvirtualFloatMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + jdouble (JNICALL *CallNonvirtualDoubleMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallNonvirtualDoubleMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + jdouble (JNICALL *CallNonvirtualDoubleMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue *args); + + void (JNICALL *CallNonvirtualVoidMethod) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (JNICALL *CallNonvirtualVoidMethodV) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + va_list args); + void (JNICALL *CallNonvirtualVoidMethodA) + (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue * args); + + jfieldID (JNICALL *GetFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *GetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jboolean (JNICALL *GetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jbyte (JNICALL *GetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jchar (JNICALL *GetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jshort (JNICALL *GetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jint (JNICALL *GetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jlong (JNICALL *GetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jfloat (JNICALL *GetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + jdouble (JNICALL *GetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID); + + void (JNICALL *SetObjectField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); + void (JNICALL *SetBooleanField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); + void (JNICALL *SetByteField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); + void (JNICALL *SetCharField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); + void (JNICALL *SetShortField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); + void (JNICALL *SetIntField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jint val); + void (JNICALL *SetLongField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); + void (JNICALL *SetFloatField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); + void (JNICALL *SetDoubleField) + (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (JNICALL *GetStaticMethodID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + + jobject (JNICALL *CallStaticObjectMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jobject (JNICALL *CallStaticObjectMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jobject (JNICALL *CallStaticObjectMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jboolean (JNICALL *CallStaticBooleanMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jboolean (JNICALL *CallStaticBooleanMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jboolean (JNICALL *CallStaticBooleanMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jbyte (JNICALL *CallStaticByteMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jbyte (JNICALL *CallStaticByteMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jbyte (JNICALL *CallStaticByteMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jchar (JNICALL *CallStaticCharMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jchar (JNICALL *CallStaticCharMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jchar (JNICALL *CallStaticCharMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jshort (JNICALL *CallStaticShortMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jshort (JNICALL *CallStaticShortMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jshort (JNICALL *CallStaticShortMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jint (JNICALL *CallStaticIntMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jint (JNICALL *CallStaticIntMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jint (JNICALL *CallStaticIntMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jlong (JNICALL *CallStaticLongMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jlong (JNICALL *CallStaticLongMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jlong (JNICALL *CallStaticLongMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jfloat (JNICALL *CallStaticFloatMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jfloat (JNICALL *CallStaticFloatMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jfloat (JNICALL *CallStaticFloatMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + jdouble (JNICALL *CallStaticDoubleMethod) + (JNIEnv *env, jclass clazz, jmethodID methodID, ...); + jdouble (JNICALL *CallStaticDoubleMethodV) + (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); + jdouble (JNICALL *CallStaticDoubleMethodA) + (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); + + void (JNICALL *CallStaticVoidMethod) + (JNIEnv *env, jclass cls, jmethodID methodID, ...); + void (JNICALL *CallStaticVoidMethodV) + (JNIEnv *env, jclass cls, jmethodID methodID, va_list args); + void (JNICALL *CallStaticVoidMethodA) + (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); + + jfieldID (JNICALL *GetStaticFieldID) + (JNIEnv *env, jclass clazz, const char *name, const char *sig); + jobject (JNICALL *GetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jboolean (JNICALL *GetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jbyte (JNICALL *GetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jchar (JNICALL *GetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jshort (JNICALL *GetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jint (JNICALL *GetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jlong (JNICALL *GetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jfloat (JNICALL *GetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + jdouble (JNICALL *GetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID); + + void (JNICALL *SetStaticObjectField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); + void (JNICALL *SetStaticBooleanField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); + void (JNICALL *SetStaticByteField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); + void (JNICALL *SetStaticCharField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); + void (JNICALL *SetStaticShortField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); + void (JNICALL *SetStaticIntField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); + void (JNICALL *SetStaticLongField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); + void (JNICALL *SetStaticFloatField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); + void (JNICALL *SetStaticDoubleField) + (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (JNICALL *NewString) + (JNIEnv *env, const jchar *unicode, jsize len); + jsize (JNICALL *GetStringLength) + (JNIEnv *env, jstring str); + const jchar *(JNICALL *GetStringChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringChars) + (JNIEnv *env, jstring str, const jchar *chars); + + jstring (JNICALL *NewStringUTF) + (JNIEnv *env, const char *utf); + jsize (JNICALL *GetStringUTFLength) + (JNIEnv *env, jstring str); + const char* (JNICALL *GetStringUTFChars) + (JNIEnv *env, jstring str, jboolean *isCopy); + void (JNICALL *ReleaseStringUTFChars) + (JNIEnv *env, jstring str, const char* chars); + + + jsize (JNICALL *GetArrayLength) + (JNIEnv *env, jarray array); + + jobjectArray (JNICALL *NewObjectArray) + (JNIEnv *env, jsize len, jclass clazz, jobject init); + jobject (JNICALL *GetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index); + void (JNICALL *SetObjectArrayElement) + (JNIEnv *env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (JNICALL *NewBooleanArray) + (JNIEnv *env, jsize len); + jbyteArray (JNICALL *NewByteArray) + (JNIEnv *env, jsize len); + jcharArray (JNICALL *NewCharArray) + (JNIEnv *env, jsize len); + jshortArray (JNICALL *NewShortArray) + (JNIEnv *env, jsize len); + jintArray (JNICALL *NewIntArray) + (JNIEnv *env, jsize len); + jlongArray (JNICALL *NewLongArray) + (JNIEnv *env, jsize len); + jfloatArray (JNICALL *NewFloatArray) + (JNIEnv *env, jsize len); + jdoubleArray (JNICALL *NewDoubleArray) + (JNIEnv *env, jsize len); + + jboolean * (JNICALL *GetBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *isCopy); + jbyte * (JNICALL *GetByteArrayElements) + (JNIEnv *env, jbyteArray array, jboolean *isCopy); + jchar * (JNICALL *GetCharArrayElements) + (JNIEnv *env, jcharArray array, jboolean *isCopy); + jshort * (JNICALL *GetShortArrayElements) + (JNIEnv *env, jshortArray array, jboolean *isCopy); + jint * (JNICALL *GetIntArrayElements) + (JNIEnv *env, jintArray array, jboolean *isCopy); + jlong * (JNICALL *GetLongArrayElements) + (JNIEnv *env, jlongArray array, jboolean *isCopy); + jfloat * (JNICALL *GetFloatArrayElements) + (JNIEnv *env, jfloatArray array, jboolean *isCopy); + jdouble * (JNICALL *GetDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jboolean *isCopy); + + void (JNICALL *ReleaseBooleanArrayElements) + (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); + void (JNICALL *ReleaseByteArrayElements) + (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); + void (JNICALL *ReleaseCharArrayElements) + (JNIEnv *env, jcharArray array, jchar *elems, jint mode); + void (JNICALL *ReleaseShortArrayElements) + (JNIEnv *env, jshortArray array, jshort *elems, jint mode); + void (JNICALL *ReleaseIntArrayElements) + (JNIEnv *env, jintArray array, jint *elems, jint mode); + void (JNICALL *ReleaseLongArrayElements) + (JNIEnv *env, jlongArray array, jlong *elems, jint mode); + void (JNICALL *ReleaseFloatArrayElements) + (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); + void (JNICALL *ReleaseDoubleArrayElements) + (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); + + void (JNICALL *GetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); + void (JNICALL *GetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); + void (JNICALL *GetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); + void (JNICALL *GetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); + void (JNICALL *GetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); + void (JNICALL *GetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); + void (JNICALL *GetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); + void (JNICALL *GetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); + + void (JNICALL *SetBooleanArrayRegion) + (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); + void (JNICALL *SetByteArrayRegion) + (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); + void (JNICALL *SetCharArrayRegion) + (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); + void (JNICALL *SetShortArrayRegion) + (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); + void (JNICALL *SetIntArrayRegion) + (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); + void (JNICALL *SetLongArrayRegion) + (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); + void (JNICALL *SetFloatArrayRegion) + (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); + void (JNICALL *SetDoubleArrayRegion) + (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); + + jint (JNICALL *RegisterNatives) + (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, + jint nMethods); + jint (JNICALL *UnregisterNatives) + (JNIEnv *env, jclass clazz); + + jint (JNICALL *MonitorEnter) + (JNIEnv *env, jobject obj); + jint (JNICALL *MonitorExit) + (JNIEnv *env, jobject obj); + + jint (JNICALL *GetJavaVM) + (JNIEnv *env, JavaVM **vm); + + void (JNICALL *GetStringRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); + void (JNICALL *GetStringUTFRegion) + (JNIEnv *env, jstring str, jsize start, jsize len, char *buf); + + void * (JNICALL *GetPrimitiveArrayCritical) + (JNIEnv *env, jarray array, jboolean *isCopy); + void (JNICALL *ReleasePrimitiveArrayCritical) + (JNIEnv *env, jarray array, void *carray, jint mode); + + const jchar * (JNICALL *GetStringCritical) + (JNIEnv *env, jstring string, jboolean *isCopy); + void (JNICALL *ReleaseStringCritical) + (JNIEnv *env, jstring string, const jchar *cstring); + + jweak (JNICALL *NewWeakGlobalRef) + (JNIEnv *env, jobject obj); + void (JNICALL *DeleteWeakGlobalRef) + (JNIEnv *env, jweak ref); + + jboolean (JNICALL *ExceptionCheck) + (JNIEnv *env); + + jobject (JNICALL *NewDirectByteBuffer) + (JNIEnv* env, void* address, jlong capacity); + void* (JNICALL *GetDirectBufferAddress) + (JNIEnv* env, jobject buf); + jlong (JNICALL *GetDirectBufferCapacity) + (JNIEnv* env, jobject buf); + + /* New JNI 1.6 Features */ + + jobjectRefType (JNICALL *GetObjectRefType) + (JNIEnv* env, jobject obj); +}; + +/* + * We use inlined functions for C++ so that programmers can write: + * + * env->FindClass("java/lang/String") + * + * in C++ rather than: + * + * (*env)->FindClass(env, "java/lang/String") + * + * in C. + */ + +struct JNIEnv_ { + const struct JNINativeInterface_ *functions; +#ifdef __cplusplus + + jint GetVersion() { + return functions->GetVersion(this); + } + jclass DefineClass(const char *name, jobject loader, const jbyte *buf, + jsize len) { + return functions->DefineClass(this, name, loader, buf, len); + } + jclass FindClass(const char *name) { + return functions->FindClass(this, name); + } + jmethodID FromReflectedMethod(jobject method) { + return functions->FromReflectedMethod(this,method); + } + jfieldID FromReflectedField(jobject field) { + return functions->FromReflectedField(this,field); + } + + jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) { + return functions->ToReflectedMethod(this, cls, methodID, isStatic); + } + + jclass GetSuperclass(jclass sub) { + return functions->GetSuperclass(this, sub); + } + jboolean IsAssignableFrom(jclass sub, jclass sup) { + return functions->IsAssignableFrom(this, sub, sup); + } + + jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) { + return functions->ToReflectedField(this,cls,fieldID,isStatic); + } + + jint Throw(jthrowable obj) { + return functions->Throw(this, obj); + } + jint ThrowNew(jclass clazz, const char *msg) { + return functions->ThrowNew(this, clazz, msg); + } + jthrowable ExceptionOccurred() { + return functions->ExceptionOccurred(this); + } + void ExceptionDescribe() { + functions->ExceptionDescribe(this); + } + void ExceptionClear() { + functions->ExceptionClear(this); + } + void FatalError(const char *msg) { + functions->FatalError(this, msg); + } + + jint PushLocalFrame(jint capacity) { + return functions->PushLocalFrame(this,capacity); + } + jobject PopLocalFrame(jobject result) { + return functions->PopLocalFrame(this,result); + } + + jobject NewGlobalRef(jobject lobj) { + return functions->NewGlobalRef(this,lobj); + } + void DeleteGlobalRef(jobject gref) { + functions->DeleteGlobalRef(this,gref); + } + void DeleteLocalRef(jobject obj) { + functions->DeleteLocalRef(this, obj); + } + + jboolean IsSameObject(jobject obj1, jobject obj2) { + return functions->IsSameObject(this,obj1,obj2); + } + + jobject NewLocalRef(jobject ref) { + return functions->NewLocalRef(this,ref); + } + jint EnsureLocalCapacity(jint capacity) { + return functions->EnsureLocalCapacity(this,capacity); + } + + jobject AllocObject(jclass clazz) { + return functions->AllocObject(this,clazz); + } + jobject NewObject(jclass clazz, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args, methodID); + result = functions->NewObjectV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject NewObjectV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->NewObjectV(this,clazz,methodID,args); + } + jobject NewObjectA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->NewObjectA(this,clazz,methodID,args); + } + + jclass GetObjectClass(jobject obj) { + return functions->GetObjectClass(this,obj); + } + jboolean IsInstanceOf(jobject obj, jclass clazz) { + return functions->IsInstanceOf(this,obj,clazz); + } + + jmethodID GetMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetMethodID(this,clazz,name,sig); + } + + jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallObjectMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jobject CallObjectMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallObjectMethodV(this,obj,methodID,args); + } + jobject CallObjectMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallObjectMethodA(this,obj,methodID,args); + } + + jboolean CallBooleanMethod(jobject obj, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallBooleanMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jboolean CallBooleanMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallBooleanMethodV(this,obj,methodID,args); + } + jboolean CallBooleanMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallBooleanMethodA(this,obj,methodID, args); + } + + jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallByteMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jbyte CallByteMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallByteMethodV(this,obj,methodID,args); + } + jbyte CallByteMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallByteMethodA(this,obj,methodID,args); + } + + jchar CallCharMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallCharMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jchar CallCharMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallCharMethodV(this,obj,methodID,args); + } + jchar CallCharMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallCharMethodA(this,obj,methodID,args); + } + + jshort CallShortMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallShortMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jshort CallShortMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallShortMethodV(this,obj,methodID,args); + } + jshort CallShortMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallShortMethodA(this,obj,methodID,args); + } + + jint CallIntMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallIntMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jint CallIntMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallIntMethodV(this,obj,methodID,args); + } + jint CallIntMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallIntMethodA(this,obj,methodID,args); + } + + jlong CallLongMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallLongMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jlong CallLongMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallLongMethodV(this,obj,methodID,args); + } + jlong CallLongMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallLongMethodA(this,obj,methodID,args); + } + + jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallFloatMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jfloat CallFloatMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallFloatMethodV(this,obj,methodID,args); + } + jfloat CallFloatMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallFloatMethodA(this,obj,methodID,args); + } + + jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallDoubleMethodV(this,obj,methodID,args); + va_end(args); + return result; + } + jdouble CallDoubleMethodV(jobject obj, jmethodID methodID, + va_list args) { + return functions->CallDoubleMethodV(this,obj,methodID,args); + } + jdouble CallDoubleMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + return functions->CallDoubleMethodA(this,obj,methodID,args); + } + + void CallVoidMethod(jobject obj, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallVoidMethodV(this,obj,methodID,args); + va_end(args); + } + void CallVoidMethodV(jobject obj, jmethodID methodID, + va_list args) { + functions->CallVoidMethodV(this,obj,methodID,args); + } + void CallVoidMethodA(jobject obj, jmethodID methodID, + const jvalue * args) { + functions->CallVoidMethodA(this,obj,methodID,args); + } + + jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualObjectMethodV(this,obj,clazz, + methodID,args); + } + jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualObjectMethodA(this,obj,clazz, + methodID,args); + } + + jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualBooleanMethodV(this,obj,clazz, + methodID,args); + } + jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualBooleanMethodA(this,obj,clazz, + methodID, args); + } + + jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualByteMethodV(this,obj,clazz, + methodID,args); + } + jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualByteMethodA(this,obj,clazz, + methodID,args); + } + + jchar CallNonvirtualCharMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualCharMethodV(this,obj,clazz, + methodID,args); + } + jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualCharMethodA(this,obj,clazz, + methodID,args); + } + + jshort CallNonvirtualShortMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualShortMethodV(this,obj,clazz, + methodID,args); + } + jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualShortMethodA(this,obj,clazz, + methodID,args); + } + + jint CallNonvirtualIntMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jint CallNonvirtualIntMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualIntMethodV(this,obj,clazz, + methodID,args); + } + jint CallNonvirtualIntMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualIntMethodA(this,obj,clazz, + methodID,args); + } + + jlong CallNonvirtualLongMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallNonvirtualLongMethodV(this,obj,clazz, + methodID,args); + } + jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz, + jmethodID methodID, const jvalue * args) { + return functions->CallNonvirtualLongMethodA(this,obj,clazz, + methodID,args); + } + + jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualFloatMethodV(this,obj,clazz, + methodID,args); + } + jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualFloatMethodA(this,obj,clazz, + methodID,args); + } + + jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + va_end(args); + return result; + } + jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + return functions->CallNonvirtualDoubleMethodV(this,obj,clazz, + methodID,args); + } + jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + return functions->CallNonvirtualDoubleMethodA(this,obj,clazz, + methodID,args); + } + + void CallNonvirtualVoidMethod(jobject obj, jclass clazz, + jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + va_end(args); + } + void CallNonvirtualVoidMethodV(jobject obj, jclass clazz, + jmethodID methodID, + va_list args) { + functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args); + } + void CallNonvirtualVoidMethodA(jobject obj, jclass clazz, + jmethodID methodID, + const jvalue * args) { + functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args); + } + + jfieldID GetFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetFieldID(this,clazz,name,sig); + } + + jobject GetObjectField(jobject obj, jfieldID fieldID) { + return functions->GetObjectField(this,obj,fieldID); + } + jboolean GetBooleanField(jobject obj, jfieldID fieldID) { + return functions->GetBooleanField(this,obj,fieldID); + } + jbyte GetByteField(jobject obj, jfieldID fieldID) { + return functions->GetByteField(this,obj,fieldID); + } + jchar GetCharField(jobject obj, jfieldID fieldID) { + return functions->GetCharField(this,obj,fieldID); + } + jshort GetShortField(jobject obj, jfieldID fieldID) { + return functions->GetShortField(this,obj,fieldID); + } + jint GetIntField(jobject obj, jfieldID fieldID) { + return functions->GetIntField(this,obj,fieldID); + } + jlong GetLongField(jobject obj, jfieldID fieldID) { + return functions->GetLongField(this,obj,fieldID); + } + jfloat GetFloatField(jobject obj, jfieldID fieldID) { + return functions->GetFloatField(this,obj,fieldID); + } + jdouble GetDoubleField(jobject obj, jfieldID fieldID) { + return functions->GetDoubleField(this,obj,fieldID); + } + + void SetObjectField(jobject obj, jfieldID fieldID, jobject val) { + functions->SetObjectField(this,obj,fieldID,val); + } + void SetBooleanField(jobject obj, jfieldID fieldID, + jboolean val) { + functions->SetBooleanField(this,obj,fieldID,val); + } + void SetByteField(jobject obj, jfieldID fieldID, + jbyte val) { + functions->SetByteField(this,obj,fieldID,val); + } + void SetCharField(jobject obj, jfieldID fieldID, + jchar val) { + functions->SetCharField(this,obj,fieldID,val); + } + void SetShortField(jobject obj, jfieldID fieldID, + jshort val) { + functions->SetShortField(this,obj,fieldID,val); + } + void SetIntField(jobject obj, jfieldID fieldID, + jint val) { + functions->SetIntField(this,obj,fieldID,val); + } + void SetLongField(jobject obj, jfieldID fieldID, + jlong val) { + functions->SetLongField(this,obj,fieldID,val); + } + void SetFloatField(jobject obj, jfieldID fieldID, + jfloat val) { + functions->SetFloatField(this,obj,fieldID,val); + } + void SetDoubleField(jobject obj, jfieldID fieldID, + jdouble val) { + functions->SetDoubleField(this,obj,fieldID,val); + } + + jmethodID GetStaticMethodID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticMethodID(this,clazz,name,sig); + } + + jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID, + ...) { + va_list args; + jobject result; + va_start(args,methodID); + result = functions->CallStaticObjectMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID, + va_list args) { + return functions->CallStaticObjectMethodV(this,clazz,methodID,args); + } + jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID, + const jvalue *args) { + return functions->CallStaticObjectMethodA(this,clazz,methodID,args); + } + + jboolean CallStaticBooleanMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jboolean result; + va_start(args,methodID); + result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jboolean CallStaticBooleanMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticBooleanMethodV(this,clazz,methodID,args); + } + jboolean CallStaticBooleanMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticBooleanMethodA(this,clazz,methodID,args); + } + + jbyte CallStaticByteMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jbyte result; + va_start(args,methodID); + result = functions->CallStaticByteMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jbyte CallStaticByteMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticByteMethodV(this,clazz,methodID,args); + } + jbyte CallStaticByteMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticByteMethodA(this,clazz,methodID,args); + } + + jchar CallStaticCharMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jchar result; + va_start(args,methodID); + result = functions->CallStaticCharMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jchar CallStaticCharMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticCharMethodV(this,clazz,methodID,args); + } + jchar CallStaticCharMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticCharMethodA(this,clazz,methodID,args); + } + + jshort CallStaticShortMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jshort result; + va_start(args,methodID); + result = functions->CallStaticShortMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jshort CallStaticShortMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticShortMethodV(this,clazz,methodID,args); + } + jshort CallStaticShortMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticShortMethodA(this,clazz,methodID,args); + } + + jint CallStaticIntMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jint result; + va_start(args,methodID); + result = functions->CallStaticIntMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jint CallStaticIntMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticIntMethodV(this,clazz,methodID,args); + } + jint CallStaticIntMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticIntMethodA(this,clazz,methodID,args); + } + + jlong CallStaticLongMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jlong result; + va_start(args,methodID); + result = functions->CallStaticLongMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jlong CallStaticLongMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticLongMethodV(this,clazz,methodID,args); + } + jlong CallStaticLongMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticLongMethodA(this,clazz,methodID,args); + } + + jfloat CallStaticFloatMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jfloat result; + va_start(args,methodID); + result = functions->CallStaticFloatMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jfloat CallStaticFloatMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticFloatMethodV(this,clazz,methodID,args); + } + jfloat CallStaticFloatMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticFloatMethodA(this,clazz,methodID,args); + } + + jdouble CallStaticDoubleMethod(jclass clazz, + jmethodID methodID, ...) { + va_list args; + jdouble result; + va_start(args,methodID); + result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + va_end(args); + return result; + } + jdouble CallStaticDoubleMethodV(jclass clazz, + jmethodID methodID, va_list args) { + return functions->CallStaticDoubleMethodV(this,clazz,methodID,args); + } + jdouble CallStaticDoubleMethodA(jclass clazz, + jmethodID methodID, const jvalue *args) { + return functions->CallStaticDoubleMethodA(this,clazz,methodID,args); + } + + void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) { + va_list args; + va_start(args,methodID); + functions->CallStaticVoidMethodV(this,cls,methodID,args); + va_end(args); + } + void CallStaticVoidMethodV(jclass cls, jmethodID methodID, + va_list args) { + functions->CallStaticVoidMethodV(this,cls,methodID,args); + } + void CallStaticVoidMethodA(jclass cls, jmethodID methodID, + const jvalue * args) { + functions->CallStaticVoidMethodA(this,cls,methodID,args); + } + + jfieldID GetStaticFieldID(jclass clazz, const char *name, + const char *sig) { + return functions->GetStaticFieldID(this,clazz,name,sig); + } + jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticObjectField(this,clazz,fieldID); + } + jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticBooleanField(this,clazz,fieldID); + } + jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticByteField(this,clazz,fieldID); + } + jchar GetStaticCharField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticCharField(this,clazz,fieldID); + } + jshort GetStaticShortField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticShortField(this,clazz,fieldID); + } + jint GetStaticIntField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticIntField(this,clazz,fieldID); + } + jlong GetStaticLongField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticLongField(this,clazz,fieldID); + } + jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticFloatField(this,clazz,fieldID); + } + jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) { + return functions->GetStaticDoubleField(this,clazz,fieldID); + } + + void SetStaticObjectField(jclass clazz, jfieldID fieldID, + jobject value) { + functions->SetStaticObjectField(this,clazz,fieldID,value); + } + void SetStaticBooleanField(jclass clazz, jfieldID fieldID, + jboolean value) { + functions->SetStaticBooleanField(this,clazz,fieldID,value); + } + void SetStaticByteField(jclass clazz, jfieldID fieldID, + jbyte value) { + functions->SetStaticByteField(this,clazz,fieldID,value); + } + void SetStaticCharField(jclass clazz, jfieldID fieldID, + jchar value) { + functions->SetStaticCharField(this,clazz,fieldID,value); + } + void SetStaticShortField(jclass clazz, jfieldID fieldID, + jshort value) { + functions->SetStaticShortField(this,clazz,fieldID,value); + } + void SetStaticIntField(jclass clazz, jfieldID fieldID, + jint value) { + functions->SetStaticIntField(this,clazz,fieldID,value); + } + void SetStaticLongField(jclass clazz, jfieldID fieldID, + jlong value) { + functions->SetStaticLongField(this,clazz,fieldID,value); + } + void SetStaticFloatField(jclass clazz, jfieldID fieldID, + jfloat value) { + functions->SetStaticFloatField(this,clazz,fieldID,value); + } + void SetStaticDoubleField(jclass clazz, jfieldID fieldID, + jdouble value) { + functions->SetStaticDoubleField(this,clazz,fieldID,value); + } + + jstring NewString(const jchar *unicode, jsize len) { + return functions->NewString(this,unicode,len); + } + jsize GetStringLength(jstring str) { + return functions->GetStringLength(this,str); + } + const jchar *GetStringChars(jstring str, jboolean *isCopy) { + return functions->GetStringChars(this,str,isCopy); + } + void ReleaseStringChars(jstring str, const jchar *chars) { + functions->ReleaseStringChars(this,str,chars); + } + + jstring NewStringUTF(const char *utf) { + return functions->NewStringUTF(this,utf); + } + jsize GetStringUTFLength(jstring str) { + return functions->GetStringUTFLength(this,str); + } + const char* GetStringUTFChars(jstring str, jboolean *isCopy) { + return functions->GetStringUTFChars(this,str,isCopy); + } + void ReleaseStringUTFChars(jstring str, const char* chars) { + functions->ReleaseStringUTFChars(this,str,chars); + } + + jsize GetArrayLength(jarray array) { + return functions->GetArrayLength(this,array); + } + + jobjectArray NewObjectArray(jsize len, jclass clazz, + jobject init) { + return functions->NewObjectArray(this,len,clazz,init); + } + jobject GetObjectArrayElement(jobjectArray array, jsize index) { + return functions->GetObjectArrayElement(this,array,index); + } + void SetObjectArrayElement(jobjectArray array, jsize index, + jobject val) { + functions->SetObjectArrayElement(this,array,index,val); + } + + jbooleanArray NewBooleanArray(jsize len) { + return functions->NewBooleanArray(this,len); + } + jbyteArray NewByteArray(jsize len) { + return functions->NewByteArray(this,len); + } + jcharArray NewCharArray(jsize len) { + return functions->NewCharArray(this,len); + } + jshortArray NewShortArray(jsize len) { + return functions->NewShortArray(this,len); + } + jintArray NewIntArray(jsize len) { + return functions->NewIntArray(this,len); + } + jlongArray NewLongArray(jsize len) { + return functions->NewLongArray(this,len); + } + jfloatArray NewFloatArray(jsize len) { + return functions->NewFloatArray(this,len); + } + jdoubleArray NewDoubleArray(jsize len) { + return functions->NewDoubleArray(this,len); + } + + jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) { + return functions->GetBooleanArrayElements(this,array,isCopy); + } + jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) { + return functions->GetByteArrayElements(this,array,isCopy); + } + jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) { + return functions->GetCharArrayElements(this,array,isCopy); + } + jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) { + return functions->GetShortArrayElements(this,array,isCopy); + } + jint * GetIntArrayElements(jintArray array, jboolean *isCopy) { + return functions->GetIntArrayElements(this,array,isCopy); + } + jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) { + return functions->GetLongArrayElements(this,array,isCopy); + } + jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) { + return functions->GetFloatArrayElements(this,array,isCopy); + } + jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) { + return functions->GetDoubleArrayElements(this,array,isCopy); + } + + void ReleaseBooleanArrayElements(jbooleanArray array, + jboolean *elems, + jint mode) { + functions->ReleaseBooleanArrayElements(this,array,elems,mode); + } + void ReleaseByteArrayElements(jbyteArray array, + jbyte *elems, + jint mode) { + functions->ReleaseByteArrayElements(this,array,elems,mode); + } + void ReleaseCharArrayElements(jcharArray array, + jchar *elems, + jint mode) { + functions->ReleaseCharArrayElements(this,array,elems,mode); + } + void ReleaseShortArrayElements(jshortArray array, + jshort *elems, + jint mode) { + functions->ReleaseShortArrayElements(this,array,elems,mode); + } + void ReleaseIntArrayElements(jintArray array, + jint *elems, + jint mode) { + functions->ReleaseIntArrayElements(this,array,elems,mode); + } + void ReleaseLongArrayElements(jlongArray array, + jlong *elems, + jint mode) { + functions->ReleaseLongArrayElements(this,array,elems,mode); + } + void ReleaseFloatArrayElements(jfloatArray array, + jfloat *elems, + jint mode) { + functions->ReleaseFloatArrayElements(this,array,elems,mode); + } + void ReleaseDoubleArrayElements(jdoubleArray array, + jdouble *elems, + jint mode) { + functions->ReleaseDoubleArrayElements(this,array,elems,mode); + } + + void GetBooleanArrayRegion(jbooleanArray array, + jsize start, jsize len, jboolean *buf) { + functions->GetBooleanArrayRegion(this,array,start,len,buf); + } + void GetByteArrayRegion(jbyteArray array, + jsize start, jsize len, jbyte *buf) { + functions->GetByteArrayRegion(this,array,start,len,buf); + } + void GetCharArrayRegion(jcharArray array, + jsize start, jsize len, jchar *buf) { + functions->GetCharArrayRegion(this,array,start,len,buf); + } + void GetShortArrayRegion(jshortArray array, + jsize start, jsize len, jshort *buf) { + functions->GetShortArrayRegion(this,array,start,len,buf); + } + void GetIntArrayRegion(jintArray array, + jsize start, jsize len, jint *buf) { + functions->GetIntArrayRegion(this,array,start,len,buf); + } + void GetLongArrayRegion(jlongArray array, + jsize start, jsize len, jlong *buf) { + functions->GetLongArrayRegion(this,array,start,len,buf); + } + void GetFloatArrayRegion(jfloatArray array, + jsize start, jsize len, jfloat *buf) { + functions->GetFloatArrayRegion(this,array,start,len,buf); + } + void GetDoubleArrayRegion(jdoubleArray array, + jsize start, jsize len, jdouble *buf) { + functions->GetDoubleArrayRegion(this,array,start,len,buf); + } + + void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len, + const jboolean *buf) { + functions->SetBooleanArrayRegion(this,array,start,len,buf); + } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, + const jbyte *buf) { + functions->SetByteArrayRegion(this,array,start,len,buf); + } + void SetCharArrayRegion(jcharArray array, jsize start, jsize len, + const jchar *buf) { + functions->SetCharArrayRegion(this,array,start,len,buf); + } + void SetShortArrayRegion(jshortArray array, jsize start, jsize len, + const jshort *buf) { + functions->SetShortArrayRegion(this,array,start,len,buf); + } + void SetIntArrayRegion(jintArray array, jsize start, jsize len, + const jint *buf) { + functions->SetIntArrayRegion(this,array,start,len,buf); + } + void SetLongArrayRegion(jlongArray array, jsize start, jsize len, + const jlong *buf) { + functions->SetLongArrayRegion(this,array,start,len,buf); + } + void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, + const jfloat *buf) { + functions->SetFloatArrayRegion(this,array,start,len,buf); + } + void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, + const jdouble *buf) { + functions->SetDoubleArrayRegion(this,array,start,len,buf); + } + + jint RegisterNatives(jclass clazz, const JNINativeMethod *methods, + jint nMethods) { + return functions->RegisterNatives(this,clazz,methods,nMethods); + } + jint UnregisterNatives(jclass clazz) { + return functions->UnregisterNatives(this,clazz); + } + + jint MonitorEnter(jobject obj) { + return functions->MonitorEnter(this,obj); + } + jint MonitorExit(jobject obj) { + return functions->MonitorExit(this,obj); + } + + jint GetJavaVM(JavaVM **vm) { + return functions->GetJavaVM(this,vm); + } + + void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) { + functions->GetStringRegion(this,str,start,len,buf); + } + void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) { + functions->GetStringUTFRegion(this,str,start,len,buf); + } + + void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) { + return functions->GetPrimitiveArrayCritical(this,array,isCopy); + } + void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) { + functions->ReleasePrimitiveArrayCritical(this,array,carray,mode); + } + + const jchar * GetStringCritical(jstring string, jboolean *isCopy) { + return functions->GetStringCritical(this,string,isCopy); + } + void ReleaseStringCritical(jstring string, const jchar *cstring) { + functions->ReleaseStringCritical(this,string,cstring); + } + + jweak NewWeakGlobalRef(jobject obj) { + return functions->NewWeakGlobalRef(this,obj); + } + void DeleteWeakGlobalRef(jweak ref) { + functions->DeleteWeakGlobalRef(this,ref); + } + + jboolean ExceptionCheck() { + return functions->ExceptionCheck(this); + } + + jobject NewDirectByteBuffer(void* address, jlong capacity) { + return functions->NewDirectByteBuffer(this, address, capacity); + } + void* GetDirectBufferAddress(jobject buf) { + return functions->GetDirectBufferAddress(this, buf); + } + jlong GetDirectBufferCapacity(jobject buf) { + return functions->GetDirectBufferCapacity(this, buf); + } + jobjectRefType GetObjectRefType(jobject obj) { + return functions->GetObjectRefType(this, obj); + } + +#endif /* __cplusplus */ +}; + +typedef struct JavaVMOption { + char *optionString; + void *extraInfo; +} JavaVMOption; + +typedef struct JavaVMInitArgs { + jint version; + + jint nOptions; + JavaVMOption *options; + jboolean ignoreUnrecognized; +} JavaVMInitArgs; + +typedef struct JavaVMAttachArgs { + jint version; + + char *name; + jobject group; +} JavaVMAttachArgs; + +/* These will be VM-specific. */ + +#define JDK1_2 +#define JDK1_4 + +/* End VM-specific. */ + +struct JNIInvokeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + + jint (JNICALL *DestroyJavaVM)(JavaVM *vm); + + jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args); + + jint (JNICALL *DetachCurrentThread)(JavaVM *vm); + + jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version); + + jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args); +}; + +struct JavaVM_ { + const struct JNIInvokeInterface_ *functions; +#ifdef __cplusplus + + jint DestroyJavaVM() { + return functions->DestroyJavaVM(this); + } + jint AttachCurrentThread(void **penv, void *args) { + return functions->AttachCurrentThread(this, penv, args); + } + jint DetachCurrentThread() { + return functions->DetachCurrentThread(this); + } + + jint GetEnv(void **penv, jint version) { + return functions->GetEnv(this, penv, version); + } + jint AttachCurrentThreadAsDaemon(void **penv, void *args) { + return functions->AttachCurrentThreadAsDaemon(this, penv, args); + } +#endif +}; + +#ifdef _JNI_IMPLEMENTATION_ +#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT +#else +#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT +#endif +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetDefaultJavaVMInitArgs(void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args); + +_JNI_IMPORT_OR_EXPORT_ jint JNICALL +JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); + +/* Defined by native libraries. */ +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved); + +JNIEXPORT void JNICALL +JNI_OnUnload(JavaVM *vm, void *reserved); + +#define JNI_VERSION_1_1 0x00010001 +#define JNI_VERSION_1_2 0x00010002 +#define JNI_VERSION_1_4 0x00010004 +#define JNI_VERSION_1_6 0x00010006 +#define JNI_VERSION_1_8 0x00010008 + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_JAVASOFT_JNI_H_ */ diff --git a/runtime/include/jvmti.h b/runtime/include/jvmti.h new file mode 100644 index 0000000..ee708cb --- /dev/null +++ b/runtime/include/jvmti.h @@ -0,0 +1,2534 @@ +/* + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */ + + + /* Include file for the Java(tm) Virtual Machine Tool Interface */ + +#ifndef _JAVA_JVMTI_H_ +#define _JAVA_JVMTI_H_ + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + JVMTI_VERSION_1 = 0x30010000, + JVMTI_VERSION_1_0 = 0x30010000, + JVMTI_VERSION_1_1 = 0x30010100, + JVMTI_VERSION_1_2 = 0x30010200, + + JVMTI_VERSION = 0x30000000 + (1 * 0x10000) + (2 * 0x100) + 1 /* version: 1.2.1 */ +}; + +JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *vm, char *options, void *reserved); + +JNIEXPORT jint JNICALL +Agent_OnAttach(JavaVM* vm, char* options, void* reserved); + +JNIEXPORT void JNICALL +Agent_OnUnload(JavaVM *vm); + + /* Forward declaration of the environment */ + +struct _jvmtiEnv; + +struct jvmtiInterface_1_; + +#ifdef __cplusplus +typedef _jvmtiEnv jvmtiEnv; +#else +typedef const struct jvmtiInterface_1_ *jvmtiEnv; +#endif /* __cplusplus */ + +/* Derived Base Types */ + +typedef jobject jthread; +typedef jobject jthreadGroup; +typedef jlong jlocation; +struct _jrawMonitorID; +typedef struct _jrawMonitorID *jrawMonitorID; +typedef struct JNINativeInterface_ jniNativeInterface; + + /* Constants */ + + + /* Thread State Flags */ + +enum { + JVMTI_THREAD_STATE_ALIVE = 0x0001, + JVMTI_THREAD_STATE_TERMINATED = 0x0002, + JVMTI_THREAD_STATE_RUNNABLE = 0x0004, + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400, + JVMTI_THREAD_STATE_WAITING = 0x0080, + JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010, + JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020, + JVMTI_THREAD_STATE_SLEEPING = 0x0040, + JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100, + JVMTI_THREAD_STATE_PARKED = 0x0200, + JVMTI_THREAD_STATE_SUSPENDED = 0x100000, + JVMTI_THREAD_STATE_INTERRUPTED = 0x200000, + JVMTI_THREAD_STATE_IN_NATIVE = 0x400000, + JVMTI_THREAD_STATE_VENDOR_1 = 0x10000000, + JVMTI_THREAD_STATE_VENDOR_2 = 0x20000000, + JVMTI_THREAD_STATE_VENDOR_3 = 0x40000000 +}; + + /* java.lang.Thread.State Conversion Masks */ + +enum { + JVMTI_JAVA_LANG_THREAD_STATE_MASK = JVMTI_THREAD_STATE_TERMINATED | JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT, + JVMTI_JAVA_LANG_THREAD_STATE_NEW = 0, + JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED = JVMTI_THREAD_STATE_TERMINATED, + JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE, + JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER, + JVMTI_JAVA_LANG_THREAD_STATE_WAITING = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY, + JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +}; + + /* Thread Priority Constants */ + +enum { + JVMTI_THREAD_MIN_PRIORITY = 1, + JVMTI_THREAD_NORM_PRIORITY = 5, + JVMTI_THREAD_MAX_PRIORITY = 10 +}; + + /* Heap Filter Flags */ + +enum { + JVMTI_HEAP_FILTER_TAGGED = 0x4, + JVMTI_HEAP_FILTER_UNTAGGED = 0x8, + JVMTI_HEAP_FILTER_CLASS_TAGGED = 0x10, + JVMTI_HEAP_FILTER_CLASS_UNTAGGED = 0x20 +}; + + /* Heap Visit Control Flags */ + +enum { + JVMTI_VISIT_OBJECTS = 0x100, + JVMTI_VISIT_ABORT = 0x8000 +}; + + /* Heap Reference Enumeration */ + +typedef enum { + JVMTI_HEAP_REFERENCE_CLASS = 1, + JVMTI_HEAP_REFERENCE_FIELD = 2, + JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT = 3, + JVMTI_HEAP_REFERENCE_CLASS_LOADER = 4, + JVMTI_HEAP_REFERENCE_SIGNERS = 5, + JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN = 6, + JVMTI_HEAP_REFERENCE_INTERFACE = 7, + JVMTI_HEAP_REFERENCE_STATIC_FIELD = 8, + JVMTI_HEAP_REFERENCE_CONSTANT_POOL = 9, + JVMTI_HEAP_REFERENCE_SUPERCLASS = 10, + JVMTI_HEAP_REFERENCE_JNI_GLOBAL = 21, + JVMTI_HEAP_REFERENCE_SYSTEM_CLASS = 22, + JVMTI_HEAP_REFERENCE_MONITOR = 23, + JVMTI_HEAP_REFERENCE_STACK_LOCAL = 24, + JVMTI_HEAP_REFERENCE_JNI_LOCAL = 25, + JVMTI_HEAP_REFERENCE_THREAD = 26, + JVMTI_HEAP_REFERENCE_OTHER = 27 +} jvmtiHeapReferenceKind; + + /* Primitive Type Enumeration */ + +typedef enum { + JVMTI_PRIMITIVE_TYPE_BOOLEAN = 90, + JVMTI_PRIMITIVE_TYPE_BYTE = 66, + JVMTI_PRIMITIVE_TYPE_CHAR = 67, + JVMTI_PRIMITIVE_TYPE_SHORT = 83, + JVMTI_PRIMITIVE_TYPE_INT = 73, + JVMTI_PRIMITIVE_TYPE_LONG = 74, + JVMTI_PRIMITIVE_TYPE_FLOAT = 70, + JVMTI_PRIMITIVE_TYPE_DOUBLE = 68 +} jvmtiPrimitiveType; + + /* Heap Object Filter Enumeration */ + +typedef enum { + JVMTI_HEAP_OBJECT_TAGGED = 1, + JVMTI_HEAP_OBJECT_UNTAGGED = 2, + JVMTI_HEAP_OBJECT_EITHER = 3 +} jvmtiHeapObjectFilter; + + /* Heap Root Kind Enumeration */ + +typedef enum { + JVMTI_HEAP_ROOT_JNI_GLOBAL = 1, + JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2, + JVMTI_HEAP_ROOT_MONITOR = 3, + JVMTI_HEAP_ROOT_STACK_LOCAL = 4, + JVMTI_HEAP_ROOT_JNI_LOCAL = 5, + JVMTI_HEAP_ROOT_THREAD = 6, + JVMTI_HEAP_ROOT_OTHER = 7 +} jvmtiHeapRootKind; + + /* Object Reference Enumeration */ + +typedef enum { + JVMTI_REFERENCE_CLASS = 1, + JVMTI_REFERENCE_FIELD = 2, + JVMTI_REFERENCE_ARRAY_ELEMENT = 3, + JVMTI_REFERENCE_CLASS_LOADER = 4, + JVMTI_REFERENCE_SIGNERS = 5, + JVMTI_REFERENCE_PROTECTION_DOMAIN = 6, + JVMTI_REFERENCE_INTERFACE = 7, + JVMTI_REFERENCE_STATIC_FIELD = 8, + JVMTI_REFERENCE_CONSTANT_POOL = 9 +} jvmtiObjectReferenceKind; + + /* Iteration Control Enumeration */ + +typedef enum { + JVMTI_ITERATION_CONTINUE = 1, + JVMTI_ITERATION_IGNORE = 2, + JVMTI_ITERATION_ABORT = 0 +} jvmtiIterationControl; + + /* Class Status Flags */ + +enum { + JVMTI_CLASS_STATUS_VERIFIED = 1, + JVMTI_CLASS_STATUS_PREPARED = 2, + JVMTI_CLASS_STATUS_INITIALIZED = 4, + JVMTI_CLASS_STATUS_ERROR = 8, + JVMTI_CLASS_STATUS_ARRAY = 16, + JVMTI_CLASS_STATUS_PRIMITIVE = 32 +}; + + /* Event Enable/Disable */ + +typedef enum { + JVMTI_ENABLE = 1, + JVMTI_DISABLE = 0 +} jvmtiEventMode; + + /* Extension Function/Event Parameter Types */ + +typedef enum { + JVMTI_TYPE_JBYTE = 101, + JVMTI_TYPE_JCHAR = 102, + JVMTI_TYPE_JSHORT = 103, + JVMTI_TYPE_JINT = 104, + JVMTI_TYPE_JLONG = 105, + JVMTI_TYPE_JFLOAT = 106, + JVMTI_TYPE_JDOUBLE = 107, + JVMTI_TYPE_JBOOLEAN = 108, + JVMTI_TYPE_JOBJECT = 109, + JVMTI_TYPE_JTHREAD = 110, + JVMTI_TYPE_JCLASS = 111, + JVMTI_TYPE_JVALUE = 112, + JVMTI_TYPE_JFIELDID = 113, + JVMTI_TYPE_JMETHODID = 114, + JVMTI_TYPE_CCHAR = 115, + JVMTI_TYPE_CVOID = 116, + JVMTI_TYPE_JNIENV = 117 +} jvmtiParamTypes; + + /* Extension Function/Event Parameter Kinds */ + +typedef enum { + JVMTI_KIND_IN = 91, + JVMTI_KIND_IN_PTR = 92, + JVMTI_KIND_IN_BUF = 93, + JVMTI_KIND_ALLOC_BUF = 94, + JVMTI_KIND_ALLOC_ALLOC_BUF = 95, + JVMTI_KIND_OUT = 96, + JVMTI_KIND_OUT_BUF = 97 +} jvmtiParamKind; + + /* Timer Kinds */ + +typedef enum { + JVMTI_TIMER_USER_CPU = 30, + JVMTI_TIMER_TOTAL_CPU = 31, + JVMTI_TIMER_ELAPSED = 32 +} jvmtiTimerKind; + + /* Phases of execution */ + +typedef enum { + JVMTI_PHASE_ONLOAD = 1, + JVMTI_PHASE_PRIMORDIAL = 2, + JVMTI_PHASE_START = 6, + JVMTI_PHASE_LIVE = 4, + JVMTI_PHASE_DEAD = 8 +} jvmtiPhase; + + /* Version Interface Types */ + +enum { + JVMTI_VERSION_INTERFACE_JNI = 0x00000000, + JVMTI_VERSION_INTERFACE_JVMTI = 0x30000000 +}; + + /* Version Masks */ + +enum { + JVMTI_VERSION_MASK_INTERFACE_TYPE = 0x70000000, + JVMTI_VERSION_MASK_MAJOR = 0x0FFF0000, + JVMTI_VERSION_MASK_MINOR = 0x0000FF00, + JVMTI_VERSION_MASK_MICRO = 0x000000FF +}; + + /* Version Shifts */ + +enum { + JVMTI_VERSION_SHIFT_MAJOR = 16, + JVMTI_VERSION_SHIFT_MINOR = 8, + JVMTI_VERSION_SHIFT_MICRO = 0 +}; + + /* Verbose Flag Enumeration */ + +typedef enum { + JVMTI_VERBOSE_OTHER = 0, + JVMTI_VERBOSE_GC = 1, + JVMTI_VERBOSE_CLASS = 2, + JVMTI_VERBOSE_JNI = 4 +} jvmtiVerboseFlag; + + /* JLocation Format Enumeration */ + +typedef enum { + JVMTI_JLOCATION_JVMBCI = 1, + JVMTI_JLOCATION_MACHINEPC = 2, + JVMTI_JLOCATION_OTHER = 0 +} jvmtiJlocationFormat; + + /* Resource Exhaustion Flags */ + +enum { + JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR = 0x0001, + JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002, + JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004 +}; + + /* Errors */ + +typedef enum { + JVMTI_ERROR_NONE = 0, + JVMTI_ERROR_INVALID_THREAD = 10, + JVMTI_ERROR_INVALID_THREAD_GROUP = 11, + JVMTI_ERROR_INVALID_PRIORITY = 12, + JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13, + JVMTI_ERROR_THREAD_SUSPENDED = 14, + JVMTI_ERROR_THREAD_NOT_ALIVE = 15, + JVMTI_ERROR_INVALID_OBJECT = 20, + JVMTI_ERROR_INVALID_CLASS = 21, + JVMTI_ERROR_CLASS_NOT_PREPARED = 22, + JVMTI_ERROR_INVALID_METHODID = 23, + JVMTI_ERROR_INVALID_LOCATION = 24, + JVMTI_ERROR_INVALID_FIELDID = 25, + JVMTI_ERROR_NO_MORE_FRAMES = 31, + JVMTI_ERROR_OPAQUE_FRAME = 32, + JVMTI_ERROR_TYPE_MISMATCH = 34, + JVMTI_ERROR_INVALID_SLOT = 35, + JVMTI_ERROR_DUPLICATE = 40, + JVMTI_ERROR_NOT_FOUND = 41, + JVMTI_ERROR_INVALID_MONITOR = 50, + JVMTI_ERROR_NOT_MONITOR_OWNER = 51, + JVMTI_ERROR_INTERRUPT = 52, + JVMTI_ERROR_INVALID_CLASS_FORMAT = 60, + JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61, + JVMTI_ERROR_FAILS_VERIFICATION = 62, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64, + JVMTI_ERROR_INVALID_TYPESTATE = 65, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67, + JVMTI_ERROR_UNSUPPORTED_VERSION = 68, + JVMTI_ERROR_NAMES_DONT_MATCH = 69, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70, + JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71, + JVMTI_ERROR_UNMODIFIABLE_CLASS = 79, + JVMTI_ERROR_NOT_AVAILABLE = 98, + JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99, + JVMTI_ERROR_NULL_POINTER = 100, + JVMTI_ERROR_ABSENT_INFORMATION = 101, + JVMTI_ERROR_INVALID_EVENT_TYPE = 102, + JVMTI_ERROR_ILLEGAL_ARGUMENT = 103, + JVMTI_ERROR_NATIVE_METHOD = 104, + JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED = 106, + JVMTI_ERROR_OUT_OF_MEMORY = 110, + JVMTI_ERROR_ACCESS_DENIED = 111, + JVMTI_ERROR_WRONG_PHASE = 112, + JVMTI_ERROR_INTERNAL = 113, + JVMTI_ERROR_UNATTACHED_THREAD = 115, + JVMTI_ERROR_INVALID_ENVIRONMENT = 116, + JVMTI_ERROR_MAX = 116 +} jvmtiError; + + /* Event IDs */ + +typedef enum { + JVMTI_MIN_EVENT_TYPE_VAL = 50, + JVMTI_EVENT_VM_INIT = 50, + JVMTI_EVENT_VM_DEATH = 51, + JVMTI_EVENT_THREAD_START = 52, + JVMTI_EVENT_THREAD_END = 53, + JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54, + JVMTI_EVENT_CLASS_LOAD = 55, + JVMTI_EVENT_CLASS_PREPARE = 56, + JVMTI_EVENT_VM_START = 57, + JVMTI_EVENT_EXCEPTION = 58, + JVMTI_EVENT_EXCEPTION_CATCH = 59, + JVMTI_EVENT_SINGLE_STEP = 60, + JVMTI_EVENT_FRAME_POP = 61, + JVMTI_EVENT_BREAKPOINT = 62, + JVMTI_EVENT_FIELD_ACCESS = 63, + JVMTI_EVENT_FIELD_MODIFICATION = 64, + JVMTI_EVENT_METHOD_ENTRY = 65, + JVMTI_EVENT_METHOD_EXIT = 66, + JVMTI_EVENT_NATIVE_METHOD_BIND = 67, + JVMTI_EVENT_COMPILED_METHOD_LOAD = 68, + JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69, + JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70, + JVMTI_EVENT_DATA_DUMP_REQUEST = 71, + JVMTI_EVENT_MONITOR_WAIT = 73, + JVMTI_EVENT_MONITOR_WAITED = 74, + JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75, + JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76, + JVMTI_EVENT_RESOURCE_EXHAUSTED = 80, + JVMTI_EVENT_GARBAGE_COLLECTION_START = 81, + JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82, + JVMTI_EVENT_OBJECT_FREE = 83, + JVMTI_EVENT_VM_OBJECT_ALLOC = 84, + JVMTI_MAX_EVENT_TYPE_VAL = 84 +} jvmtiEvent; + + + /* Pre-Declarations */ +struct _jvmtiThreadInfo; +typedef struct _jvmtiThreadInfo jvmtiThreadInfo; +struct _jvmtiMonitorStackDepthInfo; +typedef struct _jvmtiMonitorStackDepthInfo jvmtiMonitorStackDepthInfo; +struct _jvmtiThreadGroupInfo; +typedef struct _jvmtiThreadGroupInfo jvmtiThreadGroupInfo; +struct _jvmtiFrameInfo; +typedef struct _jvmtiFrameInfo jvmtiFrameInfo; +struct _jvmtiStackInfo; +typedef struct _jvmtiStackInfo jvmtiStackInfo; +struct _jvmtiHeapReferenceInfoField; +typedef struct _jvmtiHeapReferenceInfoField jvmtiHeapReferenceInfoField; +struct _jvmtiHeapReferenceInfoArray; +typedef struct _jvmtiHeapReferenceInfoArray jvmtiHeapReferenceInfoArray; +struct _jvmtiHeapReferenceInfoConstantPool; +typedef struct _jvmtiHeapReferenceInfoConstantPool jvmtiHeapReferenceInfoConstantPool; +struct _jvmtiHeapReferenceInfoStackLocal; +typedef struct _jvmtiHeapReferenceInfoStackLocal jvmtiHeapReferenceInfoStackLocal; +struct _jvmtiHeapReferenceInfoJniLocal; +typedef struct _jvmtiHeapReferenceInfoJniLocal jvmtiHeapReferenceInfoJniLocal; +struct _jvmtiHeapReferenceInfoReserved; +typedef struct _jvmtiHeapReferenceInfoReserved jvmtiHeapReferenceInfoReserved; +union _jvmtiHeapReferenceInfo; +typedef union _jvmtiHeapReferenceInfo jvmtiHeapReferenceInfo; +struct _jvmtiHeapCallbacks; +typedef struct _jvmtiHeapCallbacks jvmtiHeapCallbacks; +struct _jvmtiClassDefinition; +typedef struct _jvmtiClassDefinition jvmtiClassDefinition; +struct _jvmtiMonitorUsage; +typedef struct _jvmtiMonitorUsage jvmtiMonitorUsage; +struct _jvmtiLineNumberEntry; +typedef struct _jvmtiLineNumberEntry jvmtiLineNumberEntry; +struct _jvmtiLocalVariableEntry; +typedef struct _jvmtiLocalVariableEntry jvmtiLocalVariableEntry; +struct _jvmtiParamInfo; +typedef struct _jvmtiParamInfo jvmtiParamInfo; +struct _jvmtiExtensionFunctionInfo; +typedef struct _jvmtiExtensionFunctionInfo jvmtiExtensionFunctionInfo; +struct _jvmtiExtensionEventInfo; +typedef struct _jvmtiExtensionEventInfo jvmtiExtensionEventInfo; +struct _jvmtiTimerInfo; +typedef struct _jvmtiTimerInfo jvmtiTimerInfo; +struct _jvmtiAddrLocationMap; +typedef struct _jvmtiAddrLocationMap jvmtiAddrLocationMap; + + /* Function Types */ + +typedef void (JNICALL *jvmtiStartFunction) + (jvmtiEnv* jvmti_env, JNIEnv* jni_env, void* arg); + +typedef jint (JNICALL *jvmtiHeapIterationCallback) + (jlong class_tag, jlong size, jlong* tag_ptr, jint length, void* user_data); + +typedef jint (JNICALL *jvmtiHeapReferenceCallback) + (jvmtiHeapReferenceKind reference_kind, const jvmtiHeapReferenceInfo* reference_info, jlong class_tag, jlong referrer_class_tag, jlong size, jlong* tag_ptr, jlong* referrer_tag_ptr, jint length, void* user_data); + +typedef jint (JNICALL *jvmtiPrimitiveFieldCallback) + (jvmtiHeapReferenceKind kind, const jvmtiHeapReferenceInfo* info, jlong object_class_tag, jlong* object_tag_ptr, jvalue value, jvmtiPrimitiveType value_type, void* user_data); + +typedef jint (JNICALL *jvmtiArrayPrimitiveValueCallback) + (jlong class_tag, jlong size, jlong* tag_ptr, jint element_count, jvmtiPrimitiveType element_type, const void* elements, void* user_data); + +typedef jint (JNICALL *jvmtiStringPrimitiveValueCallback) + (jlong class_tag, jlong size, jlong* tag_ptr, const jchar* value, jint value_length, void* user_data); + +typedef jint (JNICALL *jvmtiReservedCallback) + (); + +typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback) + (jlong class_tag, jlong size, jlong* tag_ptr, void* user_data); + +typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback) + (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong* tag_ptr, void* user_data); + +typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback) + (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong* tag_ptr, jlong thread_tag, jint depth, jmethodID method, jint slot, void* user_data); + +typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback) + (jvmtiObjectReferenceKind reference_kind, jlong class_tag, jlong size, jlong* tag_ptr, jlong referrer_tag, jint referrer_index, void* user_data); + +typedef jvmtiError (JNICALL *jvmtiExtensionFunction) + (jvmtiEnv* jvmti_env, ...); + +typedef void (JNICALL *jvmtiExtensionEvent) + (jvmtiEnv* jvmti_env, ...); + + + /* Structure Types */ +struct _jvmtiThreadInfo { + char* name; + jint priority; + jboolean is_daemon; + jthreadGroup thread_group; + jobject context_class_loader; +}; +struct _jvmtiMonitorStackDepthInfo { + jobject monitor; + jint stack_depth; +}; +struct _jvmtiThreadGroupInfo { + jthreadGroup parent; + char* name; + jint max_priority; + jboolean is_daemon; +}; +struct _jvmtiFrameInfo { + jmethodID method; + jlocation location; +}; +struct _jvmtiStackInfo { + jthread thread; + jint state; + jvmtiFrameInfo* frame_buffer; + jint frame_count; +}; +struct _jvmtiHeapReferenceInfoField { + jint index; +}; +struct _jvmtiHeapReferenceInfoArray { + jint index; +}; +struct _jvmtiHeapReferenceInfoConstantPool { + jint index; +}; +struct _jvmtiHeapReferenceInfoStackLocal { + jlong thread_tag; + jlong thread_id; + jint depth; + jmethodID method; + jlocation location; + jint slot; +}; +struct _jvmtiHeapReferenceInfoJniLocal { + jlong thread_tag; + jlong thread_id; + jint depth; + jmethodID method; +}; +struct _jvmtiHeapReferenceInfoReserved { + jlong reserved1; + jlong reserved2; + jlong reserved3; + jlong reserved4; + jlong reserved5; + jlong reserved6; + jlong reserved7; + jlong reserved8; +}; +union _jvmtiHeapReferenceInfo { + jvmtiHeapReferenceInfoField field; + jvmtiHeapReferenceInfoArray array; + jvmtiHeapReferenceInfoConstantPool constant_pool; + jvmtiHeapReferenceInfoStackLocal stack_local; + jvmtiHeapReferenceInfoJniLocal jni_local; + jvmtiHeapReferenceInfoReserved other; +}; +struct _jvmtiHeapCallbacks { + jvmtiHeapIterationCallback heap_iteration_callback; + jvmtiHeapReferenceCallback heap_reference_callback; + jvmtiPrimitiveFieldCallback primitive_field_callback; + jvmtiArrayPrimitiveValueCallback array_primitive_value_callback; + jvmtiStringPrimitiveValueCallback string_primitive_value_callback; + jvmtiReservedCallback reserved5; + jvmtiReservedCallback reserved6; + jvmtiReservedCallback reserved7; + jvmtiReservedCallback reserved8; + jvmtiReservedCallback reserved9; + jvmtiReservedCallback reserved10; + jvmtiReservedCallback reserved11; + jvmtiReservedCallback reserved12; + jvmtiReservedCallback reserved13; + jvmtiReservedCallback reserved14; + jvmtiReservedCallback reserved15; +}; +struct _jvmtiClassDefinition { + jclass klass; + jint class_byte_count; + const unsigned char* class_bytes; +}; +struct _jvmtiMonitorUsage { + jthread owner; + jint entry_count; + jint waiter_count; + jthread* waiters; + jint notify_waiter_count; + jthread* notify_waiters; +}; +struct _jvmtiLineNumberEntry { + jlocation start_location; + jint line_number; +}; +struct _jvmtiLocalVariableEntry { + jlocation start_location; + jint length; + char* name; + char* signature; + char* generic_signature; + jint slot; +}; +struct _jvmtiParamInfo { + char* name; + jvmtiParamKind kind; + jvmtiParamTypes base_type; + jboolean null_ok; +}; +struct _jvmtiExtensionFunctionInfo { + jvmtiExtensionFunction func; + char* id; + char* short_description; + jint param_count; + jvmtiParamInfo* params; + jint error_count; + jvmtiError* errors; +}; +struct _jvmtiExtensionEventInfo { + jint extension_event_index; + char* id; + char* short_description; + jint param_count; + jvmtiParamInfo* params; +}; +struct _jvmtiTimerInfo { + jlong max_value; + jboolean may_skip_forward; + jboolean may_skip_backward; + jvmtiTimerKind kind; + jlong reserved1; + jlong reserved2; +}; +struct _jvmtiAddrLocationMap { + const void* start_address; + jlocation location; +}; + +typedef struct { + unsigned int can_tag_objects : 1; + unsigned int can_generate_field_modification_events : 1; + unsigned int can_generate_field_access_events : 1; + unsigned int can_get_bytecodes : 1; + unsigned int can_get_synthetic_attribute : 1; + unsigned int can_get_owned_monitor_info : 1; + unsigned int can_get_current_contended_monitor : 1; + unsigned int can_get_monitor_info : 1; + unsigned int can_pop_frame : 1; + unsigned int can_redefine_classes : 1; + unsigned int can_signal_thread : 1; + unsigned int can_get_source_file_name : 1; + unsigned int can_get_line_numbers : 1; + unsigned int can_get_source_debug_extension : 1; + unsigned int can_access_local_variables : 1; + unsigned int can_maintain_original_method_order : 1; + unsigned int can_generate_single_step_events : 1; + unsigned int can_generate_exception_events : 1; + unsigned int can_generate_frame_pop_events : 1; + unsigned int can_generate_breakpoint_events : 1; + unsigned int can_suspend : 1; + unsigned int can_redefine_any_class : 1; + unsigned int can_get_current_thread_cpu_time : 1; + unsigned int can_get_thread_cpu_time : 1; + unsigned int can_generate_method_entry_events : 1; + unsigned int can_generate_method_exit_events : 1; + unsigned int can_generate_all_class_hook_events : 1; + unsigned int can_generate_compiled_method_load_events : 1; + unsigned int can_generate_monitor_events : 1; + unsigned int can_generate_vm_object_alloc_events : 1; + unsigned int can_generate_native_method_bind_events : 1; + unsigned int can_generate_garbage_collection_events : 1; + unsigned int can_generate_object_free_events : 1; + unsigned int can_force_early_return : 1; + unsigned int can_get_owned_monitor_stack_depth_info : 1; + unsigned int can_get_constant_pool : 1; + unsigned int can_set_native_method_prefix : 1; + unsigned int can_retransform_classes : 1; + unsigned int can_retransform_any_class : 1; + unsigned int can_generate_resource_exhaustion_heap_events : 1; + unsigned int can_generate_resource_exhaustion_threads_events : 1; + unsigned int : 7; + unsigned int : 16; + unsigned int : 16; + unsigned int : 16; + unsigned int : 16; + unsigned int : 16; +} jvmtiCapabilities; + + + /* Event Definitions */ + +typedef void (JNICALL *jvmtiEventReserved)(void); + + +typedef void (JNICALL *jvmtiEventBreakpoint) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location); + +typedef void (JNICALL *jvmtiEventClassFileLoadHook) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jclass class_being_redefined, + jobject loader, + const char* name, + jobject protection_domain, + jint class_data_len, + const unsigned char* class_data, + jint* new_class_data_len, + unsigned char** new_class_data); + +typedef void (JNICALL *jvmtiEventClassLoad) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jclass klass); + +typedef void (JNICALL *jvmtiEventClassPrepare) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jclass klass); + +typedef void (JNICALL *jvmtiEventCompiledMethodLoad) + (jvmtiEnv *jvmti_env, + jmethodID method, + jint code_size, + const void* code_addr, + jint map_length, + const jvmtiAddrLocationMap* map, + const void* compile_info); + +typedef void (JNICALL *jvmtiEventCompiledMethodUnload) + (jvmtiEnv *jvmti_env, + jmethodID method, + const void* code_addr); + +typedef void (JNICALL *jvmtiEventDataDumpRequest) + (jvmtiEnv *jvmti_env); + +typedef void (JNICALL *jvmtiEventDynamicCodeGenerated) + (jvmtiEnv *jvmti_env, + const char* name, + const void* address, + jint length); + +typedef void (JNICALL *jvmtiEventException) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location, + jobject exception, + jmethodID catch_method, + jlocation catch_location); + +typedef void (JNICALL *jvmtiEventExceptionCatch) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location, + jobject exception); + +typedef void (JNICALL *jvmtiEventFieldAccess) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location, + jclass field_klass, + jobject object, + jfieldID field); + +typedef void (JNICALL *jvmtiEventFieldModification) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location, + jclass field_klass, + jobject object, + jfieldID field, + char signature_type, + jvalue new_value); + +typedef void (JNICALL *jvmtiEventFramePop) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jboolean was_popped_by_exception); + +typedef void (JNICALL *jvmtiEventGarbageCollectionFinish) + (jvmtiEnv *jvmti_env); + +typedef void (JNICALL *jvmtiEventGarbageCollectionStart) + (jvmtiEnv *jvmti_env); + +typedef void (JNICALL *jvmtiEventMethodEntry) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method); + +typedef void (JNICALL *jvmtiEventMethodExit) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jboolean was_popped_by_exception, + jvalue return_value); + +typedef void (JNICALL *jvmtiEventMonitorContendedEnter) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jobject object); + +typedef void (JNICALL *jvmtiEventMonitorContendedEntered) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jobject object); + +typedef void (JNICALL *jvmtiEventMonitorWait) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jobject object, + jlong timeout); + +typedef void (JNICALL *jvmtiEventMonitorWaited) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jobject object, + jboolean timed_out); + +typedef void (JNICALL *jvmtiEventNativeMethodBind) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + void* address, + void** new_address_ptr); + +typedef void (JNICALL *jvmtiEventObjectFree) + (jvmtiEnv *jvmti_env, + jlong tag); + +typedef void (JNICALL *jvmtiEventResourceExhausted) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jint flags, + const void* reserved, + const char* description); + +typedef void (JNICALL *jvmtiEventSingleStep) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jmethodID method, + jlocation location); + +typedef void (JNICALL *jvmtiEventThreadEnd) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread); + +typedef void (JNICALL *jvmtiEventThreadStart) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread); + +typedef void (JNICALL *jvmtiEventVMDeath) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env); + +typedef void (JNICALL *jvmtiEventVMInit) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread); + +typedef void (JNICALL *jvmtiEventVMObjectAlloc) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env, + jthread thread, + jobject object, + jclass object_klass, + jlong size); + +typedef void (JNICALL *jvmtiEventVMStart) + (jvmtiEnv *jvmti_env, + JNIEnv* jni_env); + + /* Event Callback Structure */ + +typedef struct { + /* 50 : VM Initialization Event */ + jvmtiEventVMInit VMInit; + /* 51 : VM Death Event */ + jvmtiEventVMDeath VMDeath; + /* 52 : Thread Start */ + jvmtiEventThreadStart ThreadStart; + /* 53 : Thread End */ + jvmtiEventThreadEnd ThreadEnd; + /* 54 : Class File Load Hook */ + jvmtiEventClassFileLoadHook ClassFileLoadHook; + /* 55 : Class Load */ + jvmtiEventClassLoad ClassLoad; + /* 56 : Class Prepare */ + jvmtiEventClassPrepare ClassPrepare; + /* 57 : VM Start Event */ + jvmtiEventVMStart VMStart; + /* 58 : Exception */ + jvmtiEventException Exception; + /* 59 : Exception Catch */ + jvmtiEventExceptionCatch ExceptionCatch; + /* 60 : Single Step */ + jvmtiEventSingleStep SingleStep; + /* 61 : Frame Pop */ + jvmtiEventFramePop FramePop; + /* 62 : Breakpoint */ + jvmtiEventBreakpoint Breakpoint; + /* 63 : Field Access */ + jvmtiEventFieldAccess FieldAccess; + /* 64 : Field Modification */ + jvmtiEventFieldModification FieldModification; + /* 65 : Method Entry */ + jvmtiEventMethodEntry MethodEntry; + /* 66 : Method Exit */ + jvmtiEventMethodExit MethodExit; + /* 67 : Native Method Bind */ + jvmtiEventNativeMethodBind NativeMethodBind; + /* 68 : Compiled Method Load */ + jvmtiEventCompiledMethodLoad CompiledMethodLoad; + /* 69 : Compiled Method Unload */ + jvmtiEventCompiledMethodUnload CompiledMethodUnload; + /* 70 : Dynamic Code Generated */ + jvmtiEventDynamicCodeGenerated DynamicCodeGenerated; + /* 71 : Data Dump Request */ + jvmtiEventDataDumpRequest DataDumpRequest; + /* 72 */ + jvmtiEventReserved reserved72; + /* 73 : Monitor Wait */ + jvmtiEventMonitorWait MonitorWait; + /* 74 : Monitor Waited */ + jvmtiEventMonitorWaited MonitorWaited; + /* 75 : Monitor Contended Enter */ + jvmtiEventMonitorContendedEnter MonitorContendedEnter; + /* 76 : Monitor Contended Entered */ + jvmtiEventMonitorContendedEntered MonitorContendedEntered; + /* 77 */ + jvmtiEventReserved reserved77; + /* 78 */ + jvmtiEventReserved reserved78; + /* 79 */ + jvmtiEventReserved reserved79; + /* 80 : Resource Exhausted */ + jvmtiEventResourceExhausted ResourceExhausted; + /* 81 : Garbage Collection Start */ + jvmtiEventGarbageCollectionStart GarbageCollectionStart; + /* 82 : Garbage Collection Finish */ + jvmtiEventGarbageCollectionFinish GarbageCollectionFinish; + /* 83 : Object Free */ + jvmtiEventObjectFree ObjectFree; + /* 84 : VM Object Allocation */ + jvmtiEventVMObjectAlloc VMObjectAlloc; +} jvmtiEventCallbacks; + + + /* Function Interface */ + +typedef struct jvmtiInterface_1_ { + + /* 1 : RESERVED */ + void *reserved1; + + /* 2 : Set Event Notification Mode */ + jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env, + jvmtiEventMode mode, + jvmtiEvent event_type, + jthread event_thread, + ...); + + /* 3 : RESERVED */ + void *reserved3; + + /* 4 : Get All Threads */ + jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env, + jint* threads_count_ptr, + jthread** threads_ptr); + + /* 5 : Suspend Thread */ + jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env, + jthread thread); + + /* 6 : Resume Thread */ + jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env, + jthread thread); + + /* 7 : Stop Thread */ + jvmtiError (JNICALL *StopThread) (jvmtiEnv* env, + jthread thread, + jobject exception); + + /* 8 : Interrupt Thread */ + jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env, + jthread thread); + + /* 9 : Get Thread Info */ + jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env, + jthread thread, + jvmtiThreadInfo* info_ptr); + + /* 10 : Get Owned Monitor Info */ + jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env, + jthread thread, + jint* owned_monitor_count_ptr, + jobject** owned_monitors_ptr); + + /* 11 : Get Current Contended Monitor */ + jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env, + jthread thread, + jobject* monitor_ptr); + + /* 12 : Run Agent Thread */ + jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env, + jthread thread, + jvmtiStartFunction proc, + const void* arg, + jint priority); + + /* 13 : Get Top Thread Groups */ + jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env, + jint* group_count_ptr, + jthreadGroup** groups_ptr); + + /* 14 : Get Thread Group Info */ + jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env, + jthreadGroup group, + jvmtiThreadGroupInfo* info_ptr); + + /* 15 : Get Thread Group Children */ + jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env, + jthreadGroup group, + jint* thread_count_ptr, + jthread** threads_ptr, + jint* group_count_ptr, + jthreadGroup** groups_ptr); + + /* 16 : Get Frame Count */ + jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env, + jthread thread, + jint* count_ptr); + + /* 17 : Get Thread State */ + jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env, + jthread thread, + jint* thread_state_ptr); + + /* 18 : Get Current Thread */ + jvmtiError (JNICALL *GetCurrentThread) (jvmtiEnv* env, + jthread* thread_ptr); + + /* 19 : Get Frame Location */ + jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env, + jthread thread, + jint depth, + jmethodID* method_ptr, + jlocation* location_ptr); + + /* 20 : Notify Frame Pop */ + jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env, + jthread thread, + jint depth); + + /* 21 : Get Local Variable - Object */ + jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jobject* value_ptr); + + /* 22 : Get Local Variable - Int */ + jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jint* value_ptr); + + /* 23 : Get Local Variable - Long */ + jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jlong* value_ptr); + + /* 24 : Get Local Variable - Float */ + jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jfloat* value_ptr); + + /* 25 : Get Local Variable - Double */ + jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jdouble* value_ptr); + + /* 26 : Set Local Variable - Object */ + jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jobject value); + + /* 27 : Set Local Variable - Int */ + jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jint value); + + /* 28 : Set Local Variable - Long */ + jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jlong value); + + /* 29 : Set Local Variable - Float */ + jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jfloat value); + + /* 30 : Set Local Variable - Double */ + jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env, + jthread thread, + jint depth, + jint slot, + jdouble value); + + /* 31 : Create Raw Monitor */ + jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env, + const char* name, + jrawMonitorID* monitor_ptr); + + /* 32 : Destroy Raw Monitor */ + jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env, + jrawMonitorID monitor); + + /* 33 : Raw Monitor Enter */ + jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env, + jrawMonitorID monitor); + + /* 34 : Raw Monitor Exit */ + jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env, + jrawMonitorID monitor); + + /* 35 : Raw Monitor Wait */ + jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env, + jrawMonitorID monitor, + jlong millis); + + /* 36 : Raw Monitor Notify */ + jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env, + jrawMonitorID monitor); + + /* 37 : Raw Monitor Notify All */ + jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env, + jrawMonitorID monitor); + + /* 38 : Set Breakpoint */ + jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env, + jmethodID method, + jlocation location); + + /* 39 : Clear Breakpoint */ + jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env, + jmethodID method, + jlocation location); + + /* 40 : RESERVED */ + void *reserved40; + + /* 41 : Set Field Access Watch */ + jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env, + jclass klass, + jfieldID field); + + /* 42 : Clear Field Access Watch */ + jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env, + jclass klass, + jfieldID field); + + /* 43 : Set Field Modification Watch */ + jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env, + jclass klass, + jfieldID field); + + /* 44 : Clear Field Modification Watch */ + jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env, + jclass klass, + jfieldID field); + + /* 45 : Is Modifiable Class */ + jvmtiError (JNICALL *IsModifiableClass) (jvmtiEnv* env, + jclass klass, + jboolean* is_modifiable_class_ptr); + + /* 46 : Allocate */ + jvmtiError (JNICALL *Allocate) (jvmtiEnv* env, + jlong size, + unsigned char** mem_ptr); + + /* 47 : Deallocate */ + jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env, + unsigned char* mem); + + /* 48 : Get Class Signature */ + jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env, + jclass klass, + char** signature_ptr, + char** generic_ptr); + + /* 49 : Get Class Status */ + jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env, + jclass klass, + jint* status_ptr); + + /* 50 : Get Source File Name */ + jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env, + jclass klass, + char** source_name_ptr); + + /* 51 : Get Class Modifiers */ + jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env, + jclass klass, + jint* modifiers_ptr); + + /* 52 : Get Class Methods */ + jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env, + jclass klass, + jint* method_count_ptr, + jmethodID** methods_ptr); + + /* 53 : Get Class Fields */ + jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env, + jclass klass, + jint* field_count_ptr, + jfieldID** fields_ptr); + + /* 54 : Get Implemented Interfaces */ + jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env, + jclass klass, + jint* interface_count_ptr, + jclass** interfaces_ptr); + + /* 55 : Is Interface */ + jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env, + jclass klass, + jboolean* is_interface_ptr); + + /* 56 : Is Array Class */ + jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env, + jclass klass, + jboolean* is_array_class_ptr); + + /* 57 : Get Class Loader */ + jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env, + jclass klass, + jobject* classloader_ptr); + + /* 58 : Get Object Hash Code */ + jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env, + jobject object, + jint* hash_code_ptr); + + /* 59 : Get Object Monitor Usage */ + jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env, + jobject object, + jvmtiMonitorUsage* info_ptr); + + /* 60 : Get Field Name (and Signature) */ + jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env, + jclass klass, + jfieldID field, + char** name_ptr, + char** signature_ptr, + char** generic_ptr); + + /* 61 : Get Field Declaring Class */ + jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env, + jclass klass, + jfieldID field, + jclass* declaring_class_ptr); + + /* 62 : Get Field Modifiers */ + jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env, + jclass klass, + jfieldID field, + jint* modifiers_ptr); + + /* 63 : Is Field Synthetic */ + jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env, + jclass klass, + jfieldID field, + jboolean* is_synthetic_ptr); + + /* 64 : Get Method Name (and Signature) */ + jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env, + jmethodID method, + char** name_ptr, + char** signature_ptr, + char** generic_ptr); + + /* 65 : Get Method Declaring Class */ + jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env, + jmethodID method, + jclass* declaring_class_ptr); + + /* 66 : Get Method Modifiers */ + jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env, + jmethodID method, + jint* modifiers_ptr); + + /* 67 : RESERVED */ + void *reserved67; + + /* 68 : Get Max Locals */ + jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env, + jmethodID method, + jint* max_ptr); + + /* 69 : Get Arguments Size */ + jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env, + jmethodID method, + jint* size_ptr); + + /* 70 : Get Line Number Table */ + jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env, + jmethodID method, + jint* entry_count_ptr, + jvmtiLineNumberEntry** table_ptr); + + /* 71 : Get Method Location */ + jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env, + jmethodID method, + jlocation* start_location_ptr, + jlocation* end_location_ptr); + + /* 72 : Get Local Variable Table */ + jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env, + jmethodID method, + jint* entry_count_ptr, + jvmtiLocalVariableEntry** table_ptr); + + /* 73 : Set Native Method Prefix */ + jvmtiError (JNICALL *SetNativeMethodPrefix) (jvmtiEnv* env, + const char* prefix); + + /* 74 : Set Native Method Prefixes */ + jvmtiError (JNICALL *SetNativeMethodPrefixes) (jvmtiEnv* env, + jint prefix_count, + char** prefixes); + + /* 75 : Get Bytecodes */ + jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env, + jmethodID method, + jint* bytecode_count_ptr, + unsigned char** bytecodes_ptr); + + /* 76 : Is Method Native */ + jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env, + jmethodID method, + jboolean* is_native_ptr); + + /* 77 : Is Method Synthetic */ + jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env, + jmethodID method, + jboolean* is_synthetic_ptr); + + /* 78 : Get Loaded Classes */ + jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env, + jint* class_count_ptr, + jclass** classes_ptr); + + /* 79 : Get Classloader Classes */ + jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env, + jobject initiating_loader, + jint* class_count_ptr, + jclass** classes_ptr); + + /* 80 : Pop Frame */ + jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env, + jthread thread); + + /* 81 : Force Early Return - Object */ + jvmtiError (JNICALL *ForceEarlyReturnObject) (jvmtiEnv* env, + jthread thread, + jobject value); + + /* 82 : Force Early Return - Int */ + jvmtiError (JNICALL *ForceEarlyReturnInt) (jvmtiEnv* env, + jthread thread, + jint value); + + /* 83 : Force Early Return - Long */ + jvmtiError (JNICALL *ForceEarlyReturnLong) (jvmtiEnv* env, + jthread thread, + jlong value); + + /* 84 : Force Early Return - Float */ + jvmtiError (JNICALL *ForceEarlyReturnFloat) (jvmtiEnv* env, + jthread thread, + jfloat value); + + /* 85 : Force Early Return - Double */ + jvmtiError (JNICALL *ForceEarlyReturnDouble) (jvmtiEnv* env, + jthread thread, + jdouble value); + + /* 86 : Force Early Return - Void */ + jvmtiError (JNICALL *ForceEarlyReturnVoid) (jvmtiEnv* env, + jthread thread); + + /* 87 : Redefine Classes */ + jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env, + jint class_count, + const jvmtiClassDefinition* class_definitions); + + /* 88 : Get Version Number */ + jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env, + jint* version_ptr); + + /* 89 : Get Capabilities */ + jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env, + jvmtiCapabilities* capabilities_ptr); + + /* 90 : Get Source Debug Extension */ + jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env, + jclass klass, + char** source_debug_extension_ptr); + + /* 91 : Is Method Obsolete */ + jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env, + jmethodID method, + jboolean* is_obsolete_ptr); + + /* 92 : Suspend Thread List */ + jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env, + jint request_count, + const jthread* request_list, + jvmtiError* results); + + /* 93 : Resume Thread List */ + jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env, + jint request_count, + const jthread* request_list, + jvmtiError* results); + + /* 94 : RESERVED */ + void *reserved94; + + /* 95 : RESERVED */ + void *reserved95; + + /* 96 : RESERVED */ + void *reserved96; + + /* 97 : RESERVED */ + void *reserved97; + + /* 98 : RESERVED */ + void *reserved98; + + /* 99 : RESERVED */ + void *reserved99; + + /* 100 : Get All Stack Traces */ + jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env, + jint max_frame_count, + jvmtiStackInfo** stack_info_ptr, + jint* thread_count_ptr); + + /* 101 : Get Thread List Stack Traces */ + jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env, + jint thread_count, + const jthread* thread_list, + jint max_frame_count, + jvmtiStackInfo** stack_info_ptr); + + /* 102 : Get Thread Local Storage */ + jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env, + jthread thread, + void** data_ptr); + + /* 103 : Set Thread Local Storage */ + jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env, + jthread thread, + const void* data); + + /* 104 : Get Stack Trace */ + jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env, + jthread thread, + jint start_depth, + jint max_frame_count, + jvmtiFrameInfo* frame_buffer, + jint* count_ptr); + + /* 105 : RESERVED */ + void *reserved105; + + /* 106 : Get Tag */ + jvmtiError (JNICALL *GetTag) (jvmtiEnv* env, + jobject object, + jlong* tag_ptr); + + /* 107 : Set Tag */ + jvmtiError (JNICALL *SetTag) (jvmtiEnv* env, + jobject object, + jlong tag); + + /* 108 : Force Garbage Collection */ + jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env); + + /* 109 : Iterate Over Objects Reachable From Object */ + jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env, + jobject object, + jvmtiObjectReferenceCallback object_reference_callback, + const void* user_data); + + /* 110 : Iterate Over Reachable Objects */ + jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env, + jvmtiHeapRootCallback heap_root_callback, + jvmtiStackReferenceCallback stack_ref_callback, + jvmtiObjectReferenceCallback object_ref_callback, + const void* user_data); + + /* 111 : Iterate Over Heap */ + jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env, + jvmtiHeapObjectFilter object_filter, + jvmtiHeapObjectCallback heap_object_callback, + const void* user_data); + + /* 112 : Iterate Over Instances Of Class */ + jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env, + jclass klass, + jvmtiHeapObjectFilter object_filter, + jvmtiHeapObjectCallback heap_object_callback, + const void* user_data); + + /* 113 : RESERVED */ + void *reserved113; + + /* 114 : Get Objects With Tags */ + jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env, + jint tag_count, + const jlong* tags, + jint* count_ptr, + jobject** object_result_ptr, + jlong** tag_result_ptr); + + /* 115 : Follow References */ + jvmtiError (JNICALL *FollowReferences) (jvmtiEnv* env, + jint heap_filter, + jclass klass, + jobject initial_object, + const jvmtiHeapCallbacks* callbacks, + const void* user_data); + + /* 116 : Iterate Through Heap */ + jvmtiError (JNICALL *IterateThroughHeap) (jvmtiEnv* env, + jint heap_filter, + jclass klass, + const jvmtiHeapCallbacks* callbacks, + const void* user_data); + + /* 117 : RESERVED */ + void *reserved117; + + /* 118 : RESERVED */ + void *reserved118; + + /* 119 : RESERVED */ + void *reserved119; + + /* 120 : Set JNI Function Table */ + jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env, + const jniNativeInterface* function_table); + + /* 121 : Get JNI Function Table */ + jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env, + jniNativeInterface** function_table); + + /* 122 : Set Event Callbacks */ + jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env, + const jvmtiEventCallbacks* callbacks, + jint size_of_callbacks); + + /* 123 : Generate Events */ + jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env, + jvmtiEvent event_type); + + /* 124 : Get Extension Functions */ + jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env, + jint* extension_count_ptr, + jvmtiExtensionFunctionInfo** extensions); + + /* 125 : Get Extension Events */ + jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env, + jint* extension_count_ptr, + jvmtiExtensionEventInfo** extensions); + + /* 126 : Set Extension Event Callback */ + jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env, + jint extension_event_index, + jvmtiExtensionEvent callback); + + /* 127 : Dispose Environment */ + jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env); + + /* 128 : Get Error Name */ + jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env, + jvmtiError error, + char** name_ptr); + + /* 129 : Get JLocation Format */ + jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env, + jvmtiJlocationFormat* format_ptr); + + /* 130 : Get System Properties */ + jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env, + jint* count_ptr, + char*** property_ptr); + + /* 131 : Get System Property */ + jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env, + const char* property, + char** value_ptr); + + /* 132 : Set System Property */ + jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env, + const char* property, + const char* value); + + /* 133 : Get Phase */ + jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env, + jvmtiPhase* phase_ptr); + + /* 134 : Get Current Thread CPU Timer Information */ + jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env, + jvmtiTimerInfo* info_ptr); + + /* 135 : Get Current Thread CPU Time */ + jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env, + jlong* nanos_ptr); + + /* 136 : Get Thread CPU Timer Information */ + jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env, + jvmtiTimerInfo* info_ptr); + + /* 137 : Get Thread CPU Time */ + jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env, + jthread thread, + jlong* nanos_ptr); + + /* 138 : Get Timer Information */ + jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env, + jvmtiTimerInfo* info_ptr); + + /* 139 : Get Time */ + jvmtiError (JNICALL *GetTime) (jvmtiEnv* env, + jlong* nanos_ptr); + + /* 140 : Get Potential Capabilities */ + jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env, + jvmtiCapabilities* capabilities_ptr); + + /* 141 : RESERVED */ + void *reserved141; + + /* 142 : Add Capabilities */ + jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env, + const jvmtiCapabilities* capabilities_ptr); + + /* 143 : Relinquish Capabilities */ + jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env, + const jvmtiCapabilities* capabilities_ptr); + + /* 144 : Get Available Processors */ + jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env, + jint* processor_count_ptr); + + /* 145 : Get Class Version Numbers */ + jvmtiError (JNICALL *GetClassVersionNumbers) (jvmtiEnv* env, + jclass klass, + jint* minor_version_ptr, + jint* major_version_ptr); + + /* 146 : Get Constant Pool */ + jvmtiError (JNICALL *GetConstantPool) (jvmtiEnv* env, + jclass klass, + jint* constant_pool_count_ptr, + jint* constant_pool_byte_count_ptr, + unsigned char** constant_pool_bytes_ptr); + + /* 147 : Get Environment Local Storage */ + jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env, + void** data_ptr); + + /* 148 : Set Environment Local Storage */ + jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env, + const void* data); + + /* 149 : Add To Bootstrap Class Loader Search */ + jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env, + const char* segment); + + /* 150 : Set Verbose Flag */ + jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env, + jvmtiVerboseFlag flag, + jboolean value); + + /* 151 : Add To System Class Loader Search */ + jvmtiError (JNICALL *AddToSystemClassLoaderSearch) (jvmtiEnv* env, + const char* segment); + + /* 152 : Retransform Classes */ + jvmtiError (JNICALL *RetransformClasses) (jvmtiEnv* env, + jint class_count, + const jclass* classes); + + /* 153 : Get Owned Monitor Stack Depth Info */ + jvmtiError (JNICALL *GetOwnedMonitorStackDepthInfo) (jvmtiEnv* env, + jthread thread, + jint* monitor_info_count_ptr, + jvmtiMonitorStackDepthInfo** monitor_info_ptr); + + /* 154 : Get Object Size */ + jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env, + jobject object, + jlong* size_ptr); + + /* 155 : Get Local Instance */ + jvmtiError (JNICALL *GetLocalInstance) (jvmtiEnv* env, + jthread thread, + jint depth, + jobject* value_ptr); + +} jvmtiInterface_1; + +struct _jvmtiEnv { + const struct jvmtiInterface_1_ *functions; +#ifdef __cplusplus + + + jvmtiError Allocate(jlong size, + unsigned char** mem_ptr) { + return functions->Allocate(this, size, mem_ptr); + } + + jvmtiError Deallocate(unsigned char* mem) { + return functions->Deallocate(this, mem); + } + + jvmtiError GetThreadState(jthread thread, + jint* thread_state_ptr) { + return functions->GetThreadState(this, thread, thread_state_ptr); + } + + jvmtiError GetCurrentThread(jthread* thread_ptr) { + return functions->GetCurrentThread(this, thread_ptr); + } + + jvmtiError GetAllThreads(jint* threads_count_ptr, + jthread** threads_ptr) { + return functions->GetAllThreads(this, threads_count_ptr, threads_ptr); + } + + jvmtiError SuspendThread(jthread thread) { + return functions->SuspendThread(this, thread); + } + + jvmtiError SuspendThreadList(jint request_count, + const jthread* request_list, + jvmtiError* results) { + return functions->SuspendThreadList(this, request_count, request_list, results); + } + + jvmtiError ResumeThread(jthread thread) { + return functions->ResumeThread(this, thread); + } + + jvmtiError ResumeThreadList(jint request_count, + const jthread* request_list, + jvmtiError* results) { + return functions->ResumeThreadList(this, request_count, request_list, results); + } + + jvmtiError StopThread(jthread thread, + jobject exception) { + return functions->StopThread(this, thread, exception); + } + + jvmtiError InterruptThread(jthread thread) { + return functions->InterruptThread(this, thread); + } + + jvmtiError GetThreadInfo(jthread thread, + jvmtiThreadInfo* info_ptr) { + return functions->GetThreadInfo(this, thread, info_ptr); + } + + jvmtiError GetOwnedMonitorInfo(jthread thread, + jint* owned_monitor_count_ptr, + jobject** owned_monitors_ptr) { + return functions->GetOwnedMonitorInfo(this, thread, owned_monitor_count_ptr, owned_monitors_ptr); + } + + jvmtiError GetOwnedMonitorStackDepthInfo(jthread thread, + jint* monitor_info_count_ptr, + jvmtiMonitorStackDepthInfo** monitor_info_ptr) { + return functions->GetOwnedMonitorStackDepthInfo(this, thread, monitor_info_count_ptr, monitor_info_ptr); + } + + jvmtiError GetCurrentContendedMonitor(jthread thread, + jobject* monitor_ptr) { + return functions->GetCurrentContendedMonitor(this, thread, monitor_ptr); + } + + jvmtiError RunAgentThread(jthread thread, + jvmtiStartFunction proc, + const void* arg, + jint priority) { + return functions->RunAgentThread(this, thread, proc, arg, priority); + } + + jvmtiError SetThreadLocalStorage(jthread thread, + const void* data) { + return functions->SetThreadLocalStorage(this, thread, data); + } + + jvmtiError GetThreadLocalStorage(jthread thread, + void** data_ptr) { + return functions->GetThreadLocalStorage(this, thread, data_ptr); + } + + jvmtiError GetTopThreadGroups(jint* group_count_ptr, + jthreadGroup** groups_ptr) { + return functions->GetTopThreadGroups(this, group_count_ptr, groups_ptr); + } + + jvmtiError GetThreadGroupInfo(jthreadGroup group, + jvmtiThreadGroupInfo* info_ptr) { + return functions->GetThreadGroupInfo(this, group, info_ptr); + } + + jvmtiError GetThreadGroupChildren(jthreadGroup group, + jint* thread_count_ptr, + jthread** threads_ptr, + jint* group_count_ptr, + jthreadGroup** groups_ptr) { + return functions->GetThreadGroupChildren(this, group, thread_count_ptr, threads_ptr, group_count_ptr, groups_ptr); + } + + jvmtiError GetStackTrace(jthread thread, + jint start_depth, + jint max_frame_count, + jvmtiFrameInfo* frame_buffer, + jint* count_ptr) { + return functions->GetStackTrace(this, thread, start_depth, max_frame_count, frame_buffer, count_ptr); + } + + jvmtiError GetAllStackTraces(jint max_frame_count, + jvmtiStackInfo** stack_info_ptr, + jint* thread_count_ptr) { + return functions->GetAllStackTraces(this, max_frame_count, stack_info_ptr, thread_count_ptr); + } + + jvmtiError GetThreadListStackTraces(jint thread_count, + const jthread* thread_list, + jint max_frame_count, + jvmtiStackInfo** stack_info_ptr) { + return functions->GetThreadListStackTraces(this, thread_count, thread_list, max_frame_count, stack_info_ptr); + } + + jvmtiError GetFrameCount(jthread thread, + jint* count_ptr) { + return functions->GetFrameCount(this, thread, count_ptr); + } + + jvmtiError PopFrame(jthread thread) { + return functions->PopFrame(this, thread); + } + + jvmtiError GetFrameLocation(jthread thread, + jint depth, + jmethodID* method_ptr, + jlocation* location_ptr) { + return functions->GetFrameLocation(this, thread, depth, method_ptr, location_ptr); + } + + jvmtiError NotifyFramePop(jthread thread, + jint depth) { + return functions->NotifyFramePop(this, thread, depth); + } + + jvmtiError ForceEarlyReturnObject(jthread thread, + jobject value) { + return functions->ForceEarlyReturnObject(this, thread, value); + } + + jvmtiError ForceEarlyReturnInt(jthread thread, + jint value) { + return functions->ForceEarlyReturnInt(this, thread, value); + } + + jvmtiError ForceEarlyReturnLong(jthread thread, + jlong value) { + return functions->ForceEarlyReturnLong(this, thread, value); + } + + jvmtiError ForceEarlyReturnFloat(jthread thread, + jfloat value) { + return functions->ForceEarlyReturnFloat(this, thread, value); + } + + jvmtiError ForceEarlyReturnDouble(jthread thread, + jdouble value) { + return functions->ForceEarlyReturnDouble(this, thread, value); + } + + jvmtiError ForceEarlyReturnVoid(jthread thread) { + return functions->ForceEarlyReturnVoid(this, thread); + } + + jvmtiError FollowReferences(jint heap_filter, + jclass klass, + jobject initial_object, + const jvmtiHeapCallbacks* callbacks, + const void* user_data) { + return functions->FollowReferences(this, heap_filter, klass, initial_object, callbacks, user_data); + } + + jvmtiError IterateThroughHeap(jint heap_filter, + jclass klass, + const jvmtiHeapCallbacks* callbacks, + const void* user_data) { + return functions->IterateThroughHeap(this, heap_filter, klass, callbacks, user_data); + } + + jvmtiError GetTag(jobject object, + jlong* tag_ptr) { + return functions->GetTag(this, object, tag_ptr); + } + + jvmtiError SetTag(jobject object, + jlong tag) { + return functions->SetTag(this, object, tag); + } + + jvmtiError GetObjectsWithTags(jint tag_count, + const jlong* tags, + jint* count_ptr, + jobject** object_result_ptr, + jlong** tag_result_ptr) { + return functions->GetObjectsWithTags(this, tag_count, tags, count_ptr, object_result_ptr, tag_result_ptr); + } + + jvmtiError ForceGarbageCollection() { + return functions->ForceGarbageCollection(this); + } + + jvmtiError IterateOverObjectsReachableFromObject(jobject object, + jvmtiObjectReferenceCallback object_reference_callback, + const void* user_data) { + return functions->IterateOverObjectsReachableFromObject(this, object, object_reference_callback, user_data); + } + + jvmtiError IterateOverReachableObjects(jvmtiHeapRootCallback heap_root_callback, + jvmtiStackReferenceCallback stack_ref_callback, + jvmtiObjectReferenceCallback object_ref_callback, + const void* user_data) { + return functions->IterateOverReachableObjects(this, heap_root_callback, stack_ref_callback, object_ref_callback, user_data); + } + + jvmtiError IterateOverHeap(jvmtiHeapObjectFilter object_filter, + jvmtiHeapObjectCallback heap_object_callback, + const void* user_data) { + return functions->IterateOverHeap(this, object_filter, heap_object_callback, user_data); + } + + jvmtiError IterateOverInstancesOfClass(jclass klass, + jvmtiHeapObjectFilter object_filter, + jvmtiHeapObjectCallback heap_object_callback, + const void* user_data) { + return functions->IterateOverInstancesOfClass(this, klass, object_filter, heap_object_callback, user_data); + } + + jvmtiError GetLocalObject(jthread thread, + jint depth, + jint slot, + jobject* value_ptr) { + return functions->GetLocalObject(this, thread, depth, slot, value_ptr); + } + + jvmtiError GetLocalInstance(jthread thread, + jint depth, + jobject* value_ptr) { + return functions->GetLocalInstance(this, thread, depth, value_ptr); + } + + jvmtiError GetLocalInt(jthread thread, + jint depth, + jint slot, + jint* value_ptr) { + return functions->GetLocalInt(this, thread, depth, slot, value_ptr); + } + + jvmtiError GetLocalLong(jthread thread, + jint depth, + jint slot, + jlong* value_ptr) { + return functions->GetLocalLong(this, thread, depth, slot, value_ptr); + } + + jvmtiError GetLocalFloat(jthread thread, + jint depth, + jint slot, + jfloat* value_ptr) { + return functions->GetLocalFloat(this, thread, depth, slot, value_ptr); + } + + jvmtiError GetLocalDouble(jthread thread, + jint depth, + jint slot, + jdouble* value_ptr) { + return functions->GetLocalDouble(this, thread, depth, slot, value_ptr); + } + + jvmtiError SetLocalObject(jthread thread, + jint depth, + jint slot, + jobject value) { + return functions->SetLocalObject(this, thread, depth, slot, value); + } + + jvmtiError SetLocalInt(jthread thread, + jint depth, + jint slot, + jint value) { + return functions->SetLocalInt(this, thread, depth, slot, value); + } + + jvmtiError SetLocalLong(jthread thread, + jint depth, + jint slot, + jlong value) { + return functions->SetLocalLong(this, thread, depth, slot, value); + } + + jvmtiError SetLocalFloat(jthread thread, + jint depth, + jint slot, + jfloat value) { + return functions->SetLocalFloat(this, thread, depth, slot, value); + } + + jvmtiError SetLocalDouble(jthread thread, + jint depth, + jint slot, + jdouble value) { + return functions->SetLocalDouble(this, thread, depth, slot, value); + } + + jvmtiError SetBreakpoint(jmethodID method, + jlocation location) { + return functions->SetBreakpoint(this, method, location); + } + + jvmtiError ClearBreakpoint(jmethodID method, + jlocation location) { + return functions->ClearBreakpoint(this, method, location); + } + + jvmtiError SetFieldAccessWatch(jclass klass, + jfieldID field) { + return functions->SetFieldAccessWatch(this, klass, field); + } + + jvmtiError ClearFieldAccessWatch(jclass klass, + jfieldID field) { + return functions->ClearFieldAccessWatch(this, klass, field); + } + + jvmtiError SetFieldModificationWatch(jclass klass, + jfieldID field) { + return functions->SetFieldModificationWatch(this, klass, field); + } + + jvmtiError ClearFieldModificationWatch(jclass klass, + jfieldID field) { + return functions->ClearFieldModificationWatch(this, klass, field); + } + + jvmtiError GetLoadedClasses(jint* class_count_ptr, + jclass** classes_ptr) { + return functions->GetLoadedClasses(this, class_count_ptr, classes_ptr); + } + + jvmtiError GetClassLoaderClasses(jobject initiating_loader, + jint* class_count_ptr, + jclass** classes_ptr) { + return functions->GetClassLoaderClasses(this, initiating_loader, class_count_ptr, classes_ptr); + } + + jvmtiError GetClassSignature(jclass klass, + char** signature_ptr, + char** generic_ptr) { + return functions->GetClassSignature(this, klass, signature_ptr, generic_ptr); + } + + jvmtiError GetClassStatus(jclass klass, + jint* status_ptr) { + return functions->GetClassStatus(this, klass, status_ptr); + } + + jvmtiError GetSourceFileName(jclass klass, + char** source_name_ptr) { + return functions->GetSourceFileName(this, klass, source_name_ptr); + } + + jvmtiError GetClassModifiers(jclass klass, + jint* modifiers_ptr) { + return functions->GetClassModifiers(this, klass, modifiers_ptr); + } + + jvmtiError GetClassMethods(jclass klass, + jint* method_count_ptr, + jmethodID** methods_ptr) { + return functions->GetClassMethods(this, klass, method_count_ptr, methods_ptr); + } + + jvmtiError GetClassFields(jclass klass, + jint* field_count_ptr, + jfieldID** fields_ptr) { + return functions->GetClassFields(this, klass, field_count_ptr, fields_ptr); + } + + jvmtiError GetImplementedInterfaces(jclass klass, + jint* interface_count_ptr, + jclass** interfaces_ptr) { + return functions->GetImplementedInterfaces(this, klass, interface_count_ptr, interfaces_ptr); + } + + jvmtiError GetClassVersionNumbers(jclass klass, + jint* minor_version_ptr, + jint* major_version_ptr) { + return functions->GetClassVersionNumbers(this, klass, minor_version_ptr, major_version_ptr); + } + + jvmtiError GetConstantPool(jclass klass, + jint* constant_pool_count_ptr, + jint* constant_pool_byte_count_ptr, + unsigned char** constant_pool_bytes_ptr) { + return functions->GetConstantPool(this, klass, constant_pool_count_ptr, constant_pool_byte_count_ptr, constant_pool_bytes_ptr); + } + + jvmtiError IsInterface(jclass klass, + jboolean* is_interface_ptr) { + return functions->IsInterface(this, klass, is_interface_ptr); + } + + jvmtiError IsArrayClass(jclass klass, + jboolean* is_array_class_ptr) { + return functions->IsArrayClass(this, klass, is_array_class_ptr); + } + + jvmtiError IsModifiableClass(jclass klass, + jboolean* is_modifiable_class_ptr) { + return functions->IsModifiableClass(this, klass, is_modifiable_class_ptr); + } + + jvmtiError GetClassLoader(jclass klass, + jobject* classloader_ptr) { + return functions->GetClassLoader(this, klass, classloader_ptr); + } + + jvmtiError GetSourceDebugExtension(jclass klass, + char** source_debug_extension_ptr) { + return functions->GetSourceDebugExtension(this, klass, source_debug_extension_ptr); + } + + jvmtiError RetransformClasses(jint class_count, + const jclass* classes) { + return functions->RetransformClasses(this, class_count, classes); + } + + jvmtiError RedefineClasses(jint class_count, + const jvmtiClassDefinition* class_definitions) { + return functions->RedefineClasses(this, class_count, class_definitions); + } + + jvmtiError GetObjectSize(jobject object, + jlong* size_ptr) { + return functions->GetObjectSize(this, object, size_ptr); + } + + jvmtiError GetObjectHashCode(jobject object, + jint* hash_code_ptr) { + return functions->GetObjectHashCode(this, object, hash_code_ptr); + } + + jvmtiError GetObjectMonitorUsage(jobject object, + jvmtiMonitorUsage* info_ptr) { + return functions->GetObjectMonitorUsage(this, object, info_ptr); + } + + jvmtiError GetFieldName(jclass klass, + jfieldID field, + char** name_ptr, + char** signature_ptr, + char** generic_ptr) { + return functions->GetFieldName(this, klass, field, name_ptr, signature_ptr, generic_ptr); + } + + jvmtiError GetFieldDeclaringClass(jclass klass, + jfieldID field, + jclass* declaring_class_ptr) { + return functions->GetFieldDeclaringClass(this, klass, field, declaring_class_ptr); + } + + jvmtiError GetFieldModifiers(jclass klass, + jfieldID field, + jint* modifiers_ptr) { + return functions->GetFieldModifiers(this, klass, field, modifiers_ptr); + } + + jvmtiError IsFieldSynthetic(jclass klass, + jfieldID field, + jboolean* is_synthetic_ptr) { + return functions->IsFieldSynthetic(this, klass, field, is_synthetic_ptr); + } + + jvmtiError GetMethodName(jmethodID method, + char** name_ptr, + char** signature_ptr, + char** generic_ptr) { + return functions->GetMethodName(this, method, name_ptr, signature_ptr, generic_ptr); + } + + jvmtiError GetMethodDeclaringClass(jmethodID method, + jclass* declaring_class_ptr) { + return functions->GetMethodDeclaringClass(this, method, declaring_class_ptr); + } + + jvmtiError GetMethodModifiers(jmethodID method, + jint* modifiers_ptr) { + return functions->GetMethodModifiers(this, method, modifiers_ptr); + } + + jvmtiError GetMaxLocals(jmethodID method, + jint* max_ptr) { + return functions->GetMaxLocals(this, method, max_ptr); + } + + jvmtiError GetArgumentsSize(jmethodID method, + jint* size_ptr) { + return functions->GetArgumentsSize(this, method, size_ptr); + } + + jvmtiError GetLineNumberTable(jmethodID method, + jint* entry_count_ptr, + jvmtiLineNumberEntry** table_ptr) { + return functions->GetLineNumberTable(this, method, entry_count_ptr, table_ptr); + } + + jvmtiError GetMethodLocation(jmethodID method, + jlocation* start_location_ptr, + jlocation* end_location_ptr) { + return functions->GetMethodLocation(this, method, start_location_ptr, end_location_ptr); + } + + jvmtiError GetLocalVariableTable(jmethodID method, + jint* entry_count_ptr, + jvmtiLocalVariableEntry** table_ptr) { + return functions->GetLocalVariableTable(this, method, entry_count_ptr, table_ptr); + } + + jvmtiError GetBytecodes(jmethodID method, + jint* bytecode_count_ptr, + unsigned char** bytecodes_ptr) { + return functions->GetBytecodes(this, method, bytecode_count_ptr, bytecodes_ptr); + } + + jvmtiError IsMethodNative(jmethodID method, + jboolean* is_native_ptr) { + return functions->IsMethodNative(this, method, is_native_ptr); + } + + jvmtiError IsMethodSynthetic(jmethodID method, + jboolean* is_synthetic_ptr) { + return functions->IsMethodSynthetic(this, method, is_synthetic_ptr); + } + + jvmtiError IsMethodObsolete(jmethodID method, + jboolean* is_obsolete_ptr) { + return functions->IsMethodObsolete(this, method, is_obsolete_ptr); + } + + jvmtiError SetNativeMethodPrefix(const char* prefix) { + return functions->SetNativeMethodPrefix(this, prefix); + } + + jvmtiError SetNativeMethodPrefixes(jint prefix_count, + char** prefixes) { + return functions->SetNativeMethodPrefixes(this, prefix_count, prefixes); + } + + jvmtiError CreateRawMonitor(const char* name, + jrawMonitorID* monitor_ptr) { + return functions->CreateRawMonitor(this, name, monitor_ptr); + } + + jvmtiError DestroyRawMonitor(jrawMonitorID monitor) { + return functions->DestroyRawMonitor(this, monitor); + } + + jvmtiError RawMonitorEnter(jrawMonitorID monitor) { + return functions->RawMonitorEnter(this, monitor); + } + + jvmtiError RawMonitorExit(jrawMonitorID monitor) { + return functions->RawMonitorExit(this, monitor); + } + + jvmtiError RawMonitorWait(jrawMonitorID monitor, + jlong millis) { + return functions->RawMonitorWait(this, monitor, millis); + } + + jvmtiError RawMonitorNotify(jrawMonitorID monitor) { + return functions->RawMonitorNotify(this, monitor); + } + + jvmtiError RawMonitorNotifyAll(jrawMonitorID monitor) { + return functions->RawMonitorNotifyAll(this, monitor); + } + + jvmtiError SetJNIFunctionTable(const jniNativeInterface* function_table) { + return functions->SetJNIFunctionTable(this, function_table); + } + + jvmtiError GetJNIFunctionTable(jniNativeInterface** function_table) { + return functions->GetJNIFunctionTable(this, function_table); + } + + jvmtiError SetEventCallbacks(const jvmtiEventCallbacks* callbacks, + jint size_of_callbacks) { + return functions->SetEventCallbacks(this, callbacks, size_of_callbacks); + } + + jvmtiError SetEventNotificationMode(jvmtiEventMode mode, + jvmtiEvent event_type, + jthread event_thread, + ...) { + return functions->SetEventNotificationMode(this, mode, event_type, event_thread); + } + + jvmtiError GenerateEvents(jvmtiEvent event_type) { + return functions->GenerateEvents(this, event_type); + } + + jvmtiError GetExtensionFunctions(jint* extension_count_ptr, + jvmtiExtensionFunctionInfo** extensions) { + return functions->GetExtensionFunctions(this, extension_count_ptr, extensions); + } + + jvmtiError GetExtensionEvents(jint* extension_count_ptr, + jvmtiExtensionEventInfo** extensions) { + return functions->GetExtensionEvents(this, extension_count_ptr, extensions); + } + + jvmtiError SetExtensionEventCallback(jint extension_event_index, + jvmtiExtensionEvent callback) { + return functions->SetExtensionEventCallback(this, extension_event_index, callback); + } + + jvmtiError GetPotentialCapabilities(jvmtiCapabilities* capabilities_ptr) { + return functions->GetPotentialCapabilities(this, capabilities_ptr); + } + + jvmtiError AddCapabilities(const jvmtiCapabilities* capabilities_ptr) { + return functions->AddCapabilities(this, capabilities_ptr); + } + + jvmtiError RelinquishCapabilities(const jvmtiCapabilities* capabilities_ptr) { + return functions->RelinquishCapabilities(this, capabilities_ptr); + } + + jvmtiError GetCapabilities(jvmtiCapabilities* capabilities_ptr) { + return functions->GetCapabilities(this, capabilities_ptr); + } + + jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr) { + return functions->GetCurrentThreadCpuTimerInfo(this, info_ptr); + } + + jvmtiError GetCurrentThreadCpuTime(jlong* nanos_ptr) { + return functions->GetCurrentThreadCpuTime(this, nanos_ptr); + } + + jvmtiError GetThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr) { + return functions->GetThreadCpuTimerInfo(this, info_ptr); + } + + jvmtiError GetThreadCpuTime(jthread thread, + jlong* nanos_ptr) { + return functions->GetThreadCpuTime(this, thread, nanos_ptr); + } + + jvmtiError GetTimerInfo(jvmtiTimerInfo* info_ptr) { + return functions->GetTimerInfo(this, info_ptr); + } + + jvmtiError GetTime(jlong* nanos_ptr) { + return functions->GetTime(this, nanos_ptr); + } + + jvmtiError GetAvailableProcessors(jint* processor_count_ptr) { + return functions->GetAvailableProcessors(this, processor_count_ptr); + } + + jvmtiError AddToBootstrapClassLoaderSearch(const char* segment) { + return functions->AddToBootstrapClassLoaderSearch(this, segment); + } + + jvmtiError AddToSystemClassLoaderSearch(const char* segment) { + return functions->AddToSystemClassLoaderSearch(this, segment); + } + + jvmtiError GetSystemProperties(jint* count_ptr, + char*** property_ptr) { + return functions->GetSystemProperties(this, count_ptr, property_ptr); + } + + jvmtiError GetSystemProperty(const char* property, + char** value_ptr) { + return functions->GetSystemProperty(this, property, value_ptr); + } + + jvmtiError SetSystemProperty(const char* property, + const char* value) { + return functions->SetSystemProperty(this, property, value); + } + + jvmtiError GetPhase(jvmtiPhase* phase_ptr) { + return functions->GetPhase(this, phase_ptr); + } + + jvmtiError DisposeEnvironment() { + return functions->DisposeEnvironment(this); + } + + jvmtiError SetEnvironmentLocalStorage(const void* data) { + return functions->SetEnvironmentLocalStorage(this, data); + } + + jvmtiError GetEnvironmentLocalStorage(void** data_ptr) { + return functions->GetEnvironmentLocalStorage(this, data_ptr); + } + + jvmtiError GetVersionNumber(jint* version_ptr) { + return functions->GetVersionNumber(this, version_ptr); + } + + jvmtiError GetErrorName(jvmtiError error, + char** name_ptr) { + return functions->GetErrorName(this, error, name_ptr); + } + + jvmtiError SetVerboseFlag(jvmtiVerboseFlag flag, + jboolean value) { + return functions->SetVerboseFlag(this, flag, value); + } + + jvmtiError GetJLocationFormat(jvmtiJlocationFormat* format_ptr) { + return functions->GetJLocationFormat(this, format_ptr); + } + +#endif /* __cplusplus */ +}; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* !_JAVA_JVMTI_H_ */ + diff --git a/runtime/include/jvmticmlr.h b/runtime/include/jvmticmlr.h new file mode 100644 index 0000000..c2106d3 --- /dev/null +++ b/runtime/include/jvmticmlr.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This header file defines the data structures sent by the VM + * through the JVMTI CompiledMethodLoad callback function via the + * "void * compile_info" parameter. The memory pointed to by the + * compile_info parameter may not be referenced after returning from + * the CompiledMethodLoad callback. These are VM implementation + * specific data structures that may evolve in future releases. A + * JVMTI agent should interpret a non-NULL compile_info as a pointer + * to a region of memory containing a list of records. In a typical + * usage scenario, a JVMTI agent would cast each record to a + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents + * arbitrary information. This struct contains a kind field to indicate + * the kind of information being passed, and a pointer to the next + * record. If the kind field indicates inlining information, then the + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. + * This record contains an array of PCStackInfo structs, which indicate + * for every pc address what are the methods on the invocation stack. + * The "methods" and "bcis" fields in each PCStackInfo struct specify a + * 1-1 mapping between these inlined methods and their bytecode indices. + * This can be used to derive the proper source lines of the inlined + * methods. + */ + +#ifndef _JVMTI_CMLR_H_ +#define _JVMTI_CMLR_H_ + +enum { + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, + + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, + JVMTI_CMLR_MINOR_VERSION = 0x00000000 + + /* + * This comment is for the "JDK import from HotSpot" sanity check: + * version: 1.0.0 + */ +}; + +typedef enum { + JVMTI_CMLR_DUMMY = 1, + JVMTI_CMLR_INLINE_INFO = 2 +} jvmtiCMLRKind; + +/* + * Record that represents arbitrary information passed through JVMTI + * CompiledMethodLoadEvent void pointer. + */ +typedef struct _jvmtiCompiledMethodLoadRecordHeader { + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ + jint majorinfoversion; /* major and minor info version values. Init'ed */ + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ + + struct _jvmtiCompiledMethodLoadRecordHeader* next; +} jvmtiCompiledMethodLoadRecordHeader; + +/* + * Record that gives information about the methods on the compile-time + * stack at a specific pc address of a compiled method. Each element in + * the methods array maps to same element in the bcis array. + */ +typedef struct _PCStackInfo { + void* pc; /* the pc address for this compiled method */ + jint numstackframes; /* number of methods on the stack */ + jmethodID* methods; /* array of numstackframes method ids */ + jint* bcis; /* array of numstackframes bytecode indices */ +} PCStackInfo; + +/* + * Record that contains inlining information for each pc address of + * an nmethod. + */ +typedef struct _jvmtiCompiledMethodLoadInlineRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + jint numpcs; /* number of pc descriptors in this nmethod */ + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ +} jvmtiCompiledMethodLoadInlineRecord; + +/* + * Dummy record used to test that we can pass records with different + * information through the void pointer provided that they can be cast + * to a jvmtiCompiledMethodLoadRecordHeader. + */ + +typedef struct _jvmtiCompiledMethodLoadDummyRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + char message[50]; +} jvmtiCompiledMethodLoadDummyRecord; + +#endif diff --git a/runtime/include/win32/bridge/AccessBridgeCallbacks.h b/runtime/include/win32/bridge/AccessBridgeCallbacks.h new file mode 100644 index 0000000..d2428b8 --- /dev/null +++ b/runtime/include/win32/bridge/AccessBridgeCallbacks.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * AccessBridgeCallbacks.h 1.17 05/03/21 + */ + +/* + * Header file defining callback typedefs for Windows routines + * which are called from Java (responding to events, etc.). + */ + +#ifndef __AccessBridgeCallbacks_H__ +#define __AccessBridgeCallbacks_H__ + +#include +#include "AccessBridgePackages.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*AccessBridge_PropertyChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + wchar_t *property, wchar_t *oldValue, wchar_t *newValue); + +typedef void (*AccessBridge_JavaShutdownFP) (long vmID); +typedef void (*AccessBridge_JavaShutdownFP) (long vmID); + +typedef void (*AccessBridge_FocusGainedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_FocusLostFP) (long vmID, JOBJECT64 event, JOBJECT64 source); + +typedef void (*AccessBridge_CaretUpdateFP) (long vmID, JOBJECT64 event, JOBJECT64 source); + +typedef void (*AccessBridge_MouseClickedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MouseEnteredFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MouseExitedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MousePressedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MouseReleasedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); + +typedef void (*AccessBridge_MenuCanceledFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MenuDeselectedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_MenuSelectedFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PopupMenuCanceledFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PopupMenuWillBecomeInvisibleFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PopupMenuWillBecomeVisibleFP) (long vmID, JOBJECT64 event, JOBJECT64 source); + +typedef void (*AccessBridge_PropertyNameChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + wchar_t *oldName, wchar_t *newName); +typedef void (*AccessBridge_PropertyDescriptionChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + wchar_t *oldDescription, wchar_t *newDescription); +typedef void (*AccessBridge_PropertyStateChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + wchar_t *oldState, wchar_t *newState); +typedef void (*AccessBridge_PropertyValueChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + wchar_t *oldValue, wchar_t *newValue); +typedef void (*AccessBridge_PropertySelectionChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PropertyTextChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PropertyCaretChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + int oldPosition, int newPosition); +typedef void (*AccessBridge_PropertyVisibleDataChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source); +typedef void (*AccessBridge_PropertyChildChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 source, + JOBJECT64 oldChild, JOBJECT64 newChild); +typedef void (*AccessBridge_PropertyActiveDescendentChangeFP) (long vmID, JOBJECT64 event, + JOBJECT64 source, + JOBJECT64 oldActiveDescendent, + JOBJECT64 newActiveDescendent); + +typedef void (*AccessBridge_PropertyTableModelChangeFP) (long vmID, JOBJECT64 event, JOBJECT64 src, + wchar_t *oldValue, wchar_t *newValue); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/runtime/include/win32/bridge/AccessBridgeCalls.c b/runtime/include/win32/bridge/AccessBridgeCalls.c new file mode 100644 index 0000000..70ab3ef --- /dev/null +++ b/runtime/include/win32/bridge/AccessBridgeCalls.c @@ -0,0 +1,1131 @@ +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @(#)AccessBridgeCalls.c 1.25 05/08/22 + */ + +/* + * Wrapper functions around calls to the AccessBridge DLL + */ + + +#include +#include + + +//#define ACCESSBRIDGE_32 +//#define ACCESSBRIDGE_64 + +#include "AccessBridgeCalls.h" +#include "AccessBridgeDebug.h" + +#ifdef __cplusplus +extern "C" { +#endif + + HINSTANCE theAccessBridgeInstance; + AccessBridgeFPs theAccessBridge; + + BOOL theAccessBridgeInitializedFlag = FALSE; + +#define LOAD_FP(result, type, name) \ + PrintDebugString("LOAD_FP loading: %s ...", name); \ + if ((theAccessBridge.result = \ + (type) GetProcAddress(theAccessBridgeInstance, name)) == (type) 0) { \ + PrintDebugString("LOAD_FP failed: %s", name); \ + return FALSE; \ + } + + BOOL initializeAccessBridge() { + +#ifdef ACCESSBRIDGE_ARCH_32 // For 32bit AT new bridge + theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-32"); +#else +#ifdef ACCESSBRIDGE_ARCH_64 // For 64bit AT new bridge + theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE-64"); +#else // legacy + theAccessBridgeInstance = LoadLibrary("WINDOWSACCESSBRIDGE"); +#endif +#endif + if (theAccessBridgeInstance != 0) { + LOAD_FP(Windows_run, Windows_runFP, "Windows_run"); + + LOAD_FP(SetJavaShutdown, SetJavaShutdownFP, "setJavaShutdownFP"); + LOAD_FP(SetFocusGained, SetFocusGainedFP, "setFocusGainedFP"); + LOAD_FP(SetFocusLost, SetFocusLostFP, "setFocusLostFP"); + + LOAD_FP(SetCaretUpdate, SetCaretUpdateFP, "setCaretUpdateFP"); + + LOAD_FP(SetMouseClicked, SetMouseClickedFP, "setMouseClickedFP"); + LOAD_FP(SetMouseEntered, SetMouseEnteredFP, "setMouseEnteredFP"); + LOAD_FP(SetMouseExited, SetMouseExitedFP, "setMouseExitedFP"); + LOAD_FP(SetMousePressed, SetMousePressedFP, "setMousePressedFP"); + LOAD_FP(SetMouseReleased, SetMouseReleasedFP, "setMouseReleasedFP"); + + LOAD_FP(SetMenuCanceled, SetMenuCanceledFP, "setMenuCanceledFP"); + LOAD_FP(SetMenuDeselected, SetMenuDeselectedFP, "setMenuDeselectedFP"); + LOAD_FP(SetMenuSelected, SetMenuSelectedFP, "setMenuSelectedFP"); + LOAD_FP(SetPopupMenuCanceled, SetPopupMenuCanceledFP, "setPopupMenuCanceledFP"); + LOAD_FP(SetPopupMenuWillBecomeInvisible, SetPopupMenuWillBecomeInvisibleFP, "setPopupMenuWillBecomeInvisibleFP"); + LOAD_FP(SetPopupMenuWillBecomeVisible, SetPopupMenuWillBecomeVisibleFP, "setPopupMenuWillBecomeVisibleFP"); + + LOAD_FP(SetPropertyNameChange, SetPropertyNameChangeFP, "setPropertyNameChangeFP"); + LOAD_FP(SetPropertyDescriptionChange, SetPropertyDescriptionChangeFP, "setPropertyDescriptionChangeFP"); + LOAD_FP(SetPropertyStateChange, SetPropertyStateChangeFP, "setPropertyStateChangeFP"); + LOAD_FP(SetPropertyValueChange, SetPropertyValueChangeFP, "setPropertyValueChangeFP"); + LOAD_FP(SetPropertySelectionChange, SetPropertySelectionChangeFP, "setPropertySelectionChangeFP"); + LOAD_FP(SetPropertyTextChange, SetPropertyTextChangeFP, "setPropertyTextChangeFP"); + LOAD_FP(SetPropertyCaretChange, SetPropertyCaretChangeFP, "setPropertyCaretChangeFP"); + LOAD_FP(SetPropertyVisibleDataChange, SetPropertyVisibleDataChangeFP, "setPropertyVisibleDataChangeFP"); + LOAD_FP(SetPropertyChildChange, SetPropertyChildChangeFP, "setPropertyChildChangeFP"); + LOAD_FP(SetPropertyActiveDescendentChange, SetPropertyActiveDescendentChangeFP, "setPropertyActiveDescendentChangeFP"); + + LOAD_FP(SetPropertyTableModelChange, SetPropertyTableModelChangeFP, "setPropertyTableModelChangeFP"); + + LOAD_FP(ReleaseJavaObject, ReleaseJavaObjectFP, "releaseJavaObject"); + LOAD_FP(GetVersionInfo, GetVersionInfoFP, "getVersionInfo"); + + LOAD_FP(IsJavaWindow, IsJavaWindowFP, "isJavaWindow"); + LOAD_FP(IsSameObject, IsSameObjectFP, "isSameObject"); + LOAD_FP(GetAccessibleContextFromHWND, GetAccessibleContextFromHWNDFP, "getAccessibleContextFromHWND"); + LOAD_FP(getHWNDFromAccessibleContext, getHWNDFromAccessibleContextFP, "getHWNDFromAccessibleContext"); + + LOAD_FP(GetAccessibleContextAt, GetAccessibleContextAtFP, "getAccessibleContextAt"); + LOAD_FP(GetAccessibleContextWithFocus, GetAccessibleContextWithFocusFP, "getAccessibleContextWithFocus"); + LOAD_FP(GetAccessibleContextInfo, GetAccessibleContextInfoFP, "getAccessibleContextInfo"); + LOAD_FP(GetAccessibleChildFromContext, GetAccessibleChildFromContextFP, "getAccessibleChildFromContext"); + LOAD_FP(GetAccessibleParentFromContext, GetAccessibleParentFromContextFP, "getAccessibleParentFromContext"); + + /* begin AccessibleTable */ + LOAD_FP(getAccessibleTableInfo, getAccessibleTableInfoFP, "getAccessibleTableInfo"); + LOAD_FP(getAccessibleTableCellInfo, getAccessibleTableCellInfoFP, "getAccessibleTableCellInfo"); + + LOAD_FP(getAccessibleTableRowHeader, getAccessibleTableRowHeaderFP, "getAccessibleTableRowHeader"); + LOAD_FP(getAccessibleTableColumnHeader, getAccessibleTableColumnHeaderFP, "getAccessibleTableColumnHeader"); + + LOAD_FP(getAccessibleTableRowDescription, getAccessibleTableRowDescriptionFP, "getAccessibleTableRowDescription"); + LOAD_FP(getAccessibleTableColumnDescription, getAccessibleTableColumnDescriptionFP, "getAccessibleTableColumnDescription"); + + LOAD_FP(getAccessibleTableRowSelectionCount, getAccessibleTableRowSelectionCountFP, + "getAccessibleTableRowSelectionCount"); + LOAD_FP(isAccessibleTableRowSelected, isAccessibleTableRowSelectedFP, + "isAccessibleTableRowSelected"); + LOAD_FP(getAccessibleTableRowSelections, getAccessibleTableRowSelectionsFP, + "getAccessibleTableRowSelections"); + + LOAD_FP(getAccessibleTableColumnSelectionCount, getAccessibleTableColumnSelectionCountFP, + "getAccessibleTableColumnSelectionCount"); + LOAD_FP(isAccessibleTableColumnSelected, isAccessibleTableColumnSelectedFP, + "isAccessibleTableColumnSelected"); + LOAD_FP(getAccessibleTableColumnSelections, getAccessibleTableColumnSelectionsFP, + "getAccessibleTableColumnSelections"); + + LOAD_FP(getAccessibleTableRow, getAccessibleTableRowFP, + "getAccessibleTableRow"); + LOAD_FP(getAccessibleTableColumn, getAccessibleTableColumnFP, + "getAccessibleTableColumn"); + LOAD_FP(getAccessibleTableIndex, getAccessibleTableIndexFP, + "getAccessibleTableIndex"); + + /* end AccessibleTable */ + + /* AccessibleRelationSet */ + LOAD_FP(getAccessibleRelationSet, getAccessibleRelationSetFP, "getAccessibleRelationSet"); + + /* AccessibleHypertext */ + LOAD_FP(getAccessibleHypertext, getAccessibleHypertextFP, "getAccessibleHypertext"); + LOAD_FP(activateAccessibleHyperlink, activateAccessibleHyperlinkFP, "activateAccessibleHyperlink"); + LOAD_FP(getAccessibleHyperlinkCount, getAccessibleHyperlinkCountFP, "getAccessibleHyperlinkCount"); + LOAD_FP(getAccessibleHypertextExt, getAccessibleHypertextExtFP, "getAccessibleHypertextExt"); + LOAD_FP(getAccessibleHypertextLinkIndex, getAccessibleHypertextLinkIndexFP, "getAccessibleHypertextLinkIndex"); + LOAD_FP(getAccessibleHyperlink, getAccessibleHyperlinkFP, "getAccessibleHyperlink"); + + /* Accessible KeyBinding, Icon and Action */ + LOAD_FP(getAccessibleKeyBindings, getAccessibleKeyBindingsFP, "getAccessibleKeyBindings"); + LOAD_FP(getAccessibleIcons, getAccessibleIconsFP, "getAccessibleIcons"); + LOAD_FP(getAccessibleActions, getAccessibleActionsFP, "getAccessibleActions"); + LOAD_FP(doAccessibleActions, doAccessibleActionsFP, "doAccessibleActions"); + + /* AccessibleText */ + LOAD_FP(GetAccessibleTextInfo, GetAccessibleTextInfoFP, "getAccessibleTextInfo"); + LOAD_FP(GetAccessibleTextItems, GetAccessibleTextItemsFP, "getAccessibleTextItems"); + LOAD_FP(GetAccessibleTextSelectionInfo, GetAccessibleTextSelectionInfoFP, "getAccessibleTextSelectionInfo"); + LOAD_FP(GetAccessibleTextAttributes, GetAccessibleTextAttributesFP, "getAccessibleTextAttributes"); + LOAD_FP(GetAccessibleTextRect, GetAccessibleTextRectFP, "getAccessibleTextRect"); + LOAD_FP(GetAccessibleTextLineBounds, GetAccessibleTextLineBoundsFP, "getAccessibleTextLineBounds"); + LOAD_FP(GetAccessibleTextRange, GetAccessibleTextRangeFP, "getAccessibleTextRange"); + + LOAD_FP(GetCurrentAccessibleValueFromContext, GetCurrentAccessibleValueFromContextFP, "getCurrentAccessibleValueFromContext"); + LOAD_FP(GetMaximumAccessibleValueFromContext, GetMaximumAccessibleValueFromContextFP, "getMaximumAccessibleValueFromContext"); + LOAD_FP(GetMinimumAccessibleValueFromContext, GetMinimumAccessibleValueFromContextFP, "getMinimumAccessibleValueFromContext"); + + LOAD_FP(AddAccessibleSelectionFromContext, AddAccessibleSelectionFromContextFP, "addAccessibleSelectionFromContext"); + LOAD_FP(ClearAccessibleSelectionFromContext, ClearAccessibleSelectionFromContextFP, "clearAccessibleSelectionFromContext"); + LOAD_FP(GetAccessibleSelectionFromContext, GetAccessibleSelectionFromContextFP, "getAccessibleSelectionFromContext"); + LOAD_FP(GetAccessibleSelectionCountFromContext, GetAccessibleSelectionCountFromContextFP, "getAccessibleSelectionCountFromContext"); + LOAD_FP(IsAccessibleChildSelectedFromContext, IsAccessibleChildSelectedFromContextFP, "isAccessibleChildSelectedFromContext"); + LOAD_FP(RemoveAccessibleSelectionFromContext, RemoveAccessibleSelectionFromContextFP, "removeAccessibleSelectionFromContext"); + LOAD_FP(SelectAllAccessibleSelectionFromContext, SelectAllAccessibleSelectionFromContextFP, "selectAllAccessibleSelectionFromContext"); + + LOAD_FP(setTextContents, setTextContentsFP, "setTextContents"); + LOAD_FP(getParentWithRole, getParentWithRoleFP, "getParentWithRole"); + LOAD_FP(getTopLevelObject, getTopLevelObjectFP, "getTopLevelObject"); + LOAD_FP(getParentWithRoleElseRoot, getParentWithRoleElseRootFP, "getParentWithRoleElseRoot"); + LOAD_FP(getObjectDepth, getObjectDepthFP, "getObjectDepth"); + LOAD_FP(getActiveDescendent, getActiveDescendentFP, "getActiveDescendent"); + + // additional methods for Teton + LOAD_FP(getVirtualAccessibleName, getVirtualAccessibleNameFP, "getVirtualAccessibleName"); + LOAD_FP(requestFocus, requestFocusFP, "requestFocus"); + LOAD_FP(selectTextRange, selectTextRangeFP, "selectTextRange"); + LOAD_FP(getTextAttributesInRange, getTextAttributesInRangeFP, "getTextAttributesInRange"); + LOAD_FP(getVisibleChildrenCount, getVisibleChildrenCountFP, "getVisibleChildrenCount"); + LOAD_FP(getVisibleChildren, getVisibleChildrenFP, "getVisibleChildren"); + LOAD_FP(setCaretPosition, setCaretPositionFP, "setCaretPosition"); + LOAD_FP(getCaretLocation, getCaretLocationFP, "getCaretLocation"); + + LOAD_FP(getEventsWaiting, getEventsWaitingFP, "getEventsWaiting"); + + theAccessBridge.Windows_run(); + + theAccessBridgeInitializedFlag = TRUE; + PrintDebugString("theAccessBridgeInitializedFlag = TRUE"); + return TRUE; + } else { + return FALSE; + } + } + + + BOOL shutdownAccessBridge() { + BOOL result; + DWORD error; + theAccessBridgeInitializedFlag = FALSE; + if (theAccessBridgeInstance != (HANDLE) 0) { + result = FreeLibrary(theAccessBridgeInstance); + if (result != TRUE) { + error = GetLastError(); + } + return TRUE; + } + return FALSE; + } + + + void SetJavaShutdown(AccessBridge_JavaShutdownFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetJavaShutdown(fp); + } + } + + void SetFocusGained(AccessBridge_FocusGainedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetFocusGained(fp); + } + } + + void SetFocusLost(AccessBridge_FocusLostFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetFocusLost(fp); + } + } + + + void SetCaretUpdate(AccessBridge_CaretUpdateFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetCaretUpdate(fp); + } + } + + + void SetMouseClicked(AccessBridge_MouseClickedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMouseClicked(fp); + } + } + + void SetMouseEntered(AccessBridge_MouseEnteredFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMouseEntered(fp); + } + } + + void SetMouseExited(AccessBridge_MouseExitedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMouseExited(fp); + } + } + + void SetMousePressed(AccessBridge_MousePressedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMousePressed(fp); + } + } + + void SetMouseReleased(AccessBridge_MouseReleasedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMouseReleased(fp); + } + } + + + void SetMenuCanceled(AccessBridge_MenuCanceledFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMenuCanceled(fp); + } + } + + void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMenuDeselected(fp); + } + } + + void SetMenuSelected(AccessBridge_MenuSelectedFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetMenuSelected(fp); + } + } + + void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPopupMenuCanceled(fp); + } + } + + void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPopupMenuWillBecomeInvisible(fp); + } + } + + void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPopupMenuWillBecomeVisible(fp); + } + } + + + void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyNameChange(fp); + } + } + + void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyDescriptionChange(fp); + } + } + + void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyStateChange(fp); + } + } + + void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyValueChange(fp); + } + } + + void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertySelectionChange(fp); + } + } + + void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyTextChange(fp); + } + } + + void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyCaretChange(fp); + } + } + + void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyVisibleDataChange(fp); + } + } + + void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyChildChange(fp); + } + } + + void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyActiveDescendentChange(fp); + } + } + + void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SetPropertyTableModelChange(fp); + } + } + + /** + * General routines + */ + void ReleaseJavaObject(long vmID, Java_Object object) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.ReleaseJavaObject(vmID, object); + } + } + + BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetVersionInfo(vmID, info); + } + return FALSE; + } + + + /** + * Window routines + */ + BOOL IsJavaWindow(HWND window) { + if (theAccessBridgeInitializedFlag == TRUE) { + BOOL ret ; + ret = theAccessBridge.IsJavaWindow(window); + return ret ; + + } + return FALSE; + } + + + /** + * Returns the virtual machine ID and AccessibleContext for a top-level window + */ + BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleContextFromHWND(target, vmID, ac); + } + return FALSE; + } + + /** + * Returns the HWND from the AccessibleContext of a top-level window. Returns 0 + * on error or if the AccessibleContext does not refer to a top-level window. + */ + HWND getHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getHWNDFromAccessibleContext(vmID, accesibleContext); + } + return (HWND)0; + } + + /** + * returns whether two objects are the same + */ + BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.IsSameObject(vmID, obj1, obj2); + } + return FALSE; + } + + /** + * Sets editable text contents. The AccessibleContext must implement AccessibleEditableText and + * be editable. The maximum text length is MAX_STRING_SIZE - 1. + * Returns whether successful + */ + BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.setTextContents(vmID, accessibleContext, text); + } + return FALSE; + } + + /** + * Returns the Accessible Context with the specified role that is the + * ancestor of a given object. The role is one of the role strings + * defined in AccessBridgePackages.h + * If there is no ancestor object that has the specified role, + * returns (AccessibleContext)0. + */ + AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext, + const wchar_t *role) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getParentWithRole(vmID, accessibleContext, role); + } + return (AccessibleContext)0; + } + + /** + * Returns the Accessible Context with the specified role that is the + * ancestor of a given object. The role is one of the role strings + * defined in AccessBridgePackages.h. If an object with the specified + * role does not exist, returns the top level object for the Java Window. + * Returns (AccessibleContext)0 on error. + */ + AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, + const wchar_t *role) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getParentWithRoleElseRoot(vmID, accessibleContext, role); + } + return (AccessibleContext)0; + } + + /** + * Returns the Accessible Context for the top level object in + * a Java Window. This is same Accessible Context that is obtained + * from GetAccessibleContextFromHWND for that window. Returns + * (AccessibleContext)0 on error. + */ + AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getTopLevelObject(vmID, accessibleContext); + } + return (AccessibleContext)0; + } + + /** + * Returns how deep in the object hierarchy a given object is. + * The top most object in the object hierarchy has an object depth of 0. + * Returns -1 on error. + */ + int getObjectDepth (const long vmID, const AccessibleContext accessibleContext) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getObjectDepth(vmID, accessibleContext); + } + return -1; + } + + /** + * Returns the Accessible Context of the current ActiveDescendent of an object. + * This method assumes the ActiveDescendent is the component that is currently + * selected in a container object. + * Returns (AccessibleContext)0 on error or if there is no selection. + */ + AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getActiveDescendent(vmID, accessibleContext); + } + return (AccessibleContext)0; + } + + + /** + * Accessible Context routines + */ + BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent, + jint x, jint y, AccessibleContext *ac) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleContextAt(vmID, acParent, x, y, ac); + } + return FALSE; + } + + BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleContextWithFocus(window, vmID, ac); + } + return FALSE; + } + + BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleContextInfo(vmID, ac, info); + } + return FALSE; + } + + AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleChildFromContext(vmID, ac, index); + } + return (AccessibleContext) 0; + } + + AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleParentFromContext(vmID, ac); + } + return (AccessibleContext) 0; + } + + /* begin AccessibleTable routines */ + + /* + * get information about an AccessibleTable + */ + BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableInfo(vmID, acParent, tableInfo); + } + return FALSE; + } + + /* + * get information about an AccessibleTable cell + */ + BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable, + jint row, jint column, AccessibleTableCellInfo *tableCellInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableCellInfo(vmID, accessibleTable, row, column, tableCellInfo); + } + return FALSE; + } + + /* + * get information about an AccessibleTable row header + */ + BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableRowHeader(vmID, acParent, tableInfo); + } + return FALSE; + } + + /* + * get information about an AccessibleTable column header + */ + BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableColumnHeader(vmID, acParent, tableInfo); + } + return FALSE; + } + + /* + * return a description of an AccessibleTable row header + */ + AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableRowDescription(vmID, acParent, row); + } + return (AccessibleContext)0; + } + + /* + * return a description of an AccessibleTable column header + */ + AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableColumnDescription(vmID, acParent, column); + } + return (AccessibleContext)0; + } + + /* + * return the number of rows selected in an AccessibleTable + */ + jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableRowSelectionCount(vmID, table); + } + return -1; + } + + /* + * return whether a row is selected in an AccessibleTable + */ + BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.isAccessibleTableRowSelected(vmID, table, row); + } + return FALSE; + } + + /* + * get an array of selected rows in an AccessibleTable + */ + BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableRowSelections(vmID, table, count, selections); + } + return FALSE; + } + + /* + * return the number of columns selected in an AccessibleTable + */ + jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableColumnSelectionCount(vmID, table); + } + return -1; + } + + /* + * return whether a column is selected in an AccessibleTable + */ + BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.isAccessibleTableColumnSelected(vmID, table, column); + } + return FALSE; + } + + /* + * get an array of columns selected in an AccessibleTable + */ + BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableColumnSelections(vmID, table, count, selections); + } + return FALSE; + } + + /* + * return the row number for a cell at a given index + */ + jint + getAccessibleTableRow(long vmID, AccessibleTable table, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableRow(vmID, table, index); + } + return -1; + } + + /* + * return the column number for a cell at a given index + */ + jint + getAccessibleTableColumn(long vmID, AccessibleTable table, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableColumn(vmID, table, index); + } + return -1; + } + + /* + * return the index of a cell at a given row and column + */ + jint + getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleTableIndex(vmID, table, row, column); + } + return -1; + } + + /* end AccessibleTable routines */ + + + /** + * Accessible Text routines + */ + BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextInfo(vmID, at, textInfo, x, y); + } + return FALSE; + } + + BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextItems(vmID, at, textItems, index); + } + return FALSE; + } + + BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextSelectionInfo(vmID, at, textSelection); + } + return FALSE; + } + + BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextAttributes(vmID, at, index, attributes); + } + return FALSE; + } + + BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextRect(vmID, at, rectInfo, index); + } + return FALSE; + } + + BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextLineBounds(vmID, at, index, startIndex, endIndex); + } + return FALSE; + } + + BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleTextRange(vmID, at, start, end, text, len); + } + return FALSE; + } + + /** + * AccessibleRelationSet routines + */ + BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext, + AccessibleRelationSetInfo *relationSetInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleRelationSet(vmID, accessibleContext, relationSetInfo); + } + return FALSE; + } + + /** + * AccessibleHypertext routines + */ + + // Gets AccessibleHypertext for an AccessibleContext + BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext, + AccessibleHypertextInfo *hypertextInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleHypertext(vmID, accessibleContext, hypertextInfo); + } + return FALSE; + } + + // Activates an AccessibleHyperlink for an AccessibleContext + BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext, + AccessibleHyperlink accessibleHyperlink) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.activateAccessibleHyperlink(vmID, accessibleContext, accessibleHyperlink); + } + return FALSE; + } + + /* + * Returns the number of hyperlinks in a component + * Maps to AccessibleHypertext.getLinkCount. + * Returns -1 on error. + */ + jint getAccessibleHyperlinkCount(const long vmID, + const AccessibleContext accessibleContext) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleHyperlinkCount(vmID, accessibleContext); + } + return -1; + } + + /* + * This method is used to iterate through the hyperlinks in a component. It + * returns hypertext information for a component starting at hyperlink index + * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will + * be returned for each call to this method. + * returns FALSE on error. + */ + BOOL getAccessibleHypertextExt(const long vmID, + const AccessibleContext accessibleContext, + const jint nStartIndex, + /* OUT */ AccessibleHypertextInfo *hypertextInfo) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleHypertextExt(vmID, + accessibleContext, + nStartIndex, + hypertextInfo); + } + return FALSE; + } + + /* + * Returns the index into an array of hyperlinks that is associated with + * a character index in document; + * Maps to AccessibleHypertext.getLinkIndex. + * Returns -1 on error. + */ + jint getAccessibleHypertextLinkIndex(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleHypertextLinkIndex(vmID, + hypertext, + nIndex); + } + return -1; + } + + /* + * Returns the nth hyperlink in a document. + * Maps to AccessibleHypertext.getLink. + * Returns -1 on error + */ + BOOL getAccessibleHyperlink(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex, + /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo) { + + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleHyperlink(vmID, + hypertext, + nIndex, + hyperlinkInfo); + } + return FALSE; + } + + + /* Accessible KeyBindings, Icons and Actions */ + BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext, + AccessibleKeyBindings *keyBindings) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleKeyBindings(vmID, accessibleContext, keyBindings); + } + return FALSE; + } + + BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext, + AccessibleIcons *icons) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleIcons(vmID, accessibleContext, icons); + } + return FALSE; + } + + BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext, + AccessibleActions *actions) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getAccessibleActions(vmID, accessibleContext, actions); + } + return FALSE; + } + + BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext, + AccessibleActionsToDo *actionsToDo, jint *failure) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.doAccessibleActions(vmID, accessibleContext, actionsToDo, failure); + } + return FALSE; + } + + /** + * Accessible Value routines + */ + BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetCurrentAccessibleValueFromContext(vmID, av, value, len); + } + return FALSE; + } + + BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetMaximumAccessibleValueFromContext(vmID, av, value, len); + } + return FALSE; + } + + BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetMinimumAccessibleValueFromContext(vmID, av, value, len); + } + return FALSE; + } + + + /** + * Accessible Selection routines + */ + void addAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.AddAccessibleSelectionFromContext(vmID, as, i); + } + } + + void clearAccessibleSelectionFromContext(long vmID, AccessibleSelection as) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.ClearAccessibleSelectionFromContext(vmID, as); + } + } + + JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleSelectionFromContext(vmID, as, i); + } + return (JOBJECT64) 0; + } + + int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.GetAccessibleSelectionCountFromContext(vmID, as); + } + return -1; + } + + BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.IsAccessibleChildSelectedFromContext(vmID, as, i); + } + return FALSE; + } + + void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.RemoveAccessibleSelectionFromContext(vmID, as, i); + } + } + + void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as) { + if (theAccessBridgeInitializedFlag == TRUE) { + theAccessBridge.SelectAllAccessibleSelectionFromContext(vmID, as); + } + } + + /** + * Additional methods for Teton + */ + + /** + * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns + * whether successful. + * + * Bug ID 4916682 - Implement JAWS AccessibleName policy + */ + BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext, + wchar_t *name, int len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getVirtualAccessibleName(vmID, accessibleContext, name, len); + } + return FALSE; + } + + /** + * Request focus for a component. Returns whether successful; + * + * Bug ID 4944757 - requestFocus method needed + */ + BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.requestFocus(vmID, accessibleContext); + } + return FALSE; + } + + /** + * Selects text between two indices. Selection includes the text at the start index + * and the text at the end index. Returns whether successful; + * + * Bug ID 4944758 - selectTextRange method needed + */ + BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext, + const int startIndex, const int endIndex) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.selectTextRange(vmID, accessibleContext, startIndex, endIndex); + } + return FALSE; + } + + /** + * Get text attributes between two indices. The attribute list includes the text at the + * start index and the text at the end index. Returns whether successful; + * + * Bug ID 4944761 - getTextAttributes between two indices method needed + */ + BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext, + const int startIndex, const int endIndex, + AccessibleTextAttributesInfo *attributes, short *len) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getTextAttributesInRange(vmID, accessibleContext, startIndex, + endIndex, attributes, len); + } + return FALSE; + } + + /** + * Returns the number of visible children of a component. Returns -1 on error. + * + * Bug ID 4944762- getVisibleChildren for list-like components needed + */ + int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getVisibleChildrenCount(vmID, accessibleContext); + } + return FALSE; + } + + /** + * Gets the visible children of an AccessibleContext. Returns whether successful; + * + * Bug ID 4944762- getVisibleChildren for list-like components needed + */ + BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext, + const int startIndex, VisibleChildrenInfo *visibleChildrenInfo) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getVisibleChildren(vmID, accessibleContext, startIndex, + visibleChildrenInfo); + } + return FALSE; + } + + /** + * Set the caret to a text position. Returns whether successful; + * + * Bug ID 4944770 - setCaretPosition method needed + */ + BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext, + const int position) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.setCaretPosition(vmID, accessibleContext, position); + } + return FALSE; + } + + /** + * Gets the text caret location + */ + BOOL getCaretLocation(long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index) { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getCaretLocation(vmID, ac, rectInfo, index); + } + return FALSE; + } + + /** + * Gets the number of events waiting to fire + */ + int getEventsWaiting() { + if (theAccessBridgeInitializedFlag == TRUE) { + return theAccessBridge.getEventsWaiting(); + } + return FALSE; + } + +#ifdef __cplusplus +} +#endif diff --git a/runtime/include/win32/bridge/AccessBridgeCalls.h b/runtime/include/win32/bridge/AccessBridgeCalls.h new file mode 100644 index 0000000..7ee7c3a --- /dev/null +++ b/runtime/include/win32/bridge/AccessBridgeCalls.h @@ -0,0 +1,706 @@ +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Wrapper functions around calls to the AccessBridge DLL + */ + +#include +#include +#include "AccessBridgeCallbacks.h" +#include "AccessBridgePackages.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define null NULL + + typedef JOBJECT64 AccessibleContext; + typedef JOBJECT64 AccessibleText; + typedef JOBJECT64 AccessibleValue; + typedef JOBJECT64 AccessibleSelection; + typedef JOBJECT64 Java_Object; + typedef JOBJECT64 PropertyChangeEvent; + typedef JOBJECT64 FocusEvent; + typedef JOBJECT64 CaretEvent; + typedef JOBJECT64 MouseEvent; + typedef JOBJECT64 MenuEvent; + typedef JOBJECT64 AccessibleTable; + typedef JOBJECT64 AccessibleHyperlink; + typedef JOBJECT64 AccessibleHypertext; + + + typedef void (*Windows_runFP) (); + + typedef void (*SetPropertyChangeFP) (AccessBridge_PropertyChangeFP fp); + + typedef void (*SetJavaShutdownFP) (AccessBridge_JavaShutdownFP fp); + typedef void (*SetFocusGainedFP) (AccessBridge_FocusGainedFP fp); + typedef void (*SetFocusLostFP) (AccessBridge_FocusLostFP fp); + + typedef void (*SetCaretUpdateFP) (AccessBridge_CaretUpdateFP fp); + + typedef void (*SetMouseClickedFP) (AccessBridge_MouseClickedFP fp); + typedef void (*SetMouseEnteredFP) (AccessBridge_MouseEnteredFP fp); + typedef void (*SetMouseExitedFP) (AccessBridge_MouseExitedFP fp); + typedef void (*SetMousePressedFP) (AccessBridge_MousePressedFP fp); + typedef void (*SetMouseReleasedFP) (AccessBridge_MouseReleasedFP fp); + + typedef void (*SetMenuCanceledFP) (AccessBridge_MenuCanceledFP fp); + typedef void (*SetMenuDeselectedFP) (AccessBridge_MenuDeselectedFP fp); + typedef void (*SetMenuSelectedFP) (AccessBridge_MenuSelectedFP fp); + typedef void (*SetPopupMenuCanceledFP) (AccessBridge_PopupMenuCanceledFP fp); + typedef void (*SetPopupMenuWillBecomeInvisibleFP) (AccessBridge_PopupMenuWillBecomeInvisibleFP fp); + typedef void (*SetPopupMenuWillBecomeVisibleFP) (AccessBridge_PopupMenuWillBecomeVisibleFP fp); + + typedef void (*SetPropertyNameChangeFP) (AccessBridge_PropertyNameChangeFP fp); + typedef void (*SetPropertyDescriptionChangeFP) (AccessBridge_PropertyDescriptionChangeFP fp); + typedef void (*SetPropertyStateChangeFP) (AccessBridge_PropertyStateChangeFP fp); + typedef void (*SetPropertyValueChangeFP) (AccessBridge_PropertyValueChangeFP fp); + typedef void (*SetPropertySelectionChangeFP) (AccessBridge_PropertySelectionChangeFP fp); + typedef void (*SetPropertyTextChangeFP) (AccessBridge_PropertyTextChangeFP fp); + typedef void (*SetPropertyCaretChangeFP) (AccessBridge_PropertyCaretChangeFP fp); + typedef void (*SetPropertyVisibleDataChangeFP) (AccessBridge_PropertyVisibleDataChangeFP fp); + typedef void (*SetPropertyChildChangeFP) (AccessBridge_PropertyChildChangeFP fp); + typedef void (*SetPropertyActiveDescendentChangeFP) (AccessBridge_PropertyActiveDescendentChangeFP fp); + + typedef void (*SetPropertyTableModelChangeFP) (AccessBridge_PropertyTableModelChangeFP fp); + + typedef void (*ReleaseJavaObjectFP) (long vmID, Java_Object object); + + typedef BOOL (*GetVersionInfoFP) (long vmID, AccessBridgeVersionInfo *info); + + typedef BOOL (*IsJavaWindowFP) (HWND window); + typedef BOOL (*IsSameObjectFP) (long vmID, JOBJECT64 obj1, JOBJECT64 obj2); + typedef BOOL (*GetAccessibleContextFromHWNDFP) (HWND window, long *vmID, AccessibleContext *ac); + typedef HWND (*getHWNDFromAccessibleContextFP) (long vmID, AccessibleContext ac); + + typedef BOOL (*GetAccessibleContextAtFP) (long vmID, AccessibleContext acParent, + jint x, jint y, AccessibleContext *ac); + typedef BOOL (*GetAccessibleContextWithFocusFP) (HWND window, long *vmID, AccessibleContext *ac); + typedef BOOL (*GetAccessibleContextInfoFP) (long vmID, AccessibleContext ac, AccessibleContextInfo *info); + typedef AccessibleContext (*GetAccessibleChildFromContextFP) (long vmID, AccessibleContext ac, jint i); + typedef AccessibleContext (*GetAccessibleParentFromContextFP) (long vmID, AccessibleContext ac); + + /* begin AccessibleTable */ + typedef BOOL (*getAccessibleTableInfoFP) (long vmID, AccessibleContext ac, AccessibleTableInfo *tableInfo); + typedef BOOL (*getAccessibleTableCellInfoFP) (long vmID, AccessibleTable accessibleTable, + jint row, jint column, AccessibleTableCellInfo *tableCellInfo); + + typedef BOOL (*getAccessibleTableRowHeaderFP) (long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo); + typedef BOOL (*getAccessibleTableColumnHeaderFP) (long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo); + + typedef AccessibleContext (*getAccessibleTableRowDescriptionFP) (long vmID, AccessibleContext acParent, jint row); + typedef AccessibleContext (*getAccessibleTableColumnDescriptionFP) (long vmID, AccessibleContext acParent, jint column); + + typedef jint (*getAccessibleTableRowSelectionCountFP) (long vmID, AccessibleTable table); + typedef BOOL (*isAccessibleTableRowSelectedFP) (long vmID, AccessibleTable table, jint row); + typedef BOOL (*getAccessibleTableRowSelectionsFP) (long vmID, AccessibleTable table, jint count, + jint *selections); + + typedef jint (*getAccessibleTableColumnSelectionCountFP) (long vmID, AccessibleTable table); + typedef BOOL (*isAccessibleTableColumnSelectedFP) (long vmID, AccessibleTable table, jint column); + typedef BOOL (*getAccessibleTableColumnSelectionsFP) (long vmID, AccessibleTable table, jint count, + jint *selections); + + typedef jint (*getAccessibleTableRowFP) (long vmID, AccessibleTable table, jint index); + typedef jint (*getAccessibleTableColumnFP) (long vmID, AccessibleTable table, jint index); + typedef jint (*getAccessibleTableIndexFP) (long vmID, AccessibleTable table, jint row, jint column); + /* end AccessibleTable */ + + /* AccessibleRelationSet */ + typedef BOOL (*getAccessibleRelationSetFP) (long vmID, AccessibleContext accessibleContext, + AccessibleRelationSetInfo *relationSetInfo); + + /* AccessibleHypertext */ + typedef BOOL (*getAccessibleHypertextFP)(long vmID, AccessibleContext accessibleContext, + AccessibleHypertextInfo *hypertextInfo); + + typedef BOOL (*activateAccessibleHyperlinkFP)(long vmID, AccessibleContext accessibleContext, + AccessibleHyperlink accessibleHyperlink); + + typedef jint (*getAccessibleHyperlinkCountFP)(const long vmID, + const AccessibleContext accessibleContext); + + typedef BOOL (*getAccessibleHypertextExtFP) (const long vmID, + const AccessibleContext accessibleContext, + const jint nStartIndex, + AccessibleHypertextInfo *hypertextInfo); + + typedef jint (*getAccessibleHypertextLinkIndexFP)(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex); + + typedef BOOL (*getAccessibleHyperlinkFP)(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex, + AccessibleHyperlinkInfo *hyperlinkInfo); + + + /* Accessible KeyBindings, Icons and Actions */ + typedef BOOL (*getAccessibleKeyBindingsFP)(long vmID, AccessibleContext accessibleContext, + AccessibleKeyBindings *keyBindings); + + typedef BOOL (*getAccessibleIconsFP)(long vmID, AccessibleContext accessibleContext, + AccessibleIcons *icons); + + typedef BOOL (*getAccessibleActionsFP)(long vmID, AccessibleContext accessibleContext, + AccessibleActions *actions); + + typedef BOOL (*doAccessibleActionsFP)(long vmID, AccessibleContext accessibleContext, + AccessibleActionsToDo *actionsToDo, jint *failure); + + + /* AccessibleText */ + + typedef BOOL (*GetAccessibleTextInfoFP) (long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y); + typedef BOOL (*GetAccessibleTextItemsFP) (long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index); + typedef BOOL (*GetAccessibleTextSelectionInfoFP) (long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection); + typedef BOOL (*GetAccessibleTextAttributesFP) (long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes); + typedef BOOL (*GetAccessibleTextRectFP) (long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index); + typedef BOOL (*GetAccessibleTextLineBoundsFP) (long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex); + typedef BOOL (*GetAccessibleTextRangeFP) (long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len); + + typedef BOOL (*GetCurrentAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len); + typedef BOOL (*GetMaximumAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len); + typedef BOOL (*GetMinimumAccessibleValueFromContextFP) (long vmID, AccessibleValue av, wchar_t *value, short len); + + typedef void (*AddAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i); + typedef void (*ClearAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as); + typedef JOBJECT64 (*GetAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i); + typedef int (*GetAccessibleSelectionCountFromContextFP) (long vmID, AccessibleSelection as); + typedef BOOL (*IsAccessibleChildSelectedFromContextFP) (long vmID, AccessibleSelection as, int i); + typedef void (*RemoveAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as, int i); + typedef void (*SelectAllAccessibleSelectionFromContextFP) (long vmID, AccessibleSelection as); + + /* Utility methods */ + + typedef BOOL (*setTextContentsFP) (const long vmID, const AccessibleContext ac, const wchar_t *text); + typedef AccessibleContext (*getParentWithRoleFP) (const long vmID, const AccessibleContext ac, const wchar_t *role); + typedef AccessibleContext (*getParentWithRoleElseRootFP) (const long vmID, const AccessibleContext ac, const wchar_t *role); + typedef AccessibleContext (*getTopLevelObjectFP) (const long vmID, const AccessibleContext ac); + typedef int (*getObjectDepthFP) (const long vmID, const AccessibleContext ac); + typedef AccessibleContext (*getActiveDescendentFP) (const long vmID, const AccessibleContext ac); + + + typedef BOOL (*getVirtualAccessibleNameFP) (const long vmID, const AccessibleContext accessibleContext, + wchar_t *name, int len); + + typedef BOOL (*requestFocusFP) (const long vmID, const AccessibleContext accessibleContext); + + typedef BOOL (*selectTextRangeFP) (const long vmID, const AccessibleContext accessibleContext, + const int startIndex, const int endIndex); + + typedef BOOL (*getTextAttributesInRangeFP) (const long vmID, const AccessibleContext accessibleContext, + const int startIndex, const int endIndex, + AccessibleTextAttributesInfo *attributes, short *len); + + typedef int (*getVisibleChildrenCountFP) (const long vmID, const AccessibleContext accessibleContext); + + typedef BOOL (*getVisibleChildrenFP) (const long vmID, const AccessibleContext accessibleContext, + const int startIndex, VisibleChildrenInfo *children); + + typedef BOOL (*setCaretPositionFP) (const long vmID, const AccessibleContext accessibleContext, const int position); + + typedef BOOL (*getCaretLocationFP) (long vmID, AccessibleContext ac, AccessibleTextRectInfo *rectInfo, jint index); + + typedef int (*getEventsWaitingFP) (); + + typedef struct AccessBridgeFPsTag { + Windows_runFP Windows_run; + + SetPropertyChangeFP SetPropertyChange; + + SetJavaShutdownFP SetJavaShutdown; + SetFocusGainedFP SetFocusGained; + SetFocusLostFP SetFocusLost; + + SetCaretUpdateFP SetCaretUpdate; + + SetMouseClickedFP SetMouseClicked; + SetMouseEnteredFP SetMouseEntered; + SetMouseExitedFP SetMouseExited; + SetMousePressedFP SetMousePressed; + SetMouseReleasedFP SetMouseReleased; + + SetMenuCanceledFP SetMenuCanceled; + SetMenuDeselectedFP SetMenuDeselected; + SetMenuSelectedFP SetMenuSelected; + SetPopupMenuCanceledFP SetPopupMenuCanceled; + SetPopupMenuWillBecomeInvisibleFP SetPopupMenuWillBecomeInvisible; + SetPopupMenuWillBecomeVisibleFP SetPopupMenuWillBecomeVisible; + + SetPropertyNameChangeFP SetPropertyNameChange; + SetPropertyDescriptionChangeFP SetPropertyDescriptionChange; + SetPropertyStateChangeFP SetPropertyStateChange; + SetPropertyValueChangeFP SetPropertyValueChange; + SetPropertySelectionChangeFP SetPropertySelectionChange; + SetPropertyTextChangeFP SetPropertyTextChange; + SetPropertyCaretChangeFP SetPropertyCaretChange; + SetPropertyVisibleDataChangeFP SetPropertyVisibleDataChange; + SetPropertyChildChangeFP SetPropertyChildChange; + SetPropertyActiveDescendentChangeFP SetPropertyActiveDescendentChange; + + SetPropertyTableModelChangeFP SetPropertyTableModelChange; + + ReleaseJavaObjectFP ReleaseJavaObject; + GetVersionInfoFP GetVersionInfo; + + IsJavaWindowFP IsJavaWindow; + IsSameObjectFP IsSameObject; + GetAccessibleContextFromHWNDFP GetAccessibleContextFromHWND; + getHWNDFromAccessibleContextFP getHWNDFromAccessibleContext; + + GetAccessibleContextAtFP GetAccessibleContextAt; + GetAccessibleContextWithFocusFP GetAccessibleContextWithFocus; + GetAccessibleContextInfoFP GetAccessibleContextInfo; + GetAccessibleChildFromContextFP GetAccessibleChildFromContext; + GetAccessibleParentFromContextFP GetAccessibleParentFromContext; + + getAccessibleTableInfoFP getAccessibleTableInfo; + getAccessibleTableCellInfoFP getAccessibleTableCellInfo; + + getAccessibleTableRowHeaderFP getAccessibleTableRowHeader; + getAccessibleTableColumnHeaderFP getAccessibleTableColumnHeader; + + getAccessibleTableRowDescriptionFP getAccessibleTableRowDescription; + getAccessibleTableColumnDescriptionFP getAccessibleTableColumnDescription; + + getAccessibleTableRowSelectionCountFP getAccessibleTableRowSelectionCount; + isAccessibleTableRowSelectedFP isAccessibleTableRowSelected; + getAccessibleTableRowSelectionsFP getAccessibleTableRowSelections; + + getAccessibleTableColumnSelectionCountFP getAccessibleTableColumnSelectionCount; + isAccessibleTableColumnSelectedFP isAccessibleTableColumnSelected; + getAccessibleTableColumnSelectionsFP getAccessibleTableColumnSelections; + + getAccessibleTableRowFP getAccessibleTableRow; + getAccessibleTableColumnFP getAccessibleTableColumn; + getAccessibleTableIndexFP getAccessibleTableIndex; + + getAccessibleRelationSetFP getAccessibleRelationSet; + + getAccessibleHypertextFP getAccessibleHypertext; + activateAccessibleHyperlinkFP activateAccessibleHyperlink; + getAccessibleHyperlinkCountFP getAccessibleHyperlinkCount; + getAccessibleHypertextExtFP getAccessibleHypertextExt; + getAccessibleHypertextLinkIndexFP getAccessibleHypertextLinkIndex; + getAccessibleHyperlinkFP getAccessibleHyperlink; + + getAccessibleKeyBindingsFP getAccessibleKeyBindings; + getAccessibleIconsFP getAccessibleIcons; + getAccessibleActionsFP getAccessibleActions; + doAccessibleActionsFP doAccessibleActions; + + GetAccessibleTextInfoFP GetAccessibleTextInfo; + GetAccessibleTextItemsFP GetAccessibleTextItems; + GetAccessibleTextSelectionInfoFP GetAccessibleTextSelectionInfo; + GetAccessibleTextAttributesFP GetAccessibleTextAttributes; + GetAccessibleTextRectFP GetAccessibleTextRect; + GetAccessibleTextLineBoundsFP GetAccessibleTextLineBounds; + GetAccessibleTextRangeFP GetAccessibleTextRange; + + GetCurrentAccessibleValueFromContextFP GetCurrentAccessibleValueFromContext; + GetMaximumAccessibleValueFromContextFP GetMaximumAccessibleValueFromContext; + GetMinimumAccessibleValueFromContextFP GetMinimumAccessibleValueFromContext; + + AddAccessibleSelectionFromContextFP AddAccessibleSelectionFromContext; + ClearAccessibleSelectionFromContextFP ClearAccessibleSelectionFromContext; + GetAccessibleSelectionFromContextFP GetAccessibleSelectionFromContext; + GetAccessibleSelectionCountFromContextFP GetAccessibleSelectionCountFromContext; + IsAccessibleChildSelectedFromContextFP IsAccessibleChildSelectedFromContext; + RemoveAccessibleSelectionFromContextFP RemoveAccessibleSelectionFromContext; + SelectAllAccessibleSelectionFromContextFP SelectAllAccessibleSelectionFromContext; + + setTextContentsFP setTextContents; + getParentWithRoleFP getParentWithRole; + getTopLevelObjectFP getTopLevelObject; + getParentWithRoleElseRootFP getParentWithRoleElseRoot; + getObjectDepthFP getObjectDepth; + getActiveDescendentFP getActiveDescendent; + + getVirtualAccessibleNameFP getVirtualAccessibleName; + requestFocusFP requestFocus; + selectTextRangeFP selectTextRange; + getTextAttributesInRangeFP getTextAttributesInRange; + getVisibleChildrenCountFP getVisibleChildrenCount; + getVisibleChildrenFP getVisibleChildren; + setCaretPositionFP setCaretPosition; + getCaretLocationFP getCaretLocation; + + getEventsWaitingFP getEventsWaiting; + + } AccessBridgeFPs; + + + /** + * Initialize the world + */ + BOOL initializeAccessBridge(); + BOOL shutdownAccessBridge(); + + /** + * Window routines + */ + BOOL IsJavaWindow(HWND window); + + // Returns the virtual machine ID and AccessibleContext for a top-level window + BOOL GetAccessibleContextFromHWND(HWND target, long *vmID, AccessibleContext *ac); + + // Returns the HWND from the AccessibleContext of a top-level window + HWND getHWNDFromAccessibleContext(long vmID, AccessibleContext ac); + + + /** + * Event handling routines + */ + void SetJavaShutdown(AccessBridge_JavaShutdownFP fp); + void SetFocusGained(AccessBridge_FocusGainedFP fp); + void SetFocusLost(AccessBridge_FocusLostFP fp); + + void SetCaretUpdate(AccessBridge_CaretUpdateFP fp); + + void SetMouseClicked(AccessBridge_MouseClickedFP fp); + void SetMouseEntered(AccessBridge_MouseEnteredFP fp); + void SetMouseExited(AccessBridge_MouseExitedFP fp); + void SetMousePressed(AccessBridge_MousePressedFP fp); + void SetMouseReleased(AccessBridge_MouseReleasedFP fp); + + void SetMenuCanceled(AccessBridge_MenuCanceledFP fp); + void SetMenuDeselected(AccessBridge_MenuDeselectedFP fp); + void SetMenuSelected(AccessBridge_MenuSelectedFP fp); + void SetPopupMenuCanceled(AccessBridge_PopupMenuCanceledFP fp); + void SetPopupMenuWillBecomeInvisible(AccessBridge_PopupMenuWillBecomeInvisibleFP fp); + void SetPopupMenuWillBecomeVisible(AccessBridge_PopupMenuWillBecomeVisibleFP fp); + + void SetPropertyNameChange(AccessBridge_PropertyNameChangeFP fp); + void SetPropertyDescriptionChange(AccessBridge_PropertyDescriptionChangeFP fp); + void SetPropertyStateChange(AccessBridge_PropertyStateChangeFP fp); + void SetPropertyValueChange(AccessBridge_PropertyValueChangeFP fp); + void SetPropertySelectionChange(AccessBridge_PropertySelectionChangeFP fp); + void SetPropertyTextChange(AccessBridge_PropertyTextChangeFP fp); + void SetPropertyCaretChange(AccessBridge_PropertyCaretChangeFP fp); + void SetPropertyVisibleDataChange(AccessBridge_PropertyVisibleDataChangeFP fp); + void SetPropertyChildChange(AccessBridge_PropertyChildChangeFP fp); + void SetPropertyActiveDescendentChange(AccessBridge_PropertyActiveDescendentChangeFP fp); + + void SetPropertyTableModelChange(AccessBridge_PropertyTableModelChangeFP fp); + + + /** + * General routines + */ + void ReleaseJavaObject(long vmID, Java_Object object); + BOOL GetVersionInfo(long vmID, AccessBridgeVersionInfo *info); + HWND GetHWNDFromAccessibleContext(long vmID, JOBJECT64 accesibleContext); + + /** + * Accessible Context routines + */ + BOOL GetAccessibleContextAt(long vmID, AccessibleContext acParent, + jint x, jint y, AccessibleContext *ac); + BOOL GetAccessibleContextWithFocus(HWND window, long *vmID, AccessibleContext *ac); + BOOL GetAccessibleContextInfo(long vmID, AccessibleContext ac, AccessibleContextInfo *info); + AccessibleContext GetAccessibleChildFromContext(long vmID, AccessibleContext ac, jint index); + AccessibleContext GetAccessibleParentFromContext(long vmID, AccessibleContext ac); + + /** + * Accessible Text routines + */ + BOOL GetAccessibleTextInfo(long vmID, AccessibleText at, AccessibleTextInfo *textInfo, jint x, jint y); + BOOL GetAccessibleTextItems(long vmID, AccessibleText at, AccessibleTextItemsInfo *textItems, jint index); + BOOL GetAccessibleTextSelectionInfo(long vmID, AccessibleText at, AccessibleTextSelectionInfo *textSelection); + BOOL GetAccessibleTextAttributes(long vmID, AccessibleText at, jint index, AccessibleTextAttributesInfo *attributes); + BOOL GetAccessibleTextRect(long vmID, AccessibleText at, AccessibleTextRectInfo *rectInfo, jint index); + BOOL GetAccessibleTextLineBounds(long vmID, AccessibleText at, jint index, jint *startIndex, jint *endIndex); + BOOL GetAccessibleTextRange(long vmID, AccessibleText at, jint start, jint end, wchar_t *text, short len); + + /* begin AccessibleTable routines */ + BOOL getAccessibleTableInfo(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo); + + BOOL getAccessibleTableCellInfo(long vmID, AccessibleTable accessibleTable, jint row, jint column, + AccessibleTableCellInfo *tableCellInfo); + + BOOL getAccessibleTableRowHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo); + BOOL getAccessibleTableColumnHeader(long vmID, AccessibleContext acParent, AccessibleTableInfo *tableInfo); + + AccessibleContext getAccessibleTableRowDescription(long vmID, AccessibleContext acParent, jint row); + AccessibleContext getAccessibleTableColumnDescription(long vmID, AccessibleContext acParent, jint column); + + jint getAccessibleTableRowSelectionCount(long vmID, AccessibleTable table); + BOOL isAccessibleTableRowSelected(long vmID, AccessibleTable table, jint row); + BOOL getAccessibleTableRowSelections(long vmID, AccessibleTable table, jint count, jint *selections); + + jint getAccessibleTableColumnSelectionCount(long vmID, AccessibleTable table); + BOOL isAccessibleTableColumnSelected(long vmID, AccessibleTable table, jint column); + BOOL getAccessibleTableColumnSelections(long vmID, AccessibleTable table, jint count, jint *selections); + + jint getAccessibleTableRow(long vmID, AccessibleTable table, jint index); + jint getAccessibleTableColumn(long vmID, AccessibleTable table, jint index); + jint getAccessibleTableIndex(long vmID, AccessibleTable table, jint row, jint column); + /* end AccessibleTable */ + + /* ----- AccessibleRelationSet routines */ + BOOL getAccessibleRelationSet(long vmID, AccessibleContext accessibleContext, + AccessibleRelationSetInfo *relationSetInfo); + + /* ----- AccessibleHypertext routines */ + + /* + * Returns hypertext information associated with a component. + */ + BOOL getAccessibleHypertext(long vmID, AccessibleContext accessibleContext, + AccessibleHypertextInfo *hypertextInfo); + + /* + * Requests that a hyperlink be activated. + */ + BOOL activateAccessibleHyperlink(long vmID, AccessibleContext accessibleContext, + AccessibleHyperlink accessibleHyperlink); + + /* + * Returns the number of hyperlinks in a component + * Maps to AccessibleHypertext.getLinkCount. + * Returns -1 on error. + */ + jint getAccessibleHyperlinkCount(const long vmID, + const AccessibleHypertext hypertext); + + /* + * This method is used to iterate through the hyperlinks in a component. It + * returns hypertext information for a component starting at hyperlink index + * nStartIndex. No more than MAX_HYPERLINKS AccessibleHypertextInfo objects will + * be returned for each call to this method. + * Returns FALSE on error. + */ + BOOL getAccessibleHypertextExt(const long vmID, + const AccessibleContext accessibleContext, + const jint nStartIndex, + /* OUT */ AccessibleHypertextInfo *hypertextInfo); + + /* + * Returns the index into an array of hyperlinks that is associated with + * a character index in document; maps to AccessibleHypertext.getLinkIndex + * Returns -1 on error. + */ + jint getAccessibleHypertextLinkIndex(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex); + + /* + * Returns the nth hyperlink in a document + * Maps to AccessibleHypertext.getLink. + * Returns FALSE on error + */ + BOOL getAccessibleHyperlink(const long vmID, + const AccessibleHypertext hypertext, + const jint nIndex, + /* OUT */ AccessibleHyperlinkInfo *hyperlinkInfo); + + /* Accessible KeyBindings, Icons and Actions */ + + /* + * Returns a list of key bindings associated with a component. + */ + BOOL getAccessibleKeyBindings(long vmID, AccessibleContext accessibleContext, + AccessibleKeyBindings *keyBindings); + + /* + * Returns a list of icons associate with a component. + */ + BOOL getAccessibleIcons(long vmID, AccessibleContext accessibleContext, + AccessibleIcons *icons); + + /* + * Returns a list of actions that a component can perform. + */ + BOOL getAccessibleActions(long vmID, AccessibleContext accessibleContext, + AccessibleActions *actions); + + /* + * Request that a list of AccessibleActions be performed by a component. + * Returns TRUE if all actions are performed. Returns FALSE + * when the first requested action fails in which case "failure" + * contains the index of the action that failed. + */ + BOOL doAccessibleActions(long vmID, AccessibleContext accessibleContext, + AccessibleActionsToDo *actionsToDo, jint *failure); + + + + /* Additional utility methods */ + + /* + * Returns whether two object references refer to the same object. + */ + BOOL IsSameObject(long vmID, JOBJECT64 obj1, JOBJECT64 obj2); + + /** + * Sets editable text contents. The AccessibleContext must implement AccessibleEditableText and + * be editable. The maximum text length that can be set is MAX_STRING_SIZE - 1. + * Returns whether successful + */ + BOOL setTextContents (const long vmID, const AccessibleContext accessibleContext, const wchar_t *text); + + /** + * Returns the Accessible Context with the specified role that is the + * ancestor of a given object. The role is one of the role strings + * defined in AccessBridgePackages.h + * If there is no ancestor object that has the specified role, + * returns (AccessibleContext)0. + */ + AccessibleContext getParentWithRole (const long vmID, const AccessibleContext accessibleContext, + const wchar_t *role); + + /** + * Returns the Accessible Context with the specified role that is the + * ancestor of a given object. The role is one of the role strings + * defined in AccessBridgePackages.h. If an object with the specified + * role does not exist, returns the top level object for the Java Window. + * Returns (AccessibleContext)0 on error. + */ + AccessibleContext getParentWithRoleElseRoot (const long vmID, const AccessibleContext accessibleContext, + const wchar_t *role); + + /** + * Returns the Accessible Context for the top level object in + * a Java Window. This is same Accessible Context that is obtained + * from GetAccessibleContextFromHWND for that window. Returns + * (AccessibleContext)0 on error. + */ + AccessibleContext getTopLevelObject (const long vmID, const AccessibleContext accessibleContext); + + /** + * Returns how deep in the object hierarchy a given object is. + * The top most object in the object hierarchy has an object depth of 0. + * Returns -1 on error. + */ + int getObjectDepth (const long vmID, const AccessibleContext accessibleContext); + + /** + * Returns the Accessible Context of the current ActiveDescendent of an object. + * This method assumes the ActiveDescendent is the component that is currently + * selected in a container object. + * Returns (AccessibleContext)0 on error or if there is no selection. + */ + AccessibleContext getActiveDescendent (const long vmID, const AccessibleContext accessibleContext); + + /** + /** + * Accessible Value routines + */ + BOOL GetCurrentAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len); + BOOL GetMaximumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len); + BOOL GetMinimumAccessibleValueFromContext(long vmID, AccessibleValue av, wchar_t *value, short len); + + /** + * Accessible Selection routines + */ + void AddAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i); + void ClearAccessibleSelectionFromContext(long vmID, AccessibleSelection as); + JOBJECT64 GetAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i); + int GetAccessibleSelectionCountFromContext(long vmID, AccessibleSelection as); + BOOL IsAccessibleChildSelectedFromContext(long vmID, AccessibleSelection as, int i); + void RemoveAccessibleSelectionFromContext(long vmID, AccessibleSelection as, int i); + void SelectAllAccessibleSelectionFromContext(long vmID, AccessibleSelection as); + + /** + * Additional methods for Teton + */ + + /** + * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns + * whether successful. + * + * Bug ID 4916682 - Implement JAWS AccessibleName policy + */ + BOOL getVirtualAccessibleName(const long vmID, const AccessibleContext accessibleContext, + wchar_t *name, int len); + + /** + * Request focus for a component. Returns whether successful. + * + * Bug ID 4944757 - requestFocus method needed + */ + BOOL requestFocus(const long vmID, const AccessibleContext accessibleContext); + + /** + * Selects text between two indices. Selection includes the text at the start index + * and the text at the end index. Returns whether successful. + * + * Bug ID 4944758 - selectTextRange method needed + */ + BOOL selectTextRange(const long vmID, const AccessibleContext accessibleContext, const int startIndex, + const int endIndex); + + /** + * Get text attributes between two indices. The attribute list includes the text at the + * start index and the text at the end index. Returns whether successful; + * + * Bug ID 4944761 - getTextAttributes between two indices method needed + */ + BOOL getTextAttributesInRange(const long vmID, const AccessibleContext accessibleContext, + const int startIndex, const int endIndex, + AccessibleTextAttributesInfo *attributes, short *len); + + /** + * Returns the number of visible children of a component. Returns -1 on error. + * + * Bug ID 4944762- getVisibleChildren for list-like components needed + */ + int getVisibleChildrenCount(const long vmID, const AccessibleContext accessibleContext); + + /** + * Gets the visible children of an AccessibleContext. Returns whether successful. + * + * Bug ID 4944762- getVisibleChildren for list-like components needed + */ + BOOL getVisibleChildren(const long vmID, const AccessibleContext accessibleContext, + const int startIndex, + VisibleChildrenInfo *visibleChildrenInfo); + + /** + * Set the caret to a text position. Returns whether successful. + * + * Bug ID 4944770 - setCaretPosition method needed + */ + BOOL setCaretPosition(const long vmID, const AccessibleContext accessibleContext, + const int position); + + /** + * Gets the text caret location + */ + BOOL getCaretLocation(long vmID, AccessibleContext ac, + AccessibleTextRectInfo *rectInfo, jint index); + + /** + * Gets the number of events waiting to fire + */ + int getEventsWaiting(); + +#ifdef __cplusplus +} +#endif diff --git a/runtime/include/win32/bridge/AccessBridgePackages.h b/runtime/include/win32/bridge/AccessBridgePackages.h new file mode 100644 index 0000000..564dd7f --- /dev/null +++ b/runtime/include/win32/bridge/AccessBridgePackages.h @@ -0,0 +1,2215 @@ +/* + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Header file for packages of paramaters passed between Java Accessibility + * and native Assistive Technologies + */ + +#ifndef __AccessBridgePackages_H__ +#define __AccessBridgePackages_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef ACCESSBRIDGE_ARCH_LEGACY +typedef jobject JOBJECT64; +typedef HWND ABHWND64; +#define ABHandleToLong +#define ABLongToHandle +#else +typedef jlong JOBJECT64; +typedef long ABHWND64; +#define ABHandleToLong HandleToLong +#define ABLongToHandle LongToHandle +#endif + +#define MAX_BUFFER_SIZE 10240 +#define MAX_STRING_SIZE 1024 +#define SHORT_STRING_SIZE 256 + + // object types + typedef JOBJECT64 AccessibleContext; + typedef JOBJECT64 AccessibleText; + typedef JOBJECT64 AccessibleValue; + typedef JOBJECT64 AccessibleSelection; + typedef JOBJECT64 Java_Object; + typedef JOBJECT64 PropertyChangeEvent; + typedef JOBJECT64 FocusEvent; + typedef JOBJECT64 CaretEvent; + typedef JOBJECT64 MouseEvent; + typedef JOBJECT64 MenuEvent; + typedef JOBJECT64 AccessibleTable; + typedef JOBJECT64 AccessibleHyperlink; + typedef JOBJECT64 AccessibleHypertext; + + /** + ****************************************************** + * Java event types + ****************************************************** + */ + +#define cPropertyChangeEvent (jlong) 1 // 1 +#define cFocusGainedEvent (jlong) 2 // 2 +#define cFocusLostEvent (jlong) 4 // 4 +#define cCaretUpdateEvent (jlong) 8 // 8 +#define cMouseClickedEvent (jlong) 16 // 10 +#define cMouseEnteredEvent (jlong) 32 // 20 +#define cMouseExitedEvent (jlong) 64 // 40 +#define cMousePressedEvent (jlong) 128 // 80 +#define cMouseReleasedEvent (jlong) 256 // 100 +#define cMenuCanceledEvent (jlong) 512 // 200 +#define cMenuDeselectedEvent (jlong) 1024 // 400 +#define cMenuSelectedEvent (jlong) 2048 // 800 +#define cPopupMenuCanceledEvent (jlong) 4096 // 1000 +#define cPopupMenuWillBecomeInvisibleEvent (jlong) 8192 // 2000 +#define cPopupMenuWillBecomeVisibleEvent (jlong) 16384 // 4000 +#define cJavaShutdownEvent (jlong) 32768 // 8000 + + /** + ****************************************************** + * Accessible Roles + * Defines all AccessibleRoles in Local.US + ****************************************************** + */ + + /** + * Object is used to alert the user about something. + */ +#define ACCESSIBLE_ALERT L"alert" + + /** + * The header for a column of data. + */ +#define ACCESSIBLE_COLUMN_HEADER L"column header" + + /** + * Object that can be drawn into and is used to trap + * events. + * see ACCESSIBLE_FRAME + * see ACCESSIBLE_GLASS_PANE + * see ACCESSIBLE_LAYERED_PANE + */ +#define ACCESSIBLE_CANVAS L"canvas" + + /** + * A list of choices the user can select from. Also optionally + * allows the user to enter a choice of their own. + */ +#define ACCESSIBLE_COMBO_BOX L"combo box" + + /** + * An iconified internal frame in a DESKTOP_PANE. + * see ACCESSIBLE_DESKTOP_PANE + * see ACCESSIBLE_INTERNAL_FRAME + */ +#define ACCESSIBLE_DESKTOP_ICON L"desktop icon" + + /** + * A frame-like object that is clipped by a desktop pane. The + * desktop pane, internal frame, and desktop icon objects are + * often used to create multiple document interfaces within an + * application. + * see ACCESSIBLE_DESKTOP_ICON + * see ACCESSIBLE_DESKTOP_PANE + * see ACCESSIBLE_FRAME + */ +#define ACCESSIBLE_INTERNAL_FRAME L"internal frame" + + /** + * A pane that supports internal frames and + * iconified versions of those internal frames. + * see ACCESSIBLE_DESKTOP_ICON + * see ACCESSIBLE_INTERNAL_FRAME + */ +#define ACCESSIBLE_DESKTOP_PANE L"desktop pane" + + /** + * A specialized pane whose primary use is inside a DIALOG + * see ACCESSIBLE_DIALOG + */ +#define ACCESSIBLE_OPTION_PANE L"option pane" + + /** + * A top level window with no title or border. + * see ACCESSIBLE_FRAME + * see ACCESSIBLE_DIALOG + */ +#define ACCESSIBLE_WINDOW L"window" + + /** + * A top level window with a title bar, border, menu bar, etc. It is + * often used as the primary window for an application. + * see ACCESSIBLE_DIALOG + * see ACCESSIBLE_CANVAS + * see ACCESSIBLE_WINDOW + */ +#define ACCESSIBLE_FRAME L"frame" + + /** + * A top level window with title bar and a border. A dialog is similar + * to a frame, but it has fewer properties and is often used as a + * secondary window for an application. + * see ACCESSIBLE_FRAME + * see ACCESSIBLE_WINDOW + */ +#define ACCESSIBLE_DIALOG L"dialog" + + /** + * A specialized dialog that lets the user choose a color. + */ +#define ACCESSIBLE_COLOR_CHOOSER L"color chooser" + + + /** + * A pane that allows the user to navigate through + * and select the contents of a directory. May be used + * by a file chooser. + * see ACCESSIBLE_FILE_CHOOSER + */ +#define ACCESSIBLE_DIRECTORY_PANE L"directory pane" + + /** + * A specialized dialog that displays the files in the directory + * and lets the user select a file, browse a different directory, + * or specify a filename. May use the directory pane to show the + * contents of a directory. + * see ACCESSIBLE_DIRECTORY_PANE + */ +#define ACCESSIBLE_FILE_CHOOSER L"file chooser" + + /** + * An object that fills up space in a user interface. It is often + * used in interfaces to tweak the spacing between components, + * but serves no other purpose. + */ +#define ACCESSIBLE_FILLER L"filler" + + /** + * A hypertext anchor + */ +#define ACCESSIBLE_HYPERLINK L"hyperlink" + + /** + * A small fixed size picture, typically used to decorate components. + */ +#define ACCESSIBLE_ICON L"icon" + + /** + * An object used to present an icon or short string in an interface. + */ +#define ACCESSIBLE_LABEL L"label" + + /** + * A specialized pane that has a glass pane and a layered pane as its + * children. + * see ACCESSIBLE_GLASS_PANE + * see ACCESSIBLE_LAYERED_PANE + */ +#define ACCESSIBLE_ROOT_PANE L"root pane" + + /** + * A pane that is guaranteed to be painted on top + * of all panes beneath it. + * see ACCESSIBLE_ROOT_PANE + * see ACCESSIBLE_CANVAS + */ +#define ACCESSIBLE_GLASS_PANE L"glass pane" + + /** + * A specialized pane that allows its children to be drawn in layers, + * providing a form of stacking order. This is usually the pane that + * holds the menu bar as well as the pane that contains most of the + * visual components in a window. + * see ACCESSIBLE_GLASS_PANE + * see ACCESSIBLE_ROOT_PANE + */ +#define ACCESSIBLE_LAYERED_PANE L"layered pane" + + /** + * An object that presents a list of objects to the user and allows the + * user to select one or more of them. A list is usually contained + * within a scroll pane. + * see ACCESSIBLE_SCROLL_PANE + * see ACCESSIBLE_LIST_ITEM + */ +#define ACCESSIBLE_LIST L"list" + + /** + * An object that presents an element in a list. A list is usually + * contained within a scroll pane. + * see ACCESSIBLE_SCROLL_PANE + * see ACCESSIBLE_LIST + */ +#define ACCESSIBLE_LIST_ITEM L"list item" + + /** + * An object usually drawn at the top of the primary dialog box of + * an application that contains a list of menus the user can choose + * from. For example, a menu bar might contain menus for "File," + * "Edit," and "Help." + * see ACCESSIBLE_MENU + * see ACCESSIBLE_POPUP_MENU + * see ACCESSIBLE_LAYERED_PANE + */ +#define ACCESSIBLE_MENU_BAR L"menu bar" + + /** + * A temporary window that is usually used to offer the user a + * list of choices, and then hides when the user selects one of + * those choices. + * see ACCESSIBLE_MENU + * see ACCESSIBLE_MENU_ITEM + */ +#define ACCESSIBLE_POPUP_MENU L"popup menu" + + /** + * An object usually found inside a menu bar that contains a list + * of actions the user can choose from. A menu can have any object + * as its children, but most often they are menu items, other menus, + * or rudimentary objects such as radio buttons, check boxes, or + * separators. For example, an application may have an "Edit" menu + * that contains menu items for "Cut" and "Paste." + * see ACCESSIBLE_MENU_BAR + * see ACCESSIBLE_MENU_ITEM + * see ACCESSIBLE_SEPARATOR + * see ACCESSIBLE_RADIO_BUTTON + * see ACCESSIBLE_CHECK_BOX + * see ACCESSIBLE_POPUP_MENU + */ +#define ACCESSIBLE_MENU L"menu" + + /** + * An object usually contained in a menu that presents an action + * the user can choose. For example, the "Cut" menu item in an + * "Edit" menu would be an action the user can select to cut the + * selected area of text in a document. + * see ACCESSIBLE_MENU_BAR + * see ACCESSIBLE_SEPARATOR + * see ACCESSIBLE_POPUP_MENU + */ +#define ACCESSIBLE_MENU_ITEM L"menu item" + + /** + * An object usually contained in a menu to provide a visual + * and logical separation of the contents in a menu. For example, + * the "File" menu of an application might contain menu items for + * "Open," "Close," and "Exit," and will place a separator between + * "Close" and "Exit" menu items. + * see ACCESSIBLE_MENU + * see ACCESSIBLE_MENU_ITEM + */ +#define ACCESSIBLE_SEPARATOR L"separator" + + /** + * An object that presents a series of panels (or page tabs), one at a + * time, through some mechanism provided by the object. The most common + * mechanism is a list of tabs at the top of the panel. The children of + * a page tab list are all page tabs. + * see ACCESSIBLE_PAGE_TAB + */ +#define ACCESSIBLE_PAGE_TAB_LIST L"page tab list" + + /** + * An object that is a child of a page tab list. Its sole child is + * the panel that is to be presented to the user when the user + * selects the page tab from the list of tabs in the page tab list. + * see ACCESSIBLE_PAGE_TAB_LIST + */ +#define ACCESSIBLE_PAGE_TAB L"page tab" + + /** + * A generic container that is often used to group objects. + */ +#define ACCESSIBLE_PANEL L"panel" + + /** + * An object used to indicate how much of a task has been completed. + */ +#define ACCESSIBLE_PROGRESS_BAR L"progress bar" + + /** + * A text object used for passwords, or other places where the + * text contents is not shown visibly to the user + */ +#define ACCESSIBLE_PASSWORD_TEXT L"password text" + + /** + * An object the user can manipulate to tell the application to do + * something. + * see ACCESSIBLE_CHECK_BOX + * see ACCESSIBLE_TOGGLE_BUTTON + * see ACCESSIBLE_RADIO_BUTTON + */ +#define ACCESSIBLE_PUSH_BUTTON L"push button" + + /** + * A specialized push button that can be checked or unchecked, but + * does not provide a separate indicator for the current state. + * see ACCESSIBLE_PUSH_BUTTON + * see ACCESSIBLE_CHECK_BOX + * see ACCESSIBLE_RADIO_BUTTON + */ +#define ACCESSIBLE_TOGGLE_BUTTON L"toggle button" + + /** + * A choice that can be checked or unchecked and provides a + * separate indicator for the current state. + * see ACCESSIBLE_PUSH_BUTTON + * see ACCESSIBLE_TOGGLE_BUTTON + * see ACCESSIBLE_RADIO_BUTTON + */ +#define ACCESSIBLE_CHECK_BOX L"check box" + + /** + * A specialized check box that will cause other radio buttons in the + * same group to become unchecked when this one is checked. + * see ACCESSIBLE_PUSH_BUTTON + * see ACCESSIBLE_TOGGLE_BUTTON + * see ACCESSIBLE_CHECK_BOX + */ +#define ACCESSIBLE_RADIO_BUTTON L"radio button" + + /** + * The header for a row of data. + */ +#define ACCESSIBLE_ROW_HEADER L"row header" + + /** + * An object that allows a user to incrementally view a large amount + * of information. Its children can include scroll bars and a viewport. + * see ACCESSIBLE_SCROLL_BAR + * see ACCESSIBLE_VIEWPORT + */ +#define ACCESSIBLE_SCROLL_PANE L"scroll pane" + + /** + * An object usually used to allow a user to incrementally view a + * large amount of data. Usually used only by a scroll pane. + * see ACCESSIBLE_SCROLL_PANE + */ +#define ACCESSIBLE_SCROLL_BAR L"scroll bar" + + /** + * An object usually used in a scroll pane. It represents the portion + * of the entire data that the user can see. As the user manipulates + * the scroll bars, the contents of the viewport can change. + * see ACCESSIBLE_SCROLL_PANE + */ +#define ACCESSIBLE_VIEWPORT L"viewport" + + /** + * An object that allows the user to select from a bounded range. For + * example, a slider might be used to select a number between 0 and 100. + */ +#define ACCESSIBLE_SLIDER L"slider" + + /** + * A specialized panel that presents two other panels at the same time. + * Between the two panels is a divider the user can manipulate to make + * one panel larger and the other panel smaller. + */ +#define ACCESSIBLE_SPLIT_PANE L"split pane" + + /** + * An object used to present information in terms of rows and columns. + * An example might include a spreadsheet application. + */ +#define ACCESSIBLE_TABLE L"table" + + /** + * An object that presents text to the user. The text is usually + * editable by the user as opposed to a label. + * see ACCESSIBLE_LABEL + */ +#define ACCESSIBLE_TEXT L"text" + + /** + * An object used to present hierarchical information to the user. + * The individual nodes in the tree can be collapsed and expanded + * to provide selective disclosure of the tree's contents. + */ +#define ACCESSIBLE_TREE L"tree" + + /** + * A bar or palette usually composed of push buttons or toggle buttons. + * It is often used to provide the most frequently used functions for an + * application. + */ +#define ACCESSIBLE_TOOL_BAR L"tool bar" + + /** + * An object that provides information about another object. The + * accessibleDescription property of the tool tip is often displayed + * to the user in a small L"help bubble" when the user causes the + * mouse to hover over the object associated with the tool tip. + */ +#define ACCESSIBLE_TOOL_TIP L"tool tip" + + /** + * An AWT component, but nothing else is known about it. + * see ACCESSIBLE_SWING_COMPONENT + * see ACCESSIBLE_UNKNOWN + */ +#define ACCESSIBLE_AWT_COMPONENT L"awt component" + + /** + * A Swing component, but nothing else is known about it. + * see ACCESSIBLE_AWT_COMPONENT + * see ACCESSIBLE_UNKNOWN + */ +#define ACCESSIBLE_SWING_COMPONENT L"swing component" + + /** + * The object contains some Accessible information, but its role is + * not known. + * see ACCESSIBLE_AWT_COMPONENT + * see ACCESSIBLE_SWING_COMPONENT + */ +#define ACCESSIBLE_UNKNOWN L"unknown" + + /** + * A STATUS_BAR is an simple component that can contain + * multiple labels of status information to the user. + */ +#define ACCESSIBLE_STATUS_BAR L"status bar" + + /** + * A DATE_EDITOR is a component that allows users to edit + * java.util.Date and java.util.Time objects + */ +#define ACCESSIBLE_DATE_EDITOR L"date editor" + + /** + * A SPIN_BOX is a simple spinner component and its main use + * is for simple numbers. + */ +#define ACCESSIBLE_SPIN_BOX L"spin box" + + /** + * A FONT_CHOOSER is a component that lets the user pick various + * attributes for fonts. + */ +#define ACCESSIBLE_FONT_CHOOSER L"font chooser" + + /** + * A GROUP_BOX is a simple container that contains a border + * around it and contains components inside it. + */ +#define ACCESSIBLE_GROUP_BOX L"group box" + + /** + * A text header + */ +#define ACCESSIBLE_HEADER L"header" + + /** + * A text footer + */ +#define ACCESSIBLE_FOOTER L"footer" + + /** + * A text paragraph + */ +#define ACCESSIBLE_PARAGRAPH L"paragraph" + + /** + * A ruler is an object used to measure distance + */ +#define ACCESSIBLE_RULER L"ruler" + + /** + * A role indicating the object acts as a formula for + * calculating a value. An example is a formula in + * a spreadsheet cell. + */ +#define ACCESSIBLE_EDITBAR L"editbar" + + /** + * A role indicating the object monitors the progress + * of some operation. + */ +#define PROGRESS_MONITOR L"progress monitor" + + + /** + ****************************************************** + * Accessibility event types + ****************************************************** + */ + +#define cPropertyNameChangeEvent (jlong) 1 // 1 +#define cPropertyDescriptionChangeEvent (jlong) 2 // 2 +#define cPropertyStateChangeEvent (jlong) 4 // 4 +#define cPropertyValueChangeEvent (jlong) 8 // 8 +#define cPropertySelectionChangeEvent (jlong) 16 // 10 +#define cPropertyTextChangeEvent (jlong) 32 // 20 +#define cPropertyCaretChangeEvent (jlong) 64 // 40 +#define cPropertyVisibleDataChangeEvent (jlong) 128 // 80 +#define cPropertyChildChangeEvent (jlong) 256 // 100 +#define cPropertyActiveDescendentChangeEvent (jlong) 512 // 200 +#define cPropertyTableModelChangeEvent (jlong) 1024 // 400 + + /** + ****************************************************** + * optional AccessibleContext interfaces + * + * This version of the bridge reuses the accessibleValue + * field in the AccessibleContextInfo struct to represent + * additional optional interfaces that are supported by + * the Java AccessibleContext. This is backwardly compatable + * because the old accessibleValue was set to the BOOL + * value TRUE (i.e., 1) if the AccessibleValue interface is + * supported. + ****************************************************** + */ + +#define cAccessibleValueInterface (jlong) 1 // 1 << 1 (TRUE) +#define cAccessibleActionInterface (jlong) 2 // 1 << 2 +#define cAccessibleComponentInterface (jlong) 4 // 1 << 3 +#define cAccessibleSelectionInterface (jlong) 8 // 1 << 4 +#define cAccessibleTableInterface (jlong) 16 // 1 << 5 +#define cAccessibleTextInterface (jlong) 32 // 1 << 6 +#define cAccessibleHypertextInterface (jlong) 64 // 1 << 7 + + + /** + ****************************************************** + * Accessibility information bundles + ****************************************************** + */ + + typedef struct AccessBridgeVersionInfoTag { + wchar_t VMversion[SHORT_STRING_SIZE]; // output of "java -version" + wchar_t bridgeJavaClassVersion[SHORT_STRING_SIZE]; // version of the AccessBridge.class + wchar_t bridgeJavaDLLVersion[SHORT_STRING_SIZE]; // version of JavaAccessBridge.dll + wchar_t bridgeWinDLLVersion[SHORT_STRING_SIZE]; // version of WindowsAccessBridge.dll + } AccessBridgeVersionInfo; + + + typedef struct AccessibleContextInfoTag { + wchar_t name[MAX_STRING_SIZE]; // the AccessibleName of the object + wchar_t description[MAX_STRING_SIZE]; // the AccessibleDescription of the object + + wchar_t role[SHORT_STRING_SIZE]; // localized AccesibleRole string + wchar_t role_en_US[SHORT_STRING_SIZE]; // AccesibleRole string in the en_US locale + wchar_t states[SHORT_STRING_SIZE]; // localized AccesibleStateSet string (comma separated) + wchar_t states_en_US[SHORT_STRING_SIZE]; // AccesibleStateSet string in the en_US locale (comma separated) + + jint indexInParent; // index of object in parent + jint childrenCount; // # of children, if any + + jint x; // screen coords in pixels + jint y; // " + jint width; // pixel width of object + jint height; // pixel height of object + + BOOL accessibleComponent; // flags for various additional + BOOL accessibleAction; // Java Accessibility interfaces + BOOL accessibleSelection; // FALSE if this object doesn't + BOOL accessibleText; // implement the additional interface + // in question + + // BOOL accessibleValue; // old BOOL indicating whether AccessibleValue is supported + BOOL accessibleInterfaces; // new bitfield containing additional interface flags + + } AccessibleContextInfo; + + + + // AccessibleText packages + typedef struct AccessibleTextInfoTag { + jint charCount; // # of characters in this text object + jint caretIndex; // index of caret + jint indexAtPoint; // index at the passsed in point + } AccessibleTextInfo; + + typedef struct AccessibleTextItemsInfoTag { + wchar_t letter; + wchar_t word[SHORT_STRING_SIZE]; + wchar_t sentence[MAX_STRING_SIZE]; + } AccessibleTextItemsInfo; + + typedef struct AccessibleTextSelectionInfoTag { + jint selectionStartIndex; + jint selectionEndIndex; + wchar_t selectedText[MAX_STRING_SIZE]; + } AccessibleTextSelectionInfo; + + typedef struct AccessibleTextRectInfoTag { + jint x; // bounding rect of char at index + jint y; // " + jint width; // " + jint height; // " + } AccessibleTextRectInfo; + + // standard attributes for text; note: tabstops are not supported + typedef struct AccessibleTextAttributesInfoTag { + BOOL bold; + BOOL italic; + BOOL underline; + BOOL strikethrough; + BOOL superscript; + BOOL subscript; + + wchar_t backgroundColor[SHORT_STRING_SIZE]; + wchar_t foregroundColor[SHORT_STRING_SIZE]; + wchar_t fontFamily[SHORT_STRING_SIZE]; + jint fontSize; + + jint alignment; + jint bidiLevel; + + jfloat firstLineIndent; + jfloat leftIndent; + jfloat rightIndent; + jfloat lineSpacing; + jfloat spaceAbove; + jfloat spaceBelow; + + wchar_t fullAttributesString[MAX_STRING_SIZE]; + } AccessibleTextAttributesInfo; + + /** + ****************************************************** + * IPC management typedefs + ****************************************************** + */ + +#define cMemoryMappedNameSize 255 + + /** + * sent by the WindowsDLL -> the memory-mapped file is setup + * + */ + typedef struct MemoryMappedFileCreatedPackageTag { +// HWND bridgeWindow; // redundant, but easier to get to here... + ABHWND64 bridgeWindow; // redundant, but easier to get to here... + char filename[cMemoryMappedNameSize]; + } MemoryMappedFileCreatedPackage; + + + + + /** + * sent when a new JavaVM attaches to the Bridge + * + */ + typedef struct JavaVMCreatedPackageTag { + ABHWND64 bridgeWindow; + long vmID; + } JavaVMCreatedPackage; + + /** + * sent when a JavaVM detatches from the Bridge + * + */ + typedef struct JavaVMDestroyedPackageTag { + ABHWND64 bridgeWindow; + } JavaVMDestroyedPackage; + + /** + * sent when a new AT attaches to the Bridge + * + */ + typedef struct WindowsATCreatedPackageTag { + ABHWND64 bridgeWindow; + } WindowsATCreatedPackage; + + /** + * sent when an AT detatches from the Bridge + * + */ + typedef struct WindowsATDestroyedPackageTag { + ABHWND64 bridgeWindow; + } WindowsATDestroyedPackage; + + + /** + * sent by JVM Bridges in response to a WindowsATCreate + * message; saying "howdy, welcome to the neighborhood" + * + */ + typedef struct JavaVMPresentNotificationPackageTag { + ABHWND64 bridgeWindow; + long vmID; + } JavaVMPresentNotificationPackage; + + /** + * sent by AT Bridges in response to a JavaVMCreate + * message; saying "howdy, welcome to the neighborhood" + * + */ + typedef struct WindowsATPresentNotificationPackageTag { + ABHWND64 bridgeWindow; + } WindowsATPresentNotificationPackage; + + + /** + ****************************************************** + * Core packages + ****************************************************** + */ + + typedef struct ReleaseJavaObjectPackageTag { + long vmID; + JOBJECT64 object; + } ReleaseJavaObjectPackage; + + typedef struct GetAccessBridgeVersionPackageTag { + long vmID; // can't get VM info w/out a VM! + AccessBridgeVersionInfo rVersionInfo; + } GetAccessBridgeVersionPackage; + + typedef struct IsSameObjectPackageTag { + long vmID; + JOBJECT64 obj1; + JOBJECT64 obj2; + jboolean rResult; + } IsSameObjectPackage; + + /** + ****************************************************** + * Windows packages + ****************************************************** + */ + + typedef struct IsJavaWindowPackageTag { + jint window; + jboolean rResult; + } IsJavaWindowPackage; + + typedef struct GetAccessibleContextFromHWNDPackageTag { + jint window; + long rVMID; + JOBJECT64 rAccessibleContext; + } GetAccessibleContextFromHWNDPackage; + + typedef struct GetHWNDFromAccessibleContextPackageTag { + JOBJECT64 accessibleContext; + ABHWND64 rHWND; + } GetHWNDFromAccessibleContextPackage; + + /** +****************************************************** +* AccessibleContext packages +****************************************************** +*/ + + typedef struct GetAccessibleContextAtPackageTag { + jint x; + jint y; + long vmID; + JOBJECT64 AccessibleContext; // look within this AC + JOBJECT64 rAccessibleContext; + } GetAccessibleContextAtPackage; + + typedef struct GetAccessibleContextWithFocusPackageTag { + long rVMID; + JOBJECT64 rAccessibleContext; + } GetAccessibleContextWithFocusPackage; + + typedef struct GetAccessibleContextInfoPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + AccessibleContextInfo rAccessibleContextInfo; + } GetAccessibleContextInfoPackage; + + typedef struct GetAccessibleChildFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint childIndex; + JOBJECT64 rAccessibleContext; + } GetAccessibleChildFromContextPackage; + + typedef struct GetAccessibleParentFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + JOBJECT64 rAccessibleContext; + } GetAccessibleParentFromContextPackage; + + /** +****************************************************** +* AccessibleTable packages +****************************************************** +*/ + +#define MAX_TABLE_SELECTIONS 64 + + // table information + typedef struct AccessibleTableInfoTag { + JOBJECT64 caption; // AccesibleContext + JOBJECT64 summary; // AccessibleContext + jint rowCount; + jint columnCount; + JOBJECT64 accessibleContext; + JOBJECT64 accessibleTable; + } AccessibleTableInfo; + + typedef struct GetAccessibleTableInfoPackageTag { + long vmID; + JOBJECT64 accessibleContext; + AccessibleTableInfo rTableInfo; + } GetAccessibleTableInfoPackage; + + // table cell information + typedef struct AccessibleTableCellInfoTag { + JOBJECT64 accessibleContext; + jint index; + jint row; + jint column; + jint rowExtent; + jint columnExtent; + jboolean isSelected; + } AccessibleTableCellInfo; + + typedef struct GetAccessibleTableCellInfoPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint row; + jint column; + AccessibleTableCellInfo rTableCellInfo; + } GetAccessibleTableCellInfoPackage; + + typedef struct GetAccessibleTableRowHeaderPackageTag { + long vmID; + JOBJECT64 accessibleContext; + AccessibleTableInfo rTableInfo; + } GetAccessibleTableRowHeaderPackage; + + typedef struct GetAccessibleTableColumnHeaderPackageTag { + long vmID; + JOBJECT64 accessibleContext; + AccessibleTableInfo rTableInfo; + } GetAccessibleTableColumnHeaderPackage; + + typedef struct GetAccessibleTableRowDescriptionPackageTag { + long vmID; + JOBJECT64 accessibleContext; + jint row; + JOBJECT64 rAccessibleContext; + } GetAccessibleTableRowDescriptionPackage; + + typedef struct GetAccessibleTableColumnDescriptionPackageTag { + long vmID; + JOBJECT64 accessibleContext; + jint column; + JOBJECT64 rAccessibleContext; + } GetAccessibleTableColumnDescriptionPackage; + + typedef struct GetAccessibleTableRowSelectionCountPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint rCount; + } GetAccessibleTableRowSelectionCountPackage; + + typedef struct IsAccessibleTableRowSelectedPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint row; + jboolean rResult; + } IsAccessibleTableRowSelectedPackage; + + typedef struct GetAccessibleTableRowSelectionsPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint count; + jint rSelections[MAX_TABLE_SELECTIONS]; + } GetAccessibleTableRowSelectionsPackage; + + typedef struct GetAccessibleTableColumnSelectionCountPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint rCount; + } GetAccessibleTableColumnSelectionCountPackage; + + typedef struct IsAccessibleTableColumnSelectedPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint column; + jboolean rResult; + } IsAccessibleTableColumnSelectedPackage; + + typedef struct GetAccessibleTableColumnSelectionsPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint count; + jint rSelections[MAX_TABLE_SELECTIONS]; + } GetAccessibleTableColumnSelectionsPackage; + + + typedef struct GetAccessibleTableRowPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint index; + jint rRow; + } GetAccessibleTableRowPackage; + + typedef struct GetAccessibleTableColumnPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint index; + jint rColumn; + } GetAccessibleTableColumnPackage; + + typedef struct GetAccessibleTableIndexPackageTag { + long vmID; + JOBJECT64 accessibleTable; + jint row; + jint column; + jint rIndex; + } GetAccessibleTableIndexPackage; + + + /** + ****************************************************** + * AccessibleRelationSet packages + ****************************************************** + */ + +#define MAX_RELATION_TARGETS 25 +#define MAX_RELATIONS 5 + + typedef struct AccessibleRelationInfoTag { + wchar_t key[SHORT_STRING_SIZE]; + jint targetCount; + JOBJECT64 targets[MAX_RELATION_TARGETS]; // AccessibleContexts + } AccessibleRelationInfo; + + typedef struct AccessibleRelationSetInfoTag { + jint relationCount; + AccessibleRelationInfo relations[MAX_RELATIONS]; + } AccessibleRelationSetInfo; + + typedef struct GetAccessibleRelationSetPackageTag { + long vmID; + JOBJECT64 accessibleContext; + AccessibleRelationSetInfo rAccessibleRelationSetInfo; + } GetAccessibleRelationSetPackage; + + /** + ****************************************************** + * AccessibleHypertext packagess + ****************************************************** + */ + +#define MAX_HYPERLINKS 64 // maximum number of hyperlinks returned + + // hyperlink information + typedef struct AccessibleHyperlinkInfoTag { + wchar_t text[SHORT_STRING_SIZE]; // the hyperlink text + jint startIndex; //index in the hypertext document where the link begins + jint endIndex; //index in the hypertext document where the link ends + JOBJECT64 accessibleHyperlink; // AccessibleHyperlink object + } AccessibleHyperlinkInfo; + + // hypertext information + typedef struct AccessibleHypertextInfoTag { + jint linkCount; // number of hyperlinks + AccessibleHyperlinkInfo links[MAX_HYPERLINKS]; // the hyperlinks + JOBJECT64 accessibleHypertext; // AccessibleHypertext object + } AccessibleHypertextInfo; + + // struct for sending a message to get the hypertext for an AccessibleContext + typedef struct GetAccessibleHypertextPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext with hypertext + AccessibleHypertextInfo rAccessibleHypertextInfo; // returned hypertext + } GetAccessibleHypertextPackage; + + // struct for sending an message to activate a hyperlink + typedef struct ActivateAccessibleHyperlinkPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext containing the link + JOBJECT64 accessibleHyperlink; // the link to activate + BOOL rResult; // hyperlink activation return value + } ActivateAccessibleHyperlinkPackage; + + // struct for sending a message to get the number of hyperlinks in a component + typedef struct GetAccessibleHyperlinkCountPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext containing AccessibleHypertext + jint rLinkCount; // link count return value + } GetAccessibleHyperlinkCountPackage; + + // struct for sending a message to get the hypertext for an AccessibleContext + // starting at a specified index in the document + typedef struct GetAccessibleHypertextExtPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext with hypertext + jint startIndex; // start index in document + AccessibleHypertextInfo rAccessibleHypertextInfo; // returned hypertext + BOOL rSuccess; // whether call succeeded + } GetAccessibleHypertextExtPackage; + + // struct for sending a message to get the nth hyperlink in a document; + // maps to AccessibleHypertext.getLink + typedef struct GetAccessibleHyperlinkPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 hypertext; // AccessibleHypertext + jint linkIndex; // hyperlink index + AccessibleHyperlinkInfo rAccessibleHyperlinkInfo; // returned hyperlink + } GetAccessibleHyperlinkPackage; + + // struct for sending a message to get the index into an array + // of hyperlinks that is associated with a character index in a + // document; maps to AccessibleHypertext.getLinkIndex + typedef struct GetAccessibleHypertextLinkIndexPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 hypertext; // AccessibleHypertext + jint charIndex; // character index in document + jint rLinkIndex; // returned hyperlink index + } GetAccessibleHypertextLinkIndexPackage; + + /** + ****************************************************** + * Accessible Key Bindings packages + ****************************************************** + */ + +#define MAX_KEY_BINDINGS 10 + + // keyboard character modifiers +#define ACCESSIBLE_SHIFT_KEYSTROKE 1 +#define ACCESSIBLE_CONTROL_KEYSTROKE 2 +#define ACCESSIBLE_META_KEYSTROKE 4 +#define ACCESSIBLE_ALT_KEYSTROKE 8 +#define ACCESSIBLE_ALT_GRAPH_KEYSTROKE 16 +#define ACCESSIBLE_BUTTON1_KEYSTROKE 32 +#define ACCESSIBLE_BUTTON2_KEYSTROKE 64 +#define ACCESSIBLE_BUTTON3_KEYSTROKE 128 +#define ACCESSIBLE_FKEY_KEYSTROKE 256 // F key pressed, character contains 1-24 +#define ACCESSIBLE_CONTROLCODE_KEYSTROKE 512 // Control code key pressed, character contains control code. + +// The supported control code keys are: +#define ACCESSIBLE_VK_BACK_SPACE 8 +#define ACCESSIBLE_VK_DELETE 127 +#define ACCESSIBLE_VK_DOWN 40 +#define ACCESSIBLE_VK_END 35 +#define ACCESSIBLE_VK_HOME 36 +#define ACCESSIBLE_VK_INSERT 155 +#define ACCESSIBLE_VK_KP_DOWN 225 +#define ACCESSIBLE_VK_KP_LEFT 226 +#define ACCESSIBLE_VK_KP_RIGHT 227 +#define ACCESSIBLE_VK_KP_UP 224 +#define ACCESSIBLE_VK_LEFT 37 +#define ACCESSIBLE_VK_PAGE_DOWN 34 +#define ACCESSIBLE_VK_PAGE_UP 33 +#define ACCESSIBLE_VK_RIGHT 39 +#define ACCESSIBLE_VK_UP 38 + + // a key binding associates with a component + typedef struct AccessibleKeyBindingInfoTag { + jchar character; // the key character + jint modifiers; // the key modifiers + } AccessibleKeyBindingInfo; + + // all of the key bindings associated with a component + typedef struct AccessibleKeyBindingsTag { + int keyBindingsCount; // number of key bindings + AccessibleKeyBindingInfo keyBindingInfo[MAX_KEY_BINDINGS]; + } AccessibleKeyBindings; + + // struct to get the key bindings associated with a component + typedef struct GetAccessibleKeyBindingsPackageTag { + long vmID; // the virtual machine id + JOBJECT64 accessibleContext; // the component + AccessibleKeyBindings rAccessibleKeyBindings; // the key bindings + } GetAccessibleKeyBindingsPackage; + + /** +****************************************************** +* AccessibleIcon packages +****************************************************** +*/ +#define MAX_ICON_INFO 8 + + // an icon assocated with a component + typedef struct AccessibleIconInfoTag { + wchar_t description[SHORT_STRING_SIZE]; // icon description + jint height; // icon height + jint width; // icon width + } AccessibleIconInfo; + + // all of the icons associated with a component + typedef struct AccessibleIconsTag { + jint iconsCount; // number of icons + AccessibleIconInfo iconInfo[MAX_ICON_INFO]; // the icons + } AccessibleIcons; + + // struct to get the icons associated with a component + typedef struct GetAccessibleIconsPackageTag { + long vmID; // the virtual machine id + JOBJECT64 accessibleContext; // the component + AccessibleIcons rAccessibleIcons; // the icons + } GetAccessibleIconsPackage; + + + /** +****************************************************** +* AccessibleAction packages +****************************************************** +*/ +#define MAX_ACTION_INFO 256 +#define MAX_ACTIONS_TO_DO 32 + + // an action assocated with a component + typedef struct AccessibleActionInfoTag { + wchar_t name[SHORT_STRING_SIZE]; // action name + } AccessibleActionInfo; + + // all of the actions associated with a component + typedef struct AccessibleActionsTag { + jint actionsCount; // number of actions + AccessibleActionInfo actionInfo[MAX_ACTION_INFO]; // the action information + } AccessibleActions; + + // struct for requesting the actions associated with a component + typedef struct GetAccessibleActionsPackageTag { + long vmID; + JOBJECT64 accessibleContext; // the component + AccessibleActions rAccessibleActions; // the actions + } GetAccessibleActionsPackage; + + // list of AccessibleActions to do + typedef struct AccessibleActionsToDoTag { + jint actionsCount; // number of actions to do + AccessibleActionInfo actions[MAX_ACTIONS_TO_DO];// the accessible actions to do + } AccessibleActionsToDo; + + // struct for sending an message to do one or more actions + typedef struct DoAccessibleActionsPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // component to do the action + AccessibleActionsToDo actionsToDo; // the accessible actions to do + BOOL rResult; // action return value + jint failure; // index of action that failed if rResult is FALSE + } DoAccessibleActionsPackage; + + /** +****************************************************** +* AccessibleText packages +****************************************************** +*/ + + typedef struct GetAccessibleTextInfoPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint x; + jint y; + AccessibleTextInfo rTextInfo; + } GetAccessibleTextInfoPackage; + + typedef struct GetAccessibleTextItemsPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + AccessibleTextItemsInfo rTextItemsInfo; + } GetAccessibleTextItemsPackage; + + typedef struct GetAccessibleTextSelectionInfoPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + AccessibleTextSelectionInfo rTextSelectionItemsInfo; + } GetAccessibleTextSelectionInfoPackage; + + typedef struct GetAccessibleTextAttributeInfoPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + AccessibleTextAttributesInfo rAttributeInfo; + } GetAccessibleTextAttributeInfoPackage; + + typedef struct GetAccessibleTextRectInfoPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + AccessibleTextRectInfo rTextRectInfo; + } GetAccessibleTextRectInfoPackage; + + typedef struct GetCaretLocationPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + AccessibleTextRectInfo rTextRectInfo; + } GetCaretLocationPackage; + + typedef struct GetAccessibleTextLineBoundsPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + jint rLineStart; + jint rLineEnd; + } GetAccessibleTextLineBoundsPackage; + + typedef struct GetAccessibleTextRangePackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint start; + jint end; + wchar_t rText[MAX_BUFFER_SIZE]; + } GetAccessibleTextRangePackage; + + /** +****************************************************** +* +* Utility method packages +****************************************************** +*/ + + typedef struct SetTextContentsPackageTag { + long vmID; + JOBJECT64 accessibleContext; // the text field + wchar_t text[MAX_STRING_SIZE]; // the text + BOOL rResult; + } SetTextContentsPackage; + + typedef struct GetParentWithRolePackageTag { + long vmID; + JOBJECT64 accessibleContext; + wchar_t role[SHORT_STRING_SIZE]; // one of Accessible Roles above + JOBJECT64 rAccessibleContext; + } GetParentWithRolePackage; + + typedef struct GetTopLevelObjectPackageTag { + long vmID; + JOBJECT64 accessibleContext; + JOBJECT64 rAccessibleContext; + } GetTopLevelObjectPackage; + + typedef struct GetParentWithRoleElseRootPackageTag { + long vmID; + JOBJECT64 accessibleContext; + wchar_t role[SHORT_STRING_SIZE]; // one of Accessible Roles above + JOBJECT64 rAccessibleContext; + } GetParentWithRoleElseRootPackage; + + typedef struct GetObjectDepthPackageTag { + long vmID; + JOBJECT64 accessibleContext; + jint rResult; + } GetObjectDepthPackage; + + typedef struct GetActiveDescendentPackageTag { + long vmID; + JOBJECT64 accessibleContext; + JOBJECT64 rAccessibleContext; + } GetActiveDescendentPackage; + + /** +****************************************************** +* AccessibleValue packages +****************************************************** +*/ + + typedef struct GetCurrentAccessibleValueFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + wchar_t rValue[SHORT_STRING_SIZE]; + } GetCurrentAccessibleValueFromContextPackage; + + typedef struct GetMaximumAccessibleValueFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + wchar_t rValue[SHORT_STRING_SIZE]; + } GetMaximumAccessibleValueFromContextPackage; + + typedef struct GetMinimumAccessibleValueFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + wchar_t rValue[SHORT_STRING_SIZE]; + } GetMinimumAccessibleValueFromContextPackage; + + + /** +****************************************************** +* AccessibleSelection packages +****************************************************** +*/ + + typedef struct AddAccessibleSelectionFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + } AddAccessibleSelectionFromContextPackage; + + typedef struct ClearAccessibleSelectionFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + } ClearAccessibleSelectionFromContextPackage; + + typedef struct GetAccessibleSelectionFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + JOBJECT64 rAccessibleContext; + } GetAccessibleSelectionFromContextPackage; + + typedef struct GetAccessibleSelectionCountFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint rCount; + } GetAccessibleSelectionCountFromContextPackage; + + typedef struct IsAccessibleChildSelectedFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + jboolean rResult; + } IsAccessibleChildSelectedFromContextPackage; + + typedef struct RemoveAccessibleSelectionFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + jint index; + } RemoveAccessibleSelectionFromContextPackage; + + typedef struct SelectAllAccessibleSelectionFromContextPackageTag { + long vmID; + JOBJECT64 AccessibleContext; + } SelectAllAccessibleSelectionFromContextPackage; + + + /** +****************************************************** +* Java Event Notification Registration packages +****************************************************** +*/ + + typedef struct AddJavaEventNotificationPackageTag { + jlong type; + //HWND DLLwindow; + ABHWND64 DLLwindow; + } AddJavaEventNotificationPackage; + + typedef struct RemoveJavaEventNotificationPackageTag { + jlong type; + //HWND DLLwindow; + ABHWND64 DLLwindow; + } RemoveJavaEventNotificationPackage; + + + /** +****************************************************** +* Accessibility Event Notification Registration packages +****************************************************** +*/ + + typedef struct AddAccessibilityEventNotificationPackageTag { + jlong type; + //HWND DLLwindow; + ABHWND64 DLLwindow; + } AddAccessibilityEventNotificationPackage; + + typedef struct RemoveAccessibilityEventNotificationPackageTag { + jlong type; + //HWND DLLwindow; + ABHWND64 DLLwindow; + } RemoveAccessibilityEventNotificationPackage; + + + /** +****************************************************** +* Accessibility Property Change Event packages +****************************************************** +*/ + + typedef struct PropertyCaretChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + jint oldPosition; + jint newPosition; + } PropertyCaretChangePackage; + + typedef struct PropertyDescriptionChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + wchar_t oldDescription[SHORT_STRING_SIZE]; + wchar_t newDescription[SHORT_STRING_SIZE]; + } PropertyDescriptionChangePackage; + + typedef struct PropertyNameChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + wchar_t oldName[SHORT_STRING_SIZE]; + wchar_t newName[SHORT_STRING_SIZE]; + } PropertyNameChangePackage; + + typedef struct PropertySelectionChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PropertySelectionChangePackage; + + typedef struct PropertyStateChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + wchar_t oldState[SHORT_STRING_SIZE]; + wchar_t newState[SHORT_STRING_SIZE]; + } PropertyStateChangePackage; + + typedef struct PropertyTextChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PropertyTextChangePackage; + + typedef struct PropertyValueChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + wchar_t oldValue[SHORT_STRING_SIZE]; + wchar_t newValue[SHORT_STRING_SIZE]; + } PropertyValueChangePackage; + + typedef struct PropertyVisibleDataChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PropertyVisibleDataChangePackage; + + typedef struct PropertyChildChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + JOBJECT64 oldChildAccessibleContext; + JOBJECT64 newChildAccessibleContext; + } PropertyChildChangePackage; + + typedef struct PropertyActiveDescendentChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + JOBJECT64 oldActiveDescendentAccessibleContext; + JOBJECT64 newActiveDescendentAccessibleContext; + } PropertyActiveDescendentChangePackage; + + + // String format for newValue is: + // "type" one of "INSERT", "UPDATE" or "DELETE" + // "firstRow" + // "lastRow" + // "firstColumn" + // "lastColumn" + // + // oldValue is currently unused + // + typedef struct PropertyTableModelChangePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + wchar_t oldValue[SHORT_STRING_SIZE]; + wchar_t newValue[SHORT_STRING_SIZE]; + } PropertyTableModelChangePackage; + + + /** +****************************************************** +* Property Change Event packages +****************************************************** +*/ + + /* + typedef struct PropertyChangePackageTag { + long vmID; + jobject Event; + jobject AccessibleContextSource; + char propertyName[SHORT_STRING_SIZE]; + char oldValue[SHORT_STRING_SIZE]; // PropertyChangeEvent().getOldValue().toString() + char newValue[SHORT_STRING_SIZE]; // PropertyChangeEvent().getNewValue().toString() + } PropertyChangePackage; + */ + + /* + * Java shutdown event package + */ + typedef struct JavaShutdownPackageTag { + long vmID; + } JavaShutdownPackage; + + + /** +****************************************************** +* Focus Event packages +****************************************************** +*/ + + typedef struct FocusGainedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } FocusGainedPackage; + + typedef struct FocusLostPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } FocusLostPackage; + + + /** +****************************************************** +* Caret Event packages +****************************************************** +*/ + + typedef struct CaretUpdatePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } CaretUpdatePackage; + + + /** +****************************************************** +* Mouse Event packages +****************************************************** +*/ + + typedef struct MouseClickedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MouseClickedPackage; + + typedef struct MouseEnteredPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MouseEnteredPackage; + + typedef struct MouseExitedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MouseExitedPackage; + + typedef struct MousePressedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MousePressedPackage; + + typedef struct MouseReleasedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MouseReleasedPackage; + + + /** +****************************************************** +* Menu/PopupMenu Event packages +****************************************************** +*/ + + typedef struct MenuCanceledPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MenuCanceledPackage; + + typedef struct MenuDeselectedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MenuDeselectedPackage; + + typedef struct MenuSelectedPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } MenuSelectedPackage; + + + typedef struct PopupMenuCanceledPackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PopupMenuCanceledPackage; + + typedef struct PopupMenuWillBecomeInvisiblePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PopupMenuWillBecomeInvisiblePackage; + + typedef struct PopupMenuWillBecomeVisiblePackageTag { + long vmID; + JOBJECT64 Event; + JOBJECT64 AccessibleContextSource; + } PopupMenuWillBecomeVisiblePackage; + + /** +****************************************************** +* Additional methods for Teton +****************************************************** +*/ + + /** + * Gets the AccessibleName for a component based upon the JAWS algorithm. Returns + * whether successful. + * + * Bug ID 4916682 - Implement JAWS AccessibleName policy + */ + typedef struct GetVirtualAccessibleNamePackageTag { + long vmID; + AccessibleContext accessibleContext; + wchar_t rName[MAX_STRING_SIZE]; + int len; + } GetVirtualAccessibleNamePackage; + + /** + * Request focus for a component. Returns whether successful; + * + * Bug ID 4944757 - requestFocus method needed + */ + typedef struct RequestFocusPackageTag { + long vmID; + AccessibleContext accessibleContext; + } RequestFocusPackage; + + /** + * Selects text between two indices. Selection includes the text at the start index + * and the text at the end index. Returns whether successful; + * + * Bug ID 4944758 - selectTextRange method needed + */ + typedef struct SelectTextRangePackageTag { + long vmID; + AccessibleContext accessibleContext; + jint startIndex; + jint endIndex; + } SelectTextRangePackage; + + /** + * Gets the number of contiguous characters with the same attributes. + * + * Bug ID 4944761 - getTextAttributes between two indices method needed + */ + typedef struct GetTextAttributesInRangePackageTag { + long vmID; + AccessibleContext accessibleContext; + jint startIndex; // start index (inclusive) + jint endIndex; // end index (inclusive) + AccessibleTextAttributesInfo attributes; // character attributes to match + short rLength; // number of contiguous characters with matching attributes + } GetTextAttributesInRangePackage; + +#define MAX_VISIBLE_CHILDREN 256 + + // visible children information + typedef struct VisibleChildenInfoTag { + int returnedChildrenCount; // number of children returned + AccessibleContext children[MAX_VISIBLE_CHILDREN]; // the visible children + } VisibleChildrenInfo; + + // struct for sending a message to get the number of visible children + typedef struct GetVisibleChildrenCountPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext of parent component + jint rChildrenCount; // visible children count return value + } GetVisibleChildrenCountPackage; + + // struct for sending a message to get the hypertext for an AccessibleContext + // starting at a specified index in the document + typedef struct GetVisibleChildrenPackageTag { + long vmID; // the virtual machine ID + JOBJECT64 accessibleContext; // AccessibleContext of parent component + jint startIndex; // start index for retrieving children + VisibleChildrenInfo rVisibleChildrenInfo; // returned info + BOOL rSuccess; // whether call succeeded + } GetVisibleChildrenPackage; + + /** + * Set the caret to a text position. Returns whether successful; + * + * Bug ID 4944770 - setCaretPosition method needed + */ + typedef struct SetCaretPositionPackageTag { + long vmID; + AccessibleContext accessibleContext; + jint position; + } SetCaretPositionPackage; + + + /** + ****************************************************** + * Wrapping up all of the packages + ****************************************************** + */ + + /** + * What is the type of this package + */ + typedef enum PackageType { + + cMemoryMappedFileCreatedPackage = 0x11000, + + // many of these will go away... + cJavaVMCreatedPackage = 0x10000, + cJavaVMDestroyedPackage, + cWindowsATCreatedPackage, + cWindowsATDestroyedPackage, + cJavaVMPresentNotificationPackage, + cWindowsATPresentNotificationPackage, + + cReleaseJavaObjectPackage = 1, + cGetAccessBridgeVersionPackage = 2, + + cGetAccessibleContextFromHWNDPackage = 0x10, + cIsJavaWindowPackage, + cGetHWNDFromAccessibleContextPackage, + + cGetAccessibleContextAtPackage = 0x100, + cGetAccessibleContextWithFocusPackage, + cGetAccessibleContextInfoPackage, + cGetAccessibleChildFromContextPackage, + cGetAccessibleParentFromContextPackage, + cIsSameObjectPackage, + + cGetAccessibleTextInfoPackage = 0x200, + cGetAccessibleTextItemsPackage, + cGetAccessibleTextSelectionInfoPackage, + cGetAccessibleTextAttributeInfoPackage, + cGetAccessibleTextRectInfoPackage, + cGetAccessibleTextLineBoundsPackage, + cGetAccessibleTextRangePackage, + + cGetCurrentAccessibleValueFromContextPackage = 0x300, + cGetMaximumAccessibleValueFromContextPackage, + cGetMinimumAccessibleValueFromContextPackage, + + cAddAccessibleSelectionFromContextPackage = 0x400, + cClearAccessibleSelectionFromContextPackage, + cGetAccessibleSelectionFromContextPackage, + cGetAccessibleSelectionCountFromContextPackage, + cIsAccessibleChildSelectedFromContextPackage, + cRemoveAccessibleSelectionFromContextPackage, + cSelectAllAccessibleSelectionFromContextPackage, + + cAddJavaEventNotificationPackage = 0x900, + cRemoveJavaEventNotificationPackage, + cAddAccessibilityEventNotificationPackage, + cRemoveAccessibilityEventNotificationPackage, + + cPropertyChangePackage = 0x1000, + + cJavaShutdownPackage = 0x1010, + cFocusGainedPackage, + cFocusLostPackage, + + cCaretUpdatePackage = 0x1020, + + cMouseClickedPackage = 0x1030, + cMouseEnteredPackage, + cMouseExitedPackage, + cMousePressedPackage, + cMouseReleasedPackage, + + cMenuCanceledPackage = 0x1040, + cMenuDeselectedPackage, + cMenuSelectedPackage, + cPopupMenuCanceledPackage, + cPopupMenuWillBecomeInvisiblePackage, + cPopupMenuWillBecomeVisiblePackage, + + cPropertyCaretChangePackage = 0x1100, + cPropertyDescriptionChangePackage, + cPropertyNameChangePackage, + cPropertySelectionChangePackage, + cPropertyStateChangePackage, + cPropertyTextChangePackage, + cPropertyValueChangePackage, + cPropertyVisibleDataChangePackage, + cPropertyChildChangePackage, + cPropertyActiveDescendentChangePackage, + + + // AccessibleTable + cGetAccessibleTableInfoPackage = 0x1200, + cGetAccessibleTableCellInfoPackage, + + cGetAccessibleTableRowHeaderPackage, + cGetAccessibleTableColumnHeaderPackage, + + cGetAccessibleTableRowDescriptionPackage, + cGetAccessibleTableColumnDescriptionPackage, + + cGetAccessibleTableRowSelectionCountPackage, + cIsAccessibleTableRowSelectedPackage, + cGetAccessibleTableRowSelectionsPackage, + + cGetAccessibleTableColumnSelectionCountPackage, + cIsAccessibleTableColumnSelectedPackage, + cGetAccessibleTableColumnSelectionsPackage, + + cGetAccessibleTableRowPackage, + cGetAccessibleTableColumnPackage, + cGetAccessibleTableIndexPackage, + + cPropertyTableModelChangePackage, + + + // AccessibleRelationSet + cGetAccessibleRelationSetPackage = 0x1300, + + // AccessibleHypertext + cGetAccessibleHypertextPackage = 0x1400, + cActivateAccessibleHyperlinkPackage, + cGetAccessibleHyperlinkCountPackage, + cGetAccessibleHypertextExtPackage, + cGetAccessibleHypertextLinkIndexPackage, + cGetAccessibleHyperlinkPackage, + + // Accessible KeyBinding, Icon and Action + cGetAccessibleKeyBindingsPackage = 0x1500, + cGetAccessibleIconsPackage, + cGetAccessibleActionsPackage, + cDoAccessibleActionsPackage, + + // Utility methods + cSetTextContentsPackage = 0x1600, + cGetParentWithRolePackage, + cGetTopLevelObjectPackage, + cGetParentWithRoleElseRootPackage, + cGetObjectDepthPackage, + cGetActiveDescendentPackage, + + // Additional methods for Teton + cGetVirtualAccessibleNamePackage = 0x1700, + cRequestFocusPackage, + cSelectTextRangePackage, + cGetTextAttributesInRangePackage, + cGetSameTextAttributesInRangePackage, + cGetVisibleChildrenCountPackage, + cGetVisibleChildrenPackage, + cSetCaretPositionPackage, + cGetCaretLocationPackage + + + } PackageType; + + + /** + * Union of all package contents + */ + typedef union AllPackagesTag { + + // Initial Rendezvous packages + MemoryMappedFileCreatedPackage memoryMappedFileCreatedPackage; + + JavaVMCreatedPackage javaVMCreatedPackage; + JavaVMDestroyedPackage javaVMDestroyedPackage; + WindowsATCreatedPackage windowsATCreatedPackage; + WindowsATDestroyedPackage windowsATDestroyedPackage; + JavaVMPresentNotificationPackage javaVMPresentNotificationPackage; + WindowsATPresentNotificationPackage windowsATPresentNotificationPackage; + + // Core packages + ReleaseJavaObjectPackage releaseJavaObject; + GetAccessBridgeVersionPackage getAccessBridgeVersion; + + // Window packages + GetAccessibleContextFromHWNDPackage getAccessibleContextFromHWND; + GetHWNDFromAccessibleContextPackage getHWNDFromAccessibleContext; + + // AccessibleContext packages + GetAccessibleContextAtPackage getAccessibleContextAt; + GetAccessibleContextWithFocusPackage getAccessibleContextWithFocus; + GetAccessibleContextInfoPackage getAccessibleContextInfo; + GetAccessibleChildFromContextPackage getAccessibleChildFromContext; + GetAccessibleParentFromContextPackage getAccessibleParentFromContext; + + // AccessibleText packages + GetAccessibleTextInfoPackage getAccessibleTextInfo; + GetAccessibleTextItemsPackage getAccessibleTextItems; + GetAccessibleTextSelectionInfoPackage getAccessibleTextSelectionInfo; + GetAccessibleTextAttributeInfoPackage getAccessibleTextAttributeInfo; + GetAccessibleTextRectInfoPackage getAccessibleTextRectInfo; + GetAccessibleTextLineBoundsPackage getAccessibleTextLineBounds; + GetAccessibleTextRangePackage getAccessibleTextRange; + + // AccessibleValue packages + GetCurrentAccessibleValueFromContextPackage getCurrentAccessibleValueFromContext; + GetMaximumAccessibleValueFromContextPackage getMaximumAccessibleValueFromContext; + GetMinimumAccessibleValueFromContextPackage getMinimumAccessibleValueFromContext; + + // AccessibleSelection packages + AddAccessibleSelectionFromContextPackage addAccessibleSelectionFromContext; + ClearAccessibleSelectionFromContextPackage clearAccessibleSelectionFromContext; + GetAccessibleSelectionFromContextPackage getAccessibleSelectionFromContext; + GetAccessibleSelectionCountFromContextPackage getAccessibleSelectionCountFromContext; + IsAccessibleChildSelectedFromContextPackage isAccessibleChildSelectedFromContext; + RemoveAccessibleSelectionFromContextPackage removeAccessibleSelectionFromContext; + SelectAllAccessibleSelectionFromContextPackage selectAllAccessibleSelectionFromContext; + + // Event Notification Registration packages + AddJavaEventNotificationPackage addJavaEventNotification; + RemoveJavaEventNotificationPackage removeJavaEventNotification; + AddAccessibilityEventNotificationPackage addAccessibilityEventNotification; + RemoveAccessibilityEventNotificationPackage removeAccessibilityEventNotification; + + // Event contents packages + // PropertyChangePackage propertyChange; + PropertyCaretChangePackage propertyCaretChangePackage; + PropertyDescriptionChangePackage propertyDescriptionChangePackage; + PropertyNameChangePackage propertyNameChangePackage; + PropertySelectionChangePackage propertySelectionChangePackage; + PropertyStateChangePackage propertyStateChangePackage; + PropertyTextChangePackage propertyTextChangePackage; + PropertyValueChangePackage propertyValueChangePackage; + PropertyVisibleDataChangePackage propertyVisibleDataChangePackage; + PropertyChildChangePackage propertyChildChangePackage; + PropertyActiveDescendentChangePackage propertyActiveDescendentChangePackage; + + PropertyTableModelChangePackage propertyTableModelChangePackage; + + JavaShutdownPackage JavaShutdown; + FocusGainedPackage focusGained; + FocusLostPackage focusLost; + + CaretUpdatePackage caretUpdate; + + MouseClickedPackage mouseClicked; + MouseEnteredPackage mouseEntered; + MouseExitedPackage mouseExited; + MousePressedPackage mousePressed; + MouseReleasedPackage mouseReleased; + + MenuCanceledPackage menuCanceled; + MenuDeselectedPackage menuDeselected; + MenuSelectedPackage menuSelected; + PopupMenuCanceledPackage popupMenuCanceled; + PopupMenuWillBecomeInvisiblePackage popupMenuWillBecomeInvisible; + PopupMenuWillBecomeVisiblePackage popupMenuWillBecomeVisible; + + // AccessibleRelationSet + GetAccessibleRelationSetPackage getAccessibleRelationSet; + + // AccessibleHypertext + GetAccessibleHypertextPackage _getAccessibleHypertext; + ActivateAccessibleHyperlinkPackage _activateAccessibleHyperlink; + GetAccessibleHyperlinkCountPackage _getAccessibleHyperlinkCount; + GetAccessibleHypertextExtPackage _getAccessibleHypertextExt; + GetAccessibleHypertextLinkIndexPackage _getAccessibleHypertextLinkIndex; + GetAccessibleHyperlinkPackage _getAccessibleHyperlink; + + // Accessible KeyBinding, Icon and Action + GetAccessibleKeyBindingsPackage getAccessibleKeyBindings; + GetAccessibleIconsPackage getAccessibleIcons; + GetAccessibleActionsPackage getAccessibleActions; + DoAccessibleActionsPackage doAccessibleActions; + + // utility methods + SetTextContentsPackage _setTextContents; + GetParentWithRolePackage _getParentWithRole; + GetTopLevelObjectPackage _getTopLevelObject; + GetParentWithRoleElseRootPackage _getParentWithRoleElseRoot; + GetObjectDepthPackage _getObjectDepth; + GetActiveDescendentPackage _getActiveDescendent; + + // Additional methods for Teton + GetVirtualAccessibleNamePackage _getVirtualAccessibleName; + RequestFocusPackage _requestFocus; + SelectTextRangePackage _selectTextRange; + GetTextAttributesInRangePackage _getTextAttributesInRange; + GetVisibleChildrenCountPackage _getVisibleChildrenCount; + GetVisibleChildrenPackage _getVisibleChildren; + SetCaretPositionPackage _setCaretPosition; + + } AllPackages; + + + /** + * Union of all Java-initiated package contents + */ + typedef union JavaInitiatedPackagesTag { + + // Initial Rendezvous packages + JavaVMCreatedPackage javaVMCreatedPackage; + JavaVMDestroyedPackage javaVMDestroyedPackage; + JavaVMPresentNotificationPackage javaVMPresentNotificationPackage; + + // Event contents packages + PropertyCaretChangePackage propertyCaretChangePackage; + PropertyDescriptionChangePackage propertyDescriptionChangePackage; + PropertyNameChangePackage propertyNameChangePackage; + PropertySelectionChangePackage propertySelectionChangePackage; + PropertyStateChangePackage propertyStateChangePackage; + PropertyTextChangePackage propertyTextChangePackage; + PropertyValueChangePackage propertyValueChangePackage; + PropertyVisibleDataChangePackage propertyVisibleDataChangePackage; + PropertyChildChangePackage propertyChildChangePackage; + PropertyActiveDescendentChangePackage propertyActiveDescendentChangePackage; + + PropertyTableModelChangePackage propertyTableModelChangePackage; + + JavaShutdownPackage JavaShutdown; + FocusGainedPackage focusGained; + FocusLostPackage focusLost; + + CaretUpdatePackage caretUpdate; + + MouseClickedPackage mouseClicked; + MouseEnteredPackage mouseEntered; + MouseExitedPackage mouseExited; + MousePressedPackage mousePressed; + MouseReleasedPackage mouseReleased; + + MenuCanceledPackage menuCanceled; + MenuDeselectedPackage menuDeselected; + MenuSelectedPackage menuSelected; + PopupMenuCanceledPackage popupMenuCanceled; + PopupMenuWillBecomeInvisiblePackage popupMenuWillBecomeInvisible; + PopupMenuWillBecomeVisiblePackage popupMenuWillBecomeVisible; + + } JavaInitiatedPackages; + + + /** + * Union of all Windows-initiated package contents + */ + typedef union WindowsInitiatedPackagesTag { + + // Initial Rendezvous packages + MemoryMappedFileCreatedPackage memoryMappedFileCreatedPackage; + + WindowsATCreatedPackage windowsATCreatedPackage; + WindowsATDestroyedPackage windowsATDestroyedPackage; + WindowsATPresentNotificationPackage windowsATPresentNotificationPackage; + + // Core packages + ReleaseJavaObjectPackage releaseJavaObject; + GetAccessBridgeVersionPackage getAccessBridgeVersion; + + // Window packages + GetAccessibleContextFromHWNDPackage getAccessibleContextFromHWND; + GetHWNDFromAccessibleContextPackage getHWNDFromAccessibleContext; + + // AccessibleContext packages + GetAccessibleContextAtPackage getAccessibleContextAt; + GetAccessibleContextWithFocusPackage getAccessibleContextWithFocus; + GetAccessibleContextInfoPackage getAccessibleContextInfo; + GetAccessibleChildFromContextPackage getAccessibleChildFromContext; + GetAccessibleParentFromContextPackage getAccessibleParentFromContext; + + // AccessibleText packages + GetAccessibleTextInfoPackage getAccessibleTextInfo; + GetAccessibleTextItemsPackage getAccessibleTextItems; + GetAccessibleTextSelectionInfoPackage getAccessibleTextSelectionInfo; + GetAccessibleTextAttributeInfoPackage getAccessibleTextAttributeInfo; + GetAccessibleTextRectInfoPackage getAccessibleTextRectInfo; + GetAccessibleTextLineBoundsPackage getAccessibleTextLineBounds; + GetAccessibleTextRangePackage getAccessibleTextRange; + + // AccessibleValue packages + GetCurrentAccessibleValueFromContextPackage getCurrentAccessibleValueFromContext; + GetMaximumAccessibleValueFromContextPackage getMaximumAccessibleValueFromContext; + GetMinimumAccessibleValueFromContextPackage getMinimumAccessibleValueFromContext; + + // AccessibleSelection packages + AddAccessibleSelectionFromContextPackage addAccessibleSelectionFromContext; + ClearAccessibleSelectionFromContextPackage clearAccessibleSelectionFromContext; + GetAccessibleSelectionFromContextPackage getAccessibleSelectionFromContext; + GetAccessibleSelectionCountFromContextPackage getAccessibleSelectionCountFromContext; + IsAccessibleChildSelectedFromContextPackage isAccessibleChildSelectedFromContext; + RemoveAccessibleSelectionFromContextPackage removeAccessibleSelectionFromContext; + SelectAllAccessibleSelectionFromContextPackage selectAllAccessibleSelectionFromContext; + + // Event Notification Registration packages + AddJavaEventNotificationPackage addJavaEventNotification; + RemoveJavaEventNotificationPackage removeJavaEventNotification; + AddAccessibilityEventNotificationPackage addAccessibilityEventNotification; + RemoveAccessibilityEventNotificationPackage removeAccessibilityEventNotification; + + // AccessibleTable + GetAccessibleTableInfoPackage _getAccessibleTableInfo; + GetAccessibleTableCellInfoPackage _getAccessibleTableCellInfo; + + GetAccessibleTableRowHeaderPackage _getAccessibleTableRowHeader; + GetAccessibleTableColumnHeaderPackage _getAccessibleTableColumnHeader; + + GetAccessibleTableRowDescriptionPackage _getAccessibleTableRowDescription; + GetAccessibleTableColumnDescriptionPackage _getAccessibleTableColumnDescription; + + GetAccessibleTableRowSelectionCountPackage _getAccessibleTableRowSelectionCount; + IsAccessibleTableRowSelectedPackage _isAccessibleTableRowSelected; + GetAccessibleTableRowSelectionsPackage _getAccessibleTableRowSelections; + + GetAccessibleTableColumnSelectionCountPackage _getAccessibleTableColumnSelectionCount; + IsAccessibleTableColumnSelectedPackage _isAccessibleTableColumnSelected; + GetAccessibleTableColumnSelectionsPackage _getAccessibleTableColumnSelections; + + GetAccessibleTableRowPackage _getAccessibleTableRow; + GetAccessibleTableColumnPackage _getAccessibleTableColumn; + GetAccessibleTableIndexPackage _getAccessibleTableIndex; + + // AccessibleRelationSet + GetAccessibleRelationSetPackage _getAccessibleRelationSet; + + // Accessible KeyBindings, Icons and Actions + GetAccessibleKeyBindingsPackage _getAccessibleKeyBindings; + GetAccessibleIconsPackage _getAccessibleIcons; + GetAccessibleActionsPackage _getAccessibleActions; + DoAccessibleActionsPackage _doAccessibleActions; + + + IsSameObjectPackage _isSameObject; + + // utility methods + SetTextContentsPackage _setTextContents; + GetParentWithRolePackage _getParentWithRole; + GetTopLevelObjectPackage _getTopLevelObject; + GetParentWithRoleElseRootPackage _getParentWithRoleElseRoot; + GetObjectDepthPackage _getObjectDepth; + GetActiveDescendentPackage _getActiveDescendent; + + // Additional methods for Teton + GetVirtualAccessibleNamePackage _getVirtualAccessibleName; + RequestFocusPackage _requestFocus; + SelectTextRangePackage _selectTextRange; + GetTextAttributesInRangePackage _getTextAttributesInRange; + GetVisibleChildrenCountPackage _getVisibleChildrenCount; + GetVisibleChildrenPackage _getVisibleChildren; + SetCaretPositionPackage _setCaretPosition; + + + } WindowsInitiatedPackages; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/runtime/include/win32/jawt_md.h b/runtime/include/win32/jawt_md.h new file mode 100644 index 0000000..7d43ff8 --- /dev/null +++ b/runtime/include/win32/jawt_md.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef _JAVASOFT_JAWT_MD_H_ +#define _JAVASOFT_JAWT_MD_H_ + +#include +#include "jawt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Win32-specific declarations for AWT native interface. + * See notes in jawt.h for an example of use. + */ +typedef struct jawt_Win32DrawingSurfaceInfo { + /* Native window, DDB, or DIB handle */ + union { + HWND hwnd; + HBITMAP hbitmap; + void* pbits; + }; + /* + * This HDC should always be used instead of the HDC returned from + * BeginPaint() or any calls to GetDC(). + */ + HDC hdc; + HPALETTE hpalette; +} JAWT_Win32DrawingSurfaceInfo; + +#ifdef __cplusplus +} +#endif + +#endif /* !_JAVASOFT_JAWT_MD_H_ */ diff --git a/runtime/include/win32/jni_md.h b/runtime/include/win32/jni_md.h new file mode 100644 index 0000000..b8dce62 --- /dev/null +++ b/runtime/include/win32/jni_md.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef _JAVASOFT_JNI_MD_H_ +#define _JAVASOFT_JNI_MD_H_ + +#define JNIEXPORT __declspec(dllexport) +#define JNIIMPORT __declspec(dllimport) +#define JNICALL __stdcall + +typedef long jint; +typedef __int64 jlong; +typedef signed char jbyte; + +#endif /* !_JAVASOFT_JNI_MD_H_ */ diff --git a/runtime/jre/ASSEMBLY_EXCEPTION b/runtime/jre/ASSEMBLY_EXCEPTION new file mode 100644 index 0000000..065b8d9 --- /dev/null +++ b/runtime/jre/ASSEMBLY_EXCEPTION @@ -0,0 +1,27 @@ + +OPENJDK ASSEMBLY EXCEPTION + +The OpenJDK source code made available by Oracle America, Inc. (Oracle) at +openjdk.java.net ("OpenJDK Code") is distributed under the terms of the GNU +General Public License version 2 +only ("GPL2"), with the following clarification and special exception. + + Linking this OpenJDK Code statically or dynamically with other code + is making a combined work based on this library. Thus, the terms + and conditions of GPL2 cover the whole combination. + + As a special exception, Oracle gives you permission to link this + OpenJDK Code with certain code licensed by Oracle as indicated at + http://openjdk.java.net/legal/exception-modules-2007-05-08.html + ("Designated Exception Modules") to produce an executable, + regardless of the license terms of the Designated Exception Modules, + and to copy and distribute the resulting executable under GPL2, + provided that the Designated Exception Modules continue to be + governed by the licenses under which they were offered by Oracle. + +As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code +to build an executable that includes those portions of necessary code that +Oracle could not provide under GPL2 (or that Oracle has provided under GPL2 +with the Classpath exception). If you modify or add to the OpenJDK code, +that new GPL2 code may still be combined with Designated Exception Modules +if the new code is made subject to this exception by its copyright holder. diff --git a/runtime/jre/LICENSE b/runtime/jre/LICENSE new file mode 100644 index 0000000..8b400c7 --- /dev/null +++ b/runtime/jre/LICENSE @@ -0,0 +1,347 @@ +The GNU General Public License (GPL) + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public License is intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. This General Public License applies to +most of the Free Software Foundation's software and to any other program whose +authors commit to using it. (Some other Free Software Foundation software is +covered by the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom to +distribute copies of free software (and charge for this service if you wish), +that you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs; and that you know you +can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny +you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for +a fee, you must give the recipients all the rights that you have. You must +make sure that they, too, receive or can get the source code. And you must +show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) +offer you this license which gives you legal permission to copy, distribute +and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients to +know that what they have is not the original, so that any problems introduced +by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program proprietary. +To prevent this, we have made it clear that any patent must be licensed for +everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms of +this General Public License. The "Program", below, refers to any such program +or work, and a "work based on the Program" means either the Program or any +derivative work under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with modifications and/or +translated into another language. (Hereinafter, translation is included +without limitation in the term "modification".) Each licensee is addressed as +"you". + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running the Program is +not restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made by +running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as +you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and give any other recipients of the +Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may +at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus +forming a work based on the Program, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or + in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of + this License. + + c) If the modified program normally reads commands interactively when run, + you must cause it, when started running for such interactive use in the + most ordinary way, to print or display an announcement including an + appropriate copyright notice and a notice that there is no warranty (or + else, saying that you provide a warranty) and that users may redistribute + the program under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive but does + not normally print such an announcement, your work based on the Program is + not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be reasonably +considered independent and separate works in themselves, then this License, and +its terms, do not apply to those sections when you distribute them as separate +works. But when you distribute the same sections as part of a whole which is a +work based on the Program, the distribution of the whole must be on the terms +of this License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise the +right to control the distribution of derivative or collective works based on +the Program. + +In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or +distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 and +2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 above + on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only + for noncommercial distribution and only if you received the program in + object code or executable form with such an offer, in accord with + Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and installation +of the executable. However, as a special exception, the source code +distributed need not include anything that is normally distributed (in either +source or binary form) with the major components (compiler, kernel, and so on) +of the operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the source +code from the same place counts as distribution of the source code, even though +third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate +your rights under this License. However, parties who have received copies, or +rights, from you under this License will not have their licenses terminated so +long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not +accept this License. Therefore, by modifying or distributing the Program (or +any work based on the Program), you indicate your acceptance of this License to +do so, and all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance by +third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions +are imposed on you (whether by court order, agreement or otherwise) that +contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not distribute the Program at all. +For example, if a patent license would not permit royalty-free redistribution +of the Program by all those who receive copies directly or indirectly through +you, then the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In +such case, this License incorporates the limitation as if written in the body +of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the +General Public License from time to time. Such new versions will be similar in +spirit to the present version, but may differ in detail to address new problems +or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any later +version", you have the option of following the terms and conditions either of +that version or of any later version published by the Free Software Foundation. +If the Program does not specify a version number of this License, you may +choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, +write to the Free Software Foundation; we sometimes make exceptions for this. +Our decision will be guided by the two goals of preserving the free status of +all derivatives of our free software and of promoting the sharing and reuse of +software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, +YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR +INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA +BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER +OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively convey the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + + Copyright (C) + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it +starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes + with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free + software, and you are welcome to redistribute it under certain conditions; + type 'show c' for details. + +The hypothetical commands 'show w' and 'show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may be +called something other than 'show w' and 'show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the program, if necessary. Here +is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + 'Gnomovision' (which makes passes at compilers) written by James Hacker. + + signature of Ty Coon, 1 April 1989 + + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General Public +License instead of this License. + + +"CLASSPATH" EXCEPTION TO THE GPL + +Certain source files distributed by Oracle America and/or its affiliates are +subject to the following clarification and special exception to the GPL, but +only where Oracle has expressly included in the particular source file's header +the words "Oracle designates this particular file as subject to the "Classpath" +exception as provided by Oracle in the LICENSE file that accompanied this code." + + Linking this library statically or dynamically with other modules is making + a combined work based on this library. Thus, the terms and conditions of + the GNU General Public License cover the whole combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules, + and to copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent module, + the terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. If + you modify this library, you may extend this exception to your version of + the library, but you are not obligated to do so. If you do not wish to do + so, delete this exception statement from your version. diff --git a/runtime/jre/THIRD_PARTY_README b/runtime/jre/THIRD_PARTY_README new file mode 100644 index 0000000..d19de8a --- /dev/null +++ b/runtime/jre/THIRD_PARTY_README @@ -0,0 +1,3318 @@ +DO NOT TRANSLATE OR LOCALIZE. +----------------------------- + +%% This notice is provided with respect to ASM Bytecode Manipulation +Framework v5.0.3, which may be included with JRE 8, and JDK 8, and +OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2000-2011 France T??l??com +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to BSDiff v4.3, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright 2003-2005 Colin Percival +All rights reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted providing that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to CodeViewer 1.0, which may be +included with JDK 8. + +--- begin of LICENSE --- + +Copyright 1999 by CoolServlets.com. + +Any errors or suggested improvements to this class can be reported as +instructed on CoolServlets.com. We hope you enjoy this program... your +comments will encourage further development! This software is distributed +under the terms of the BSD License. Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +Neither name of CoolServlets.com nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Cryptix AES 3.2.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Cryptix General License + +Copyright (c) 1995-2005 The Cryptix Foundation Limited. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND +CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to CUP Parser Generator for +Java 0.11b, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided +that the above copyright notice appear in all copies and that both the +copyright notice and this permission notice and warranty disclaimer appear in +supporting documentation, and that the names of the authors or their +employers not be used in advertising or publicity pertaining to distribution of +the software without specific, written prior permission. + +The authors and their employers disclaim all warranties with regard to +this software, including all implied warranties of merchantability and fitness. +In no event shall the authors or their employers be liable for any special, +indirect or consequential damages or any damages whatsoever resulting from +loss of use, data or profits, whether in an action of contract, negligence or +other tortious action, arising out of or in connection with the use or +performance of this software. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to DejaVu fonts v2.34, which may be +included with JRE 8, and JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +TeX Gyre DJV Math +----------------- +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. + +Math extensions done by B. Jackowski, P. Strzelczyk and P. Pianowski +(on behalf of TeX users groups) are in public domain. + +Letters imported from Euler Fraktur from AMSfonts are (c) American +Mathematical Society (see below). +Bitstream Vera Fonts Copyright +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera +is a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated documentation +files (the "Font Software"), to reproduce and distribute the Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit persons +to whom the Font Software is furnished to do so, subject to the following +conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the +fonts are renamed to names not containing either the words "Bitstream" +or the word "Vera". + +This License becomes null and void to the extent applicable to Fonts or +Font Software that has been modified and is distributed under the +"Bitstream Vera" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN +THE FONT SOFTWARE. +Except as contained in this notice, the names of GNOME, the GNOME +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the GNOME Foundation or +Bitstream Inc., respectively. +For further information, contact: fonts at gnome dot org. + +AMSFonts (v. 2.2) copyright + +The PostScript Type 1 implementation of the AMSFonts produced by and +previously distributed by Blue Sky Research and Y&Y, Inc. are now freely +available for general use. This has been accomplished through the +cooperation +of a consortium of scientific publishers with Blue Sky Research and Y&Y. +Members of this consortium include: + +Elsevier Science IBM Corporation Society for Industrial and Applied +Mathematics (SIAM) Springer-Verlag American Mathematical Society (AMS) + +In order to assure the authenticity of these fonts, copyright will be +held by the American Mathematical Society. This is not meant to restrict +in any way the legitimate use of the fonts, such as (but not limited to) +electronic distribution of documents containing these fonts, inclusion of +these fonts into other public domain or commercial font collections or computer +applications, use of the outline data to create derivative fonts and/or +faces, etc. However, the AMS does require that the AMS copyright notice be +removed from any derivative versions of the fonts which have been altered in +any way. In addition, to ensure the fidelity of TeX documents using Computer +Modern fonts, Professor Donald Knuth, creator of the Computer Modern faces, +has requested that any alterations which yield different font metrics be +given a different name. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Document Object Model (DOM) Level 2 +& 3, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +W3C SOFTWARE NOTICE AND LICENSE + +http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +This work (and included software, documentation such as READMEs, or other +related items) is being provided by the copyright holders under the following +license. By obtaining, using and/or copying this work, you (the licensee) +agree that you have read, understood, and will comply with the following terms +and conditions. + +Permission to copy, modify, and distribute this software and its +documentation, with or without modification, for any purpose and without fee +or royalty is hereby granted, provided that you include the following on ALL +copies of the software and documentation or portions thereof, including +modifications: + + 1.The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. + + 2.Any pre-existing intellectual property disclaimers, notices, or terms and + conditions. If none exist, the W3C Software Short Notice should be included + (hypertext is preferred, text is permitted) within the body of any + redistributed or derivative code. + + 3.Notice of any changes or modifications to the files, including the date + changes were made. (We recommend you provide URIs to the location from + which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS +MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR +PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY +THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL +OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR +DOCUMENTATION. The name and trademarks of copyright holders may NOT be used +in advertising or publicity pertaining to the software without specific, +written prior permission. Title to copyright in this software and any +associated documentation will at all times remain with copyright holders. + +____________________________________ + +This formulation of W3C's notice and license became active on December 31 +2002. This version removes the copyright ownership notice such that this +license can be used with materials other than those owned by the W3C, reflects +that ERCIM is now a host of the W3C, includes references to this specific +dated version of the license, and removes the ambiguous grant of "use". +Otherwise, this version is the same as the previous version and is written so +as to preserve the Free Software Foundation's assessment of GPL compatibility +and OSI's certification under the Open Source Definition. Please see our +Copyright FAQ for common questions about using materials from our site, +including specific terms and conditions for packages like libwww, Amaya, and +Jigsaw. Other questions about this notice can be directed to +site-policy@w3.org. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Dynalink v0.5, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2009-2013, Attila Szegedi + +All rights reserved.Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met:* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. * Redistributions in +binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or other +materials provided with the distribution. * Neither the name of Attila +Szegedi nor the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Elliptic Curve Cryptography, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +You are receiving a copy of the Elliptic Curve Cryptography library in source +form with the JDK 8 and OpenJDK 8 source distributions, and as object code in +the JRE 8 & JDK 8 runtimes. + +In the case of the JRE & JDK runtimes, the terms of the Oracle license do +NOT apply to the Elliptic Curve Cryptography library; it is licensed under the +following license, separately from Oracle's JDK & JRE. If you do not wish to +install the Elliptic Curve Cryptography library, you may delete the +Elliptic Curve Cryptography library: + - On Solaris and Linux systems: delete $(JAVA_HOME)/lib/libsunec.so + - On Windows systems: delete $(JAVA_HOME)\bin\sunec.dll + - On Mac systems, delete: + for JRE: /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/libsunec.dylib + for JDK: $(JAVA_HOME)/jre/lib/libsunec.dylib + +Written Offer for ECC Source Code + For third party technology that you receive from Oracle in binary form + which is licensed under an open source license that gives you the right + to receive the source code for that binary, you can obtain a copy of + the applicable source code from this page: + http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/tip/src/share/native/sun/security/ec/impl + + If the source code for the technology was not provided to you with the + binary, you can also receive a copy of the source code on physical + media by submitting a written request to: + + Oracle America, Inc. + Attn: Associate General Counsel, + Development and Engineering Legal + 500 Oracle Parkway, 10th Floor + Redwood Shores, CA 94065 + + Or, you may send an email to Oracle using the form at: + http://www.oracle.com/goto/opensourcecode/request + + Your request should include: + - The name of the component or binary file(s) for which you are requesting + the source code + - The name and version number of the Oracle product containing the binary + - The date you received the Oracle product + - Your name + - Your company name (if applicable) + - Your return mailing address and email and + - A telephone number in the event we need to reach you. + + We may charge you a fee to cover the cost of physical media and processing. + Your request must be sent (i) within three (3) years of the date you + received the Oracle product that included the component or binary + file(s) that are the subject of your request, or (ii) in the case of + code licensed under the GPL v3, for as long as Oracle offers spare + parts or customer support for that product model. + +--- begin of LICENSE --- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to ECMAScript Language +Specification ECMA-262 Edition 5.1 which may be included with +JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright notice +Copyright ?? 2011 Ecma International +Ecma International +Rue du Rhone 114 +CH-1204 Geneva +Tel: +41 22 849 6000 +Fax: +41 22 849 6001 +Web: http://www.ecma-international.org + +This document and possible translations of it may be copied and furnished to +others, and derivative works that comment on or otherwise explain it or assist +in its implementation may be prepared, copied, published, and distributed, in +whole or in part, without restriction of any kind, provided that the above +copyright notice and this section are included on all such copies and derivative +works. However, this document itself may not be modified in any way, including +by removing the copyright notice or references to Ecma International, except as +needed for the purpose of developing any document or deliverable produced by +Ecma International (in which case the rules applied to copyrights must be +followed) or as required to translate it into languages other than English. The +limited permissions granted above are perpetual and will not be revoked by Ecma +International or its successors or assigns. This document and the information +contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL +DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY +WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP +RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE." Software License + +All Software contained in this document ("Software)" is protected by copyright +and is being made available under the "BSD License", included below. This +Software may be subject to third party rights (rights from parties other than +Ecma International), including patent rights, and no licenses under such third +party rights are granted under this license even if the third party concerned is +a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS +AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR +INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO +IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the authors nor Ecma International may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to freebXML Registry 3.0 & 3.1, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +freebxml: Copyright (c) 2001 freebxml.org. All rights reserved. + +The names "The freebXML Registry Project" and "freebxml Software +Foundation" must not be used to endorse or promote products derived +from this software or be used in a product name without prior +written permission. For written permission, please contact +ebxmlrr-team@lists.sourceforge.net. + +This software consists of voluntary contributions made by many individuals +on behalf of the the freebxml Software Foundation. For more information on +the freebxml Software Foundation, please see . + +This product includes software developed by the Apache Software Foundation +(http://www.apache.org/). + +The freebxml License, Version 1.1 5 +Copyright (c) 2001 freebxml.org. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. The end-user documentation included with the redistribution, if + any, must include the following acknowlegement: + "This product includes software developed by + freebxml.org (http://www.freebxml.org/)." + Alternately, this acknowlegement may appear in the software itself, + if and wherever such third-party acknowlegements normally appear. + + 4. The names "The freebXML Registry Project", "freebxml Software + Foundation" must not be used to endorse or promote products derived + from this software without prior written permission. For written + permission, please contact ebxmlrr-team@lists.sourceforge.net. + + 5. Products derived from this software may not be called "freebxml", + "freebXML Registry" nor may freebxml" appear in their names without + prior written permission of the freebxml Group. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE freebxml SOFTWARE FOUNDATION OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to IAIK PKCS#11 Wrapper, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +IAIK PKCS#11 Wrapper License + +Copyright (c) 2002 Graz University of Technology. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: + + "This product includes software developed by IAIK of Graz University of + Technology." + + Alternately, this acknowledgment may appear in the software itself, if and + wherever such third-party acknowledgments normally appear. + +4. The names "Graz University of Technology" and "IAIK of Graz University of + Technology" must not be used to endorse or promote products derived from this + software without prior written permission. + +5. Products derived from this software may not be called "IAIK PKCS Wrapper", + nor may "IAIK" appear in their name, without prior written permission of + Graz University of Technology. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 1995-2010 International Business Machines Corporation and others + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +provided that the above copyright notice(s) and this permission notice appear +in all copies of the Software and that both the above copyright notice(s) and +this permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN +NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE +LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization of the copyright holder. +All trademarks and registered trademarks mentioned herein are the property of +their respective owners. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to IJG JPEG 6b, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Jing 20030619, which may +be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2001-2003 Thai Open Source Software Center Ltd All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the name of the Thai Open Source Software Center Ltd nor +the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Joni v2.1.16, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2017 JRuby Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to JOpt-Simple v3.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + Copyright (c) 2004-2009 Paul R. Holser, Jr. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kerberos functionality, which +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + (C) Copyright IBM Corp. 1999 All Rights Reserved. + Copyright 1997 The Open Group Research Institute. All rights reserved. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kerberos functionality from +FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + Copyright (C) 1998 by the FundsXpress, INC. + + All rights reserved. + + Export of this software from the United States of America may require + a specific license from the United States Government. It is the + responsibility of any person or organization contemplating export to + obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of FundsXpress. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. FundsXpress makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Kronos OpenGL headers, which may be +included with JDK 8 and OpenJDK 8 source distributions. + +--- begin of LICENSE --- + + Copyright (c) 2007 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and/or associated documentation files (the "Materials"), to + deal in the Materials without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Materials, and to permit persons to whom the Materials are + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE + MATERIALS. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Portions Copyright Eastman Kodak Company 1991-2003 + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to libpng 1.6.37, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + +TRADEMARK: + +The name "libpng" has not been registered by the Copyright owner +as a trademark in any jurisdiction. However, because libpng has +been distributed and maintained world-wide, continually since 1995, +the Copyright owner claims "common-law trademark protection" in any +jurisdiction where common-law trademark is recognized. + +OSI CERTIFICATION: + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is +a certification mark of the Open Source Initiative. OSI has not addressed +the additional disclaimers inserted at version 1.0.7. + +EXPORT CONTROL: + +The Copyright owner believes that the Export Control Classification +Number (ECCN) for libpng is EAR99, which means not subject to export +controls or International Traffic in Arms Regulations (ITAR) because +it is open source, publicly available software, that does not contain +any encryption software. See the EAR, paragraphs 734.3(b)(3) and +734.7(b). + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +July 15, 2018 + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to GIFLIB 5.2.1 & libungif 4.1.3, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Little CMS 2.11, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Little CMS +Copyright (c) 1998-2020 Marti Maria Saguer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Lucida is a registered trademark or trademark of Bigelow & Holmes in the +U.S. and other countries. + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Mesa 3D Graphics Library v4.1, +which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions. + +--- begin of LICENSE --- + + Mesa 3-D Graphics Library v19.2.1 + + Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Attention, Contributors + +When contributing to the Mesa project you must agree to the licensing terms +of the component to which you're contributing. +The following section lists the primary components of the Mesa distribution +and their respective licenses. +Mesa Component Licenses + + + +Component Location License +------------------------------------------------------------------ +Main Mesa code src/mesa/ MIT +Device drivers src/mesa/drivers/* MIT, generally + +Gallium code src/gallium/ MIT + +Ext headers GL/glext.h Khronos + GL/glxext.h Khronos + GL/wglext.h Khronos + KHR/khrplatform.h Khronos + +***************************************************************************** + +---- +include/GL/gl.h : + + + Mesa 3-D graphics library + + Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + Copyright (C) 2009 VMware, Inc. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + ***************************************************************************** + +---- +include/GL/glext.h +include/GL/glxext.h +include/GL/wglxext.h : + + + Copyright (c) 2013 - 2018 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + + ***************************************************************************** + +---- +include/KHR/khrplatform.h : + + Copyright (c) 2008 - 2018 The Khronos Group Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + + ***************************************************************************** + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Mozilla Network Security +Services (NSS), which is supplied with the JDK test suite in the OpenJDK +source code repository. It is licensed under Mozilla Public License (MPL), +version 2.0. + +The NSS libraries are supplied in executable form, built from unmodified +NSS source code labeled with the "NSS_3_16_RTM" HG tag. + +The NSS source code is available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/src + +The NSS libraries are available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/lib + +--- begin of LICENSE --- + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to PC/SC Lite v1.8.26, +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +--- begin of LICENSE --- + +Copyright (c) 1999-2003 David Corcoran +Copyright (c) 2001-2011 Ludovic Rousseau +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +Changes to this license can be made only by the copyright author with +explicit written consent. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to PorterStemmer v4, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +See: http://tartarus.org/~martin/PorterStemmer + +The software is completely free for any purpose, unless notes at the head of +the program text indicates otherwise (which is rare). In any case, the notes +about licensing are never more restrictive than the BSD License. + +In every case where the software is not written by me (Martin Porter), this +licensing arrangement has been endorsed by the contributor, and it is +therefore unnecessary to ask the contributor again to confirm it. + +I have not asked any contributors (or their employers, if they have them) for +proofs that they have the right to distribute their software in this way. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Relax NG Object/Parser v.20050510, +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) Kohsuke Kawaguchi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to RelaxNGCC v1.12, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: + + "This product includes software developed by Daisuke Okajima + and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)." + +Alternately, this acknowledgment may appear in the software itself, if and +wherever such third-party acknowledgments normally appear. + +4. The names of the copyright holders must not be used to endorse or promote + products derived from this software without prior written permission. For + written permission, please contact the copyright holders. + +5. Products derived from this software may not be called "RELAXNGCC", nor may + "RELAXNGCC" appear in their name, without prior written permission of the + copyright holders. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE APACHE +SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Relax NG Datatype 1.0, which +may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +-------------------------------------------------------------------------------- + +%% This notice is provided with respect to SoftFloat version 2b, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM. + +--- begin of LICENSE --- + +Use of any of this software is governed by the terms of the license below: + +SoftFloat was written by me, John R. Hauser. This work was made possible in +part by the International Computer Science Institute, located at Suite 600, +1947 Center Street, Berkeley, California 94704. Funding was partially +provided by the National Science Foundation under grant MIP-9311980. The +original version of this code was written as part of a project to build +a fixed-point vector processor in collaboration with the University of +California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. + +THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort +has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT +TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO +PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL +LOSSES, COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO +FURTHERMORE EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER +SCIENCE INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, +COSTS, OR OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE +SOFTWARE. + +Derivative works are acceptable, even for commercial purposes, provided +that the minimal documentation requirements stated in the source code are +satisfied. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Sparkle 1.5, +which may be included with JRE 8 on Mac OS X. + +--- begin of LICENSE --- + +Copyright (c) 2012 Sparkle.org and Andy Matuschak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% Portions licensed from Taligent, Inc. + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Thai Dictionary, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (C) 1982 The Royal Institute, Thai Royal Government. + +Copyright (C) 1998 National Electronics and Computer Technology Center, +National Science and Technology Development Agency, +Ministry of Science Technology and Environment, +Thai Royal Government. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1 +which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Unicode Terms of Use + +For the general privacy policy governing access to this site, see the Unicode +Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and +Trademark Usage Policy. + +A. Unicode Copyright. + 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. + + 2. Certain documents and files on this website contain a legend indicating + that "Modification is permitted." Any person is hereby authorized, + without fee, to modify such documents and files to create derivative + works conforming to the Unicode?? Standard, subject to Terms and + Conditions herein. + + 3. Any person is hereby authorized, without fee, to view, use, reproduce, + and distribute all documents and files solely for informational + purposes in the creation of products supporting the Unicode Standard, + subject to the Terms and Conditions herein. + + 4. Further specifications of rights and restrictions pertaining to the use + of the particular set of data files known as the "Unicode Character + Database" can be found in Exhibit 1. + + 5. Each version of the Unicode Standard has further specifications of + rights and restrictions of use. For the book editions (Unicode 5.0 and + earlier), these are found on the back of the title page. The online + code charts carry specific restrictions. All other files, including + online documentation of the core specification for Unicode 6.0 and + later, are covered under these general Terms of Use. + + 6. No license is granted to "mirror" the Unicode website where a fee is + charged for access to the "mirror" site. + + 7. Modification is not permitted with respect to this document. All copies + of this document must be verbatim. + +B. Restricted Rights Legend. Any technical data or software which is licensed + to the United States of America, its agencies and/or instrumentalities + under this Agreement is commercial technical data or commercial computer + software developed exclusively at private expense as defined in FAR 2.101, + or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, + duplication, or disclosure by the Government is subject to restrictions as + set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov + 1995) and this Agreement. For Software, in accordance with FAR 12-212 or + DFARS 227-7202, as applicable, use, duplication or disclosure by the + Government is subject to the restrictions set forth in this Agreement. + +C. Warranties and Disclaimers. + 1. This publication and/or website may include technical or typographical + errors or other inaccuracies . Changes are periodically added to the + information herein; these changes will be incorporated in new editions + of the publication and/or website. Unicode may make improvements and/or + changes in the product(s) and/or program(s) described in this + publication and/or website at any time. + + 2. If this file has been purchased on magnetic or optical media from + Unicode, Inc. the sole and exclusive remedy for any claim will be + exchange of the defective media within ninety (90) days of original + purchase. + + 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS + PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, + OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. + UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR + OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH + ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. + +D. Waiver of Damages. In no event shall Unicode or its licensors be liable for + any special, incidental, indirect or consequential damages of any kind, or + any damages whatsoever, whether or not Unicode was advised of the + possibility of the damage, including, without limitation, those resulting + from the following: loss of use, data or profits, in connection with the + use, modification or distribution of this information or its derivatives. + +E.Trademarks & Logos. + 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, + Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of + Unicode, Inc. Use of the information and materials found on this + website indicates your acknowledgement of Unicode, Inc.???s exclusive + worldwide rights in the Unicode Word Mark, the Unicode Logo, and the + Unicode trade names. + + 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark + Policy???) are incorporated herein by reference and you agree to abide by + the provisions of the Trademark Policy, which may be changed from time + to time in the sole discretion of Unicode, Inc. + + 3. All third party trademarks referenced herein are the property of their + respective owners. + +Miscellaneous. + 1. Jurisdiction and Venue. This server is operated from a location in the + State of California, United States of America. Unicode makes no + representation that the materials are appropriate for use in other + locations. If you access this server from other locations, you are + responsible for compliance with local laws. This Agreement, all use of + this site and any claims and damages resulting from use of this site are + governed solely by the laws of the State of California without regard to + any principles which would apply the laws of a different jurisdiction. + The user agrees that any disputes regarding this site shall be resolved + solely in the courts located in Santa Clara County, California. The user + agrees said courts have personal jurisdiction and agree to waive any + right to transfer the dispute to any other forum. + + 2. Modification by Unicode. Unicode shall have the right to modify this + Agreement at any time by posting it to this site. The user may not + assign any part of this Agreement without Unicode???s prior written + consent. + + 3. Taxes. The user agrees to pay any taxes arising from access to this + website or use of the information herein, except for those based on + Unicode???s net income. + + 4. Severability. If any provision of this Agreement is declared invalid or + unenforceable, the remaining provisions of this Agreement shall remain + in effect. + + 5. Entire Agreement. This Agreement constitutes the entire agreement + between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF +online code charts under the directory http://www.unicode.org/Public/. +Software includes any source code published in the Unicode Standard or under +the directories http://www.unicode.org/Public/, +http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. + +NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, +INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA +FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO +BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT +AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR +SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the +Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and any associated documentation (the "Data Files") +or Unicode software and any associated documentation (the "Software") to deal +in the Data Files or Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, and/or +sell copies of the Data Files or Software, and to permit persons to whom the +Data Files or Software are furnished to do so, provided that (a) the above +copyright notice(s) and this permission notice appear with all copies of the +Data Files or Software, (b) both the above copyright notice(s) and this +permission notice appear in associated documentation, and (c) there is clear +notice in each modified Data File or in the Software as well as in the +documentation associated with the Data File(s) or Software that the data or +software has been modified. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN +THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE +DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. + +Unicode and the Unicode logo are trademarks of Unicode, Inc. in the United +States and other countries. All third party trademarks referenced herein are +the property of their respective owners. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to UPX v3.01, which may be included +with JRE 8 on Windows. + +--- begin of LICENSE --- + +Use of any of this software is governed by the terms of the license below: + + + ooooo ooo ooooooooo. ooooooo ooooo + `888' `8' `888 `Y88. `8888 d8' + 888 8 888 .d88' Y888..8P + 888 8 888ooo88P' `8888' + 888 8 888 .8PY888. + `88. .8' 888 d8' `888b + `YbodP' o888o o888o o88888o + + + The Ultimate Packer for eXecutables + Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar + http://wildsau.idv.uni-linz.ac.at/mfx/upx.html + http://www.nexus.hu/upx + http://upx.tsx.org + + +PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN +TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. + + +ABSTRACT +======== + + UPX and UCL are copyrighted software distributed under the terms + of the GNU General Public License (hereinafter the "GPL"). + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + As a special exception we grant the free usage of UPX for all + executables, including commercial programs. + See below for details and restrictions. + + +COPYRIGHT +========= + + UPX and UCL are copyrighted software. All rights remain with the authors. + + UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + UPX is Copyright (C) 1996-2000 Laszlo Molnar + + UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer + + +GNU GENERAL PUBLIC LICENSE +========================== + + UPX and the UCL library are free software; you can redistribute them + and/or modify them under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + UPX and UCL are distributed in the hope that they will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. + + +SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES +============================================ + + The stub which is imbedded in each UPX compressed program is part + of UPX and UCL, and contains code that is under our copyright. The + terms of the GNU General Public License still apply as compressing + a program is a special form of linking with our stub. + + Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special + permission to freely use and distribute all UPX compressed programs + (including commercial ones), subject to the following restrictions: + + 1. You must compress your program with a completely unmodified UPX + version; either with our precompiled version, or (at your option) + with a self compiled version of the unmodified UPX sources as + distributed by us. + 2. This also implies that the UPX stub must be completely unmodfied, i.e. + the stub imbedded in your compressed program must be byte-identical + to the stub that is produced by the official unmodified UPX version. + 3. The decompressor and any other code from the stub must exclusively get + used by the unmodified UPX stub for decompressing your program at + program startup. No portion of the stub may get read, copied, + called or otherwise get used or accessed by your program. + + +ANNOTATIONS +=========== + + - You can use a modified UPX version or modified UPX stub only for + programs that are compatible with the GNU General Public License. + + - We grant you special permission to freely use and distribute all UPX + compressed programs. But any modification of the UPX stub (such as, + but not limited to, removing our copyright string or making your + program non-decompressible) will immediately revoke your right to + use and distribute a UPX compressed program. + + - UPX is not a software protection tool; by requiring that you use + the unmodified UPX version for your proprietary programs we + make sure that any user can decompress your program. This protects + both you and your users as nobody can hide malicious code - + any program that cannot be decompressed is highly suspicious + by definition. + + - You can integrate all or part of UPX and UCL into projects that + are compatible with the GNU GPL, but obviously you cannot grant + any special exceptions beyond the GPL for our code in your project. + + - We want to actively support manufacturers of virus scanners and + similar security software. Please contact us if you would like to + incorporate parts of UPX or UCL into such a product. + + + +Markus F.X.J. Oberhumer Laszlo Molnar +markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu + +Linz, Austria, 25 Feb 2000 + +Additional License(s) + +The UPX license file is at http://upx.sourceforge.net/upx-license.html. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to Xfree86-VidMode Extension 1.0, +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +--- begin of LICENSE --- + +Version 1.1 of XFree86 ProjectLicence. + +Copyright (C) 1994-2004 The XFree86 Project, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicence, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so,subject to the following conditions: + + 1. Redistributions of source code must retain the above copyright + notice,this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution, and in the same place + and form as other copyright, license and disclaimer information. + + 3. The end-user documentation included with the redistribution, if any,must + include the following acknowledgment: "This product includes + software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and + its contributors", in the same place and form as other third-party + acknowledgments. Alternately, this acknowledgment may appear in the software + itself, in the same form and location as other such third-party + acknowledgments. + + 4. Except as contained in this notice, the name of The XFree86 Project,Inc + shall not be used in advertising or otherwise to promote the sale, use + or other dealings in this Software without prior written authorization from + The XFree86 Project, Inc. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to xwd v1.0.7, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + +xwd utility + +--- begin of LICENSE --- + +Copyright 1994 Hewlett-Packard Co. +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +--- end of LICENSE --- +_____________________________ +Copyright notice for HPkeysym.h: +/* + +Copyright 1987, 1998 The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Hewlett Packard +or Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD +TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. Hewlett-Packard shall not be liable for errors +contained herein or direct, indirect, special, incidental or +consequential damages in connection with the furnishing, +performance, or use of this material. + +*/ + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to zlib v1.2.11, which may be included +with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to the following which may be +included with JRE 8, JDK 8, and OpenJDK 8. + + Apache Commons Math 3.2 + Apache Derby 10.11.1.2 + Apache Jakarta BCEL 5.1 + Apache Santuario XML Security for Java 2.1.3 + Apache Xalan-Java 2.7.2 + Apache Xerces Java 2.10.0 + Apache XML Resolver 1.1 + + +--- begin of LICENSE --- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to OASIS PKCS #11 Cryptographic Token +Interface v3.0, which may be included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright © OASIS Open 2020. All Rights Reserved. + + All capitalized terms in the following text have the meanings +assigned to them in the OASIS Intellectual Property Rights Policy (the +"OASIS IPR Policy"). The full Policy may be found at the OASIS website: +[http://www.oasis-open.org/policies-guidelines/ipr] + + This document and translations of it may be copied and furnished to +others, and derivative works that comment on or otherwise explain it or +assist in its implementation may be prepared, copied, published, and +distributed, in whole or in part, without restriction of any kind, +provided that the above copyright notice and this section are included +on all such copies and derivative works. However, this document itself +may not be modified in any way, including by removing the copyright +notice or references to OASIS, except as needed for the purpose of +developing any document or deliverable produced by an OASIS Technical +Committee (in which case the rules applicable to copyrights, as set +forth in the OASIS IPR Policy, must be followed) or as required to +translate it into languages other than English. + + The limited permissions granted above are perpetual and will not be +revoked by OASIS or its successors or assigns. + + This document and the information contained herein is provided on an +"AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE +INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED +WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS +AND ITS MEMBERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR ANY +PART THEREOF. + + [OASIS requests that any OASIS Party or any other party that +believes it has patent claims that would necessarily be infringed by +implementations of this OASIS Standards Final Deliverable, to notify +OASIS TC Administrator and provide an indication of its willingness to +grant patent licenses to such patent claims in a manner consistent with +the IPR Mode of the OASIS Technical Committee that produced this +deliverable.] + + [OASIS invites any party to contact the OASIS TC Administrator if it +is aware of a claim of ownership of any patent claims that would +necessarily be infringed by implementations of this OASIS Standards +Final Deliverable by a patent holder that is not willing to provide a +license to such patent claims in a manner consistent with the IPR Mode +of the OASIS Technical Committee that produced this OASIS Standards +Final Deliverable. OASIS may include such claims on its website, but +disclaims any obligation to do so.] + + [OASIS takes no position regarding the validity or scope of any +intellectual property or other rights that might be claimed to pertain +to the implementation or use of the technology described in this OASIS +Standards Final Deliverable or the extent to which any license under +such rights might or might not be available; neither does it represent +that it has made any effort to identify any such rights. Information on +OASIS' procedures with respect to rights in any document or deliverable +produced by an OASIS Technical Committee can be found on the OASIS +website. Copies of claims of rights made available for publication and +any assurances of licenses to be made available, or the result of an +attempt made to obtain a general license or permission for the use of +such proprietary rights by implementers or users of this OASIS Standards +Final Deliverable, can be obtained from the OASIS TC Administrator. +OASIS makes no representation that any information or list of +intellectual property rights will at any time be complete, or that any +claims in such list are, in fact, Essential Claims.] + +--- end of LICENSE --- + +------------------------------------------------------------------------------- diff --git a/runtime/jre/lib/accessibility.properties b/runtime/jre/lib/accessibility.properties new file mode 100644 index 0000000..d9f12e3 --- /dev/null +++ b/runtime/jre/lib/accessibility.properties @@ -0,0 +1,6 @@ +# +# Load the Java Access Bridge class into the JVM +# +#assistive_technologies=com.sun.java.accessibility.AccessBridge +#screen_magnifier_present=true + diff --git a/runtime/jre/lib/amd64/jvm.cfg b/runtime/jre/lib/amd64/jvm.cfg new file mode 100644 index 0000000..21ab9fd --- /dev/null +++ b/runtime/jre/lib/amd64/jvm.cfg @@ -0,0 +1,38 @@ +# +# +# +# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=" option, but that too is unsupported +# and may not be available in a future release. +# +-server KNOWN +-client IGNORE diff --git a/runtime/jre/lib/calendars.properties b/runtime/jre/lib/calendars.properties new file mode 100644 index 0000000..6007d7a --- /dev/null +++ b/runtime/jre/lib/calendars.properties @@ -0,0 +1,62 @@ +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Japanese imperial calendar +# +# Meiji since 1868-01-01 00:00:00 local time (Gregorian) +# Taisho since 1912-07-30 00:00:00 local time (Gregorian) +# Showa since 1926-12-25 00:00:00 local time (Gregorian) +# Heisei since 1989-01-08 00:00:00 local time (Gregorian) +# Reiwa since 2019-05-01 00:00:00 local time (Gregorian) +calendar.japanese.type: LocalGregorianCalendar +calendar.japanese.eras: \ + name=Meiji,abbr=M,since=-3218832000000; \ + name=Taisho,abbr=T,since=-1812153600000; \ + name=Showa,abbr=S,since=-1357603200000; \ + name=Heisei,abbr=H,since=600220800000; \ + name=Reiwa,abbr=R,since=1556668800000 + +# +# Taiwanese calendar +# Minguo since 1911-01-01 00:00:00 local time (Gregorian) +calendar.taiwanese.type: LocalGregorianCalendar +calendar.taiwanese.eras: \ + name=MinGuo,since=-1830384000000 + +# +# Thai Buddhist calendar +# Buddhist Era since -542-01-01 00:00:00 local time (Gregorian) +calendar.thai-buddhist.type: LocalGregorianCalendar +calendar.thai-buddhist.eras: \ + name=BuddhistEra,abbr=B.E.,since=-79302585600000 +calendar.thai-buddhist.year-boundary: \ + day1=4-1,since=-79302585600000; \ + day1=1-1,since=-915148800000 + +# +# Hijrah calendars +# +calendar.hijrah.Hijrah-umalqura: hijrah-config-umalqura.properties +calendar.hijrah.Hijrah-umalqura.type: islamic-umalqura diff --git a/runtime/jre/lib/charsets.jar b/runtime/jre/lib/charsets.jar new file mode 100644 index 0000000..7ea2b00 Binary files /dev/null and b/runtime/jre/lib/charsets.jar differ diff --git a/runtime/jre/lib/classlist b/runtime/jre/lib/classlist new file mode 100644 index 0000000..36e8ca1 --- /dev/null +++ b/runtime/jre/lib/classlist @@ -0,0 +1,2469 @@ +java/lang/Object +java/lang/String +java/io/Serializable +java/lang/Comparable +java/lang/CharSequence +java/lang/Class +java/lang/reflect/GenericDeclaration +java/lang/reflect/AnnotatedElement +java/lang/reflect/Type +java/lang/Cloneable +java/lang/ClassLoader +java/lang/System +java/lang/Throwable +java/lang/Error +java/lang/ThreadDeath +java/lang/Exception +java/lang/RuntimeException +java/lang/SecurityManager +java/security/ProtectionDomain +java/security/AccessControlContext +java/security/SecureClassLoader +java/lang/ClassNotFoundException +java/lang/ReflectiveOperationException +java/lang/NoClassDefFoundError +java/lang/LinkageError +java/lang/ClassCastException +java/lang/ArrayStoreException +java/lang/VirtualMachineError +java/lang/OutOfMemoryError +java/lang/StackOverflowError +java/lang/IllegalMonitorStateException +java/lang/ref/Reference +java/lang/ref/SoftReference +java/lang/ref/WeakReference +java/lang/ref/FinalReference +java/lang/ref/PhantomReference +sun/misc/Cleaner +java/lang/ref/Finalizer +java/lang/Thread +java/lang/Runnable +java/lang/ThreadGroup +java/lang/Thread$UncaughtExceptionHandler +java/util/Properties +java/util/Hashtable +java/util/Map +java/util/Dictionary +java/lang/reflect/AccessibleObject +java/lang/reflect/Field +java/lang/reflect/Member +java/lang/reflect/Parameter +java/lang/reflect/Method +java/lang/reflect/Executable +java/lang/reflect/Constructor +sun/reflect/MagicAccessorImpl +sun/reflect/MethodAccessorImpl +sun/reflect/MethodAccessor +sun/reflect/ConstructorAccessorImpl +sun/reflect/ConstructorAccessor +sun/reflect/DelegatingClassLoader +sun/reflect/ConstantPool +sun/reflect/UnsafeStaticFieldAccessorImpl +sun/reflect/UnsafeFieldAccessorImpl +sun/reflect/FieldAccessorImpl +sun/reflect/FieldAccessor +sun/reflect/CallerSensitive +java/lang/annotation/Annotation +java/lang/invoke/DirectMethodHandle +java/lang/invoke/MethodHandle +java/lang/invoke/MemberName +java/lang/invoke/MethodHandleNatives +java/lang/invoke/LambdaForm +java/lang/invoke/MethodType +java/lang/BootstrapMethodError +java/lang/invoke/CallSite +java/lang/invoke/ConstantCallSite +java/lang/invoke/MutableCallSite +java/lang/invoke/VolatileCallSite +java/lang/StringBuffer +java/lang/AbstractStringBuilder +java/lang/Appendable +java/lang/StringBuilder +sun/misc/Unsafe +java/io/ByteArrayInputStream +java/io/InputStream +java/io/Closeable +java/lang/AutoCloseable +java/io/File +java/net/URLClassLoader +java/net/URL +java/util/jar/Manifest +sun/misc/Launcher +sun/misc/Launcher$AppClassLoader +sun/misc/Launcher$ExtClassLoader +java/security/CodeSource +java/lang/StackTraceElement +java/nio/Buffer +java/lang/Boolean +java/lang/Character +java/lang/Float +java/lang/Number +java/lang/Double +java/lang/Byte +java/lang/Short +java/lang/Integer +java/lang/Long +java/lang/NullPointerException +java/lang/ArithmeticException +java/io/ObjectStreamField +java/lang/String$CaseInsensitiveComparator +java/util/Comparator +java/lang/RuntimePermission +java/security/BasicPermission +java/security/Permission +java/security/Guard +java/security/AccessController +java/lang/reflect/ReflectPermission +sun/reflect/ReflectionFactory$GetReflectionFactoryAction +java/security/PrivilegedAction +java/security/cert/Certificate +java/util/Vector +java/util/List +java/util/Collection +java/lang/Iterable +java/util/RandomAccess +java/util/AbstractList +java/util/AbstractCollection +java/util/Stack +sun/reflect/ReflectionFactory +java/lang/ref/Reference$Lock +java/lang/ref/Reference$ReferenceHandler +java/lang/ref/ReferenceQueue +java/lang/ref/ReferenceQueue$Null +java/lang/ref/ReferenceQueue$Lock +java/lang/ref/Finalizer$FinalizerThread +sun/misc/VM +java/util/Hashtable$Entry +java/util/Map$Entry +java/lang/Math +java/util/Hashtable$EntrySet +java/util/AbstractSet +java/util/Set +java/util/Collections +java/util/Collections$EmptySet +java/util/Collections$EmptyList +java/util/Collections$EmptyMap +java/util/AbstractMap +java/util/Collections$SynchronizedSet +java/util/Collections$SynchronizedCollection +java/util/Objects +java/util/Hashtable$Enumerator +java/util/Enumeration +java/util/Iterator +java/lang/Runtime +sun/misc/Version +java/io/FileInputStream +java/io/FileDescriptor +java/io/FileDescriptor$1 +sun/misc/JavaIOFileDescriptorAccess +sun/misc/SharedSecrets +java/lang/NoSuchMethodError +java/lang/IncompatibleClassChangeError +java/util/ArrayList +java/util/Collections$UnmodifiableRandomAccessList +java/util/Collections$UnmodifiableList +java/util/Collections$UnmodifiableCollection +sun/reflect/Reflection +java/util/HashMap +java/util/HashMap$Node +java/io/FileOutputStream +java/io/OutputStream +java/io/Flushable +java/io/BufferedInputStream +java/io/FilterInputStream +java/util/concurrent/atomic/AtomicReferenceFieldUpdater +java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl +java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl$1 +java/security/PrivilegedExceptionAction +java/lang/Class$3 +java/lang/Class$ReflectionData +java/lang/Class$Atomic +sun/reflect/generics/repository/ClassRepository +sun/reflect/generics/repository/GenericDeclRepository +sun/reflect/generics/repository/AbstractRepository +java/lang/Class$AnnotationData +sun/reflect/annotation/AnnotationType +java/lang/ClassValue$ClassValueMap +java/util/WeakHashMap +java/lang/reflect/Modifier +java/lang/reflect/ReflectAccess +sun/reflect/LangReflectAccess +sun/reflect/misc/ReflectUtil +java/io/PrintStream +java/io/FilterOutputStream +java/io/BufferedOutputStream +java/io/OutputStreamWriter +java/io/Writer +sun/nio/cs/StreamEncoder +java/nio/charset/Charset +sun/nio/cs/StandardCharsets +sun/nio/cs/FastCharsetProvider +java/nio/charset/spi/CharsetProvider +sun/nio/cs/StandardCharsets$Aliases +sun/util/PreHashedMap +sun/nio/cs/StandardCharsets$Classes +sun/nio/cs/StandardCharsets$Cache +java/lang/ThreadLocal +java/util/concurrent/atomic/AtomicInteger +sun/security/action/GetPropertyAction +java/util/Arrays +sun/nio/cs/MS1252 +sun/nio/cs/HistoricallyNamedCharset +sun/nio/cs/SingleByte +java/lang/Class$1 +sun/reflect/ReflectionFactory$1 +sun/reflect/NativeConstructorAccessorImpl +sun/reflect/DelegatingConstructorAccessorImpl +sun/nio/cs/SingleByte$Encoder +sun/nio/cs/ArrayEncoder +java/nio/charset/CharsetEncoder +java/nio/charset/CodingErrorAction +java/nio/ByteBuffer +java/nio/HeapByteBuffer +java/nio/Bits +java/nio/ByteOrder +java/nio/Bits$1 +sun/misc/JavaNioAccess +java/io/BufferedWriter +java/io/DefaultFileSystem +java/io/WinNTFileSystem +java/io/FileSystem +java/io/ExpiringCache +java/io/ExpiringCache$1 +java/util/LinkedHashMap +java/io/File$PathStatus +java/lang/Enum +java/nio/file/Path +java/nio/file/Watchable +java/lang/ClassLoader$3 +java/io/ExpiringCache$Entry +java/util/LinkedHashMap$Entry +java/lang/ClassLoader$NativeLibrary +java/lang/Terminator +java/lang/Terminator$1 +sun/misc/SignalHandler +sun/misc/Signal +sun/misc/NativeSignalHandler +java/lang/Integer$IntegerCache +sun/misc/OSEnvironment +sun/io/Win32ErrorMode +java/lang/System$2 +sun/misc/JavaLangAccess +java/lang/IllegalArgumentException +java/lang/Compiler +java/lang/Compiler$1 +sun/misc/Launcher$Factory +java/net/URLStreamHandlerFactory +sun/security/util/Debug +java/lang/ClassLoader$ParallelLoaders +java/util/WeakHashMap$Entry +java/util/Collections$SetFromMap +java/util/WeakHashMap$KeySet +java/net/URLClassLoader$7 +sun/misc/JavaNetAccess +java/util/StringTokenizer +sun/misc/Launcher$ExtClassLoader$1 +sun/misc/MetaIndex +java/io/BufferedReader +java/io/Reader +java/lang/Readable +java/io/FileReader +java/io/InputStreamReader +sun/nio/cs/StreamDecoder +sun/nio/cs/SingleByte$Decoder +sun/nio/cs/ArrayDecoder +java/nio/charset/CharsetDecoder +java/nio/CharBuffer +java/nio/HeapCharBuffer +java/nio/charset/CoderResult +java/nio/charset/CoderResult$1 +java/nio/charset/CoderResult$Cache +java/nio/charset/CoderResult$2 +java/lang/reflect/Array +java/util/Locale +java/util/Locale$Cache +sun/util/locale/LocaleObjectCache +java/util/concurrent/ConcurrentHashMap +java/util/concurrent/ConcurrentMap +java/util/concurrent/ConcurrentHashMap$Segment +java/util/concurrent/locks/ReentrantLock +java/util/concurrent/locks/Lock +java/util/concurrent/ConcurrentHashMap$Node +java/util/concurrent/ConcurrentHashMap$CounterCell +java/util/concurrent/ConcurrentHashMap$KeySetView +java/util/concurrent/ConcurrentHashMap$CollectionView +java/util/concurrent/ConcurrentHashMap$ValuesView +java/util/concurrent/ConcurrentHashMap$EntrySetView +sun/util/locale/BaseLocale +sun/util/locale/BaseLocale$Cache +sun/util/locale/BaseLocale$Key +sun/util/locale/LocaleObjectCache$CacheEntry +java/util/Locale$LocaleKey +sun/util/locale/LocaleUtils +java/lang/CharacterData +java/lang/CharacterDataLatin1 +java/util/HashMap$TreeNode +java/io/FileInputStream$1 +sun/net/www/ParseUtil +java/util/BitSet +java/net/Parts +sun/net/www/protocol/file/Handler +java/net/URLStreamHandler +java/security/ProtectionDomain$JavaSecurityAccessImpl +sun/misc/JavaSecurityAccess +java/security/ProtectionDomain$2 +sun/misc/JavaSecurityProtectionDomainAccess +java/security/ProtectionDomain$Key +java/security/Principal +java/util/HashSet +sun/misc/URLClassPath +sun/net/www/protocol/jar/Handler +sun/misc/Launcher$AppClassLoader$1 +java/lang/SystemClassLoaderAction +java/lang/invoke/MethodHandleImpl +java/lang/invoke/MethodHandleImpl$1 +java/lang/invoke/MethodHandleImpl$2 +java/util/function/Function +java/lang/invoke/MethodHandleImpl$3 +java/lang/invoke/MethodHandleImpl$4 +java/lang/ClassValue +java/lang/ClassValue$Entry +java/lang/ClassValue$Identity +java/lang/ClassValue$Version +java/lang/invoke/MemberName$Factory +java/lang/invoke/MethodHandleStatics +java/lang/invoke/MethodHandleStatics$1 +sun/misc/PostVMInitHook +sun/usagetracker/UsageTrackerClient +java/util/concurrent/atomic/AtomicBoolean +sun/usagetracker/UsageTrackerClient$1 +sun/usagetracker/UsageTrackerClient$4 +sun/usagetracker/UsageTrackerClient$2 +java/lang/ProcessEnvironment +java/lang/ProcessEnvironment$NameComparator +java/lang/ProcessEnvironment$EntryComparator +java/util/Collections$UnmodifiableMap +java/util/TreeMap +java/util/NavigableMap +java/util/SortedMap +java/lang/ProcessEnvironment$CheckedEntrySet +java/util/HashMap$EntrySet +java/lang/ProcessEnvironment$CheckedEntrySet$1 +java/util/HashMap$EntryIterator +java/util/HashMap$HashIterator +java/lang/ProcessEnvironment$CheckedEntry +java/util/TreeMap$Entry +sun/usagetracker/UsageTrackerClient$3 +java/lang/StringCoding +java/lang/ThreadLocal$ThreadLocalMap +java/lang/ThreadLocal$ThreadLocalMap$Entry +sun/nio/cs/UTF_8 +sun/nio/cs/Unicode +java/lang/StringCoding$StringEncoder +sun/nio/cs/UTF_8$Encoder +java/io/FileOutputStream$1 +sun/launcher/LauncherHelper +java/lang/StringCoding$StringDecoder +java/net/URLClassLoader$1 +sun/net/util/URLUtil +sun/misc/URLClassPath$3 +sun/misc/URLClassPath$JarLoader +sun/misc/URLClassPath$Loader +java/util/zip/ZipFile +java/util/zip/ZipConstants +java/util/zip/ZipFile$1 +sun/misc/JavaUtilZipFileAccess +sun/misc/URLClassPath$JarLoader$1 +sun/misc/FileURLMapper +java/util/jar/JarFile +java/util/jar/JavaUtilJarAccessImpl +sun/misc/JavaUtilJarAccess +java/nio/charset/StandardCharsets +sun/nio/cs/US_ASCII +sun/nio/cs/ISO_8859_1 +sun/nio/cs/UTF_16BE +sun/nio/cs/UTF_16LE +sun/nio/cs/UTF_16 +java/util/ArrayDeque +java/util/Deque +java/util/Queue +java/util/zip/ZipCoder +sun/misc/PerfCounter +sun/misc/Perf$GetPerfAction +sun/misc/Perf +sun/misc/PerfCounter$CoreCounters +sun/nio/ch/DirectBuffer +java/nio/DirectByteBuffer +java/nio/MappedByteBuffer +java/nio/DirectLongBufferU +java/nio/LongBuffer +sun/misc/JarIndex +sun/misc/ExtensionDependency +java/util/zip/ZipEntry +java/util/jar/JarFile$JarFileEntry +java/util/jar/JarEntry +java/util/zip/ZipFile$ZipFileInputStream +java/util/zip/Inflater +java/util/zip/ZStreamRef +java/util/zip/ZipFile$ZipFileInflaterInputStream +java/util/zip/InflaterInputStream +sun/misc/IOUtils +sun/misc/URLClassPath$JarLoader$2 +sun/misc/Resource +sun/nio/ByteBuffered +java/security/Permissions +java/security/PermissionCollection +sun/net/www/protocol/file/FileURLConnection +sun/net/www/URLConnection +java/net/URLConnection +sun/net/www/MessageHeader +java/io/FilePermission +java/io/FilePermission$1 +java/io/FilePermissionCollection +java/security/AllPermission +java/security/UnresolvedPermission +java/security/BasicPermissionCollection +javax/swing/JLabel +javax/swing/SwingConstants +javax/accessibility/Accessible +javax/swing/JComponent +javax/swing/TransferHandler$HasGetTransferHandler +java/awt/Container +java/awt/Component +java/awt/image/ImageObserver +java/awt/MenuContainer +sun/launcher/LauncherHelper$FXHelper +java/lang/Class$MethodArray +java/lang/InterruptedException +javax/swing/JFrame +javax/swing/WindowConstants +javax/swing/RootPaneContainer +java/awt/Frame +java/awt/Window +java/util/concurrent/ConcurrentHashMap$ForwardingNode +java/awt/Graphics +java/lang/Void +sun/util/logging/PlatformLogger +sun/util/logging/PlatformLogger$Level +sun/util/logging/PlatformLogger$1 +sun/util/logging/PlatformLogger$DefaultLoggerProxy +sun/util/logging/PlatformLogger$LoggerProxy +sun/util/logging/PlatformLogger$JavaLoggerProxy +sun/util/logging/LoggingSupport +sun/util/logging/LoggingSupport$1 +java/util/logging/LoggingProxyImpl +sun/util/logging/LoggingProxy +sun/reflect/UnsafeFieldAccessorFactory +sun/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl +sun/reflect/UnsafeQualifiedStaticFieldAccessorImpl +sun/util/logging/LoggingSupport$2 +java/util/Date +sun/util/calendar/CalendarSystem +sun/util/calendar/Gregorian +sun/util/calendar/BaseCalendar +sun/util/calendar/AbstractCalendar +java/awt/Component$AWTTreeLock +java/awt/Toolkit +java/awt/Toolkit$4 +sun/awt/AWTAccessor$ToolkitAccessor +sun/awt/AWTAccessor +java/awt/Toolkit$5 +sun/util/CoreResourceBundleControl +java/util/ResourceBundle$Control +java/util/Arrays$ArrayList +java/util/ResourceBundle$Control$CandidateListCache +java/util/ResourceBundle +java/util/ResourceBundle$1 +java/util/spi/ResourceBundleControlProvider +java/util/ServiceLoader +java/util/ServiceLoader$LazyIterator +java/util/ServiceLoader$1 +java/util/LinkedHashMap$LinkedEntrySet +java/util/LinkedHashMap$LinkedEntryIterator +java/util/LinkedHashMap$LinkedHashIterator +sun/misc/Launcher$BootClassPathHolder +sun/misc/Launcher$BootClassPathHolder$1 +sun/misc/URLClassPath$2 +java/lang/ClassLoader$2 +sun/misc/URLClassPath$1 +java/net/URLClassLoader$3 +sun/misc/CompoundEnumeration +java/io/FileNotFoundException +java/io/IOException +java/security/PrivilegedActionException +java/net/URLClassLoader$3$1 +java/util/ResourceBundle$RBClassLoader +java/util/ResourceBundle$RBClassLoader$1 +java/util/ResourceBundle$CacheKey +java/util/ResourceBundle$LoaderReference +java/util/ResourceBundle$CacheKeyReference +java/util/ResourceBundle$SingleFormatControl +java/util/LinkedList +java/util/AbstractSequentialList +java/util/LinkedList$Node +sun/awt/resources/awt +java/util/ListResourceBundle +java/awt/Toolkit$3 +java/awt/Toolkit$1 +java/util/Properties$LineReader +java/awt/GraphicsEnvironment +java/lang/invoke/LambdaMetafactory +java/lang/invoke/MethodHandles$Lookup +java/lang/invoke/MethodType$ConcurrentWeakInternSet +java/lang/invoke/MethodTypeForm +java/lang/invoke/Invokers +java/lang/invoke/MethodType$ConcurrentWeakInternSet$WeakEntry +java/lang/invoke/MethodHandles +sun/invoke/util/Wrapper +sun/invoke/util/Wrapper$Format +java/lang/Byte$ByteCache +java/lang/Short$ShortCache +java/lang/Character$CharacterCache +java/lang/Long$LongCache +sun/invoke/util/VerifyAccess +sun/invoke/util/ValueConversions +java/lang/NoSuchMethodException +java/lang/invoke/LambdaForm$BasicType +java/lang/invoke/LambdaForm$Name +java/lang/invoke/LambdaForm$NamedFunction +java/lang/invoke/SimpleMethodHandle +java/lang/invoke/BoundMethodHandle +java/lang/invoke/BoundMethodHandle$SpeciesData +java/lang/invoke/BoundMethodHandle$Factory +java/lang/invoke/BoundMethodHandle$Species_L +java/util/HashMap$Values +java/util/HashMap$ValueIterator +sun/invoke/util/BytecodeDescriptor +java/lang/invoke/DirectMethodHandle$Lazy +java/lang/InstantiationException +java/util/Collections$UnmodifiableCollection$1 +java/util/AbstractList$Itr +java/lang/invoke/InvokerBytecodeGenerator +jdk/internal/org/objectweb/asm/ClassWriter +jdk/internal/org/objectweb/asm/ClassVisitor +jdk/internal/org/objectweb/asm/ByteVector +jdk/internal/org/objectweb/asm/Item +jdk/internal/org/objectweb/asm/MethodWriter +jdk/internal/org/objectweb/asm/MethodVisitor +jdk/internal/org/objectweb/asm/Type +jdk/internal/org/objectweb/asm/Label +jdk/internal/org/objectweb/asm/Frame +jdk/internal/org/objectweb/asm/AnnotationWriter +jdk/internal/org/objectweb/asm/AnnotationVisitor +java/lang/invoke/MethodHandleImpl$Intrinsic +java/lang/invoke/InvokerBytecodeGenerator$2 +sun/invoke/util/VerifyType +sun/invoke/empty/Empty +java/lang/NoSuchFieldException +java/lang/invoke/InvokerBytecodeGenerator$CpPatch +java/lang/invoke/DirectMethodHandle$Accessor +java/util/ArrayList$Itr +java/util/RandomAccessSubList +java/util/SubList +java/util/SubList$1 +java/util/ListIterator +java/util/AbstractList$ListItr +java/lang/invoke/MethodHandleImpl$AsVarargsCollector +java/lang/invoke/DelegatingMethodHandle +java/lang/invoke/WrongMethodTypeException +java/lang/invoke/MethodHandleImpl$Lazy +java/lang/invoke/MethodHandleImpl$IntrinsicMethodHandle +java/lang/NoSuchFieldError +java/lang/IllegalAccessException +java/lang/invoke/LambdaFormEditor +java/lang/invoke/LambdaFormEditor$Transform$Kind +java/lang/invoke/LambdaFormEditor$Transform +java/lang/invoke/LambdaFormBuffer +jdk/internal/org/objectweb/asm/FieldWriter +jdk/internal/org/objectweb/asm/FieldVisitor +java/lang/invoke/InnerClassLambdaMetafactory +java/lang/invoke/AbstractValidatingLambdaMetafactory +java/util/PropertyPermission +java/security/AccessController$1 +sun/security/util/SecurityConstants +java/net/NetPermission +java/security/SecurityPermission +java/net/SocketPermission +sun/security/action/GetBooleanAction +java/security/AllPermissionCollection +java/lang/invoke/InfoFromMemberName +java/lang/invoke/MethodHandleInfo +java/lang/invoke/InnerClassLambdaMetafactory$ForwardingMethodGenerator +java/lang/invoke/TypeConvertingMethodAdapter +java/lang/invoke/InnerClassLambdaMetafactory$1 +java/awt/Insets +java/awt/event/InputEvent +java/awt/event/ComponentEvent +java/awt/AWTEvent +java/util/EventObject +java/awt/AWTEvent$1 +sun/awt/AWTAccessor$AWTEventAccessor +java/awt/event/NativeLibLoader +java/awt/event/NativeLibLoader$1 +java/awt/event/InputEvent$1 +sun/awt/AWTAccessor$InputEventAccessor +sun/awt/windows/WComponentPeer +java/awt/peer/ComponentPeer +java/awt/dnd/peer/DropTargetPeer +sun/awt/windows/WObjectPeer +java/awt/Font +java/awt/Font$FontAccessImpl +sun/font/FontAccess +java/awt/geom/AffineTransform +sun/font/AttributeValues +sun/font/EAttribute +java/text/AttributedCharacterIterator$Attribute +java/lang/Class$4 +sun/reflect/NativeMethodAccessorImpl +sun/reflect/DelegatingMethodAccessorImpl +java/awt/font/TextAttribute +java/awt/Component$1 +sun/awt/AWTAccessor$ComponentAccessor +java/awt/Component$DummyRequestFocusController +sun/awt/RequestFocusController +java/awt/LayoutManager +java/awt/LightweightDispatcher +java/awt/event/AWTEventListener +java/util/EventListener +java/awt/Dimension +java/awt/geom/Dimension2D +java/awt/Container$1 +sun/awt/AWTAccessor$ContainerAccessor +javax/swing/JComponent$1 +java/awt/ComponentOrientation +java/awt/Component$3 +sun/awt/AppContext +java/util/IdentityHashMap +java/util/Collections$SynchronizedMap +sun/awt/AppContext$GetAppContextLock +sun/awt/AppContext$6 +sun/misc/JavaAWTAccess +sun/awt/AppContext$3 +sun/awt/AppContext$2 +sun/awt/SunToolkit +sun/awt/WindowClosingSupport +sun/awt/WindowClosingListener +sun/awt/ComponentFactory +sun/awt/InputMethodSupport +sun/awt/KeyboardFocusManagerPeerProvider +java/util/concurrent/locks/ReentrantLock$NonfairSync +java/util/concurrent/locks/ReentrantLock$Sync +java/util/concurrent/locks/AbstractQueuedSynchronizer +java/util/concurrent/locks/AbstractOwnableSynchronizer +java/util/concurrent/locks/AbstractQueuedSynchronizer$Node +java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject +java/util/concurrent/locks/Condition +sun/misc/SoftCache +sun/awt/AppContext$State +sun/awt/AppContext$1 +java/awt/EventQueue +java/awt/EventQueue$1 +java/awt/EventQueue$2 +sun/awt/AWTAccessor$EventQueueAccessor +java/awt/Queue +sun/awt/MostRecentKeyValue +sun/awt/PostEventQueue +javax/swing/event/EventListenerList +javax/swing/SwingUtilities +javax/swing/RepaintManager +javax/swing/RepaintManager$DisplayChangedHandler +sun/awt/DisplayChangedListener +javax/swing/RepaintManager$1 +sun/swing/SwingAccessor$RepaintManagerAccessor +sun/swing/SwingAccessor +sun/awt/Win32GraphicsEnvironment +sun/java2d/SunGraphicsEnvironment +sun/awt/windows/WToolkit +sun/awt/windows/WToolkit$1 +sun/java2d/SurfaceData +java/awt/Transparency +sun/java2d/DisposerTarget +sun/java2d/StateTrackable +sun/java2d/Surface +sun/java2d/InvalidPipeException +java/lang/IllegalStateException +sun/java2d/NullSurfaceData +sun/java2d/StateTrackable$State +sun/java2d/loops/SurfaceType +sun/awt/image/PixelConverter +sun/awt/image/PixelConverter$Xrgb +sun/awt/image/PixelConverter$Argb +sun/awt/image/PixelConverter$ArgbPre +sun/awt/image/PixelConverter$Xbgr +sun/awt/image/PixelConverter$Rgba +sun/awt/image/PixelConverter$RgbaPre +sun/awt/image/PixelConverter$Ushort565Rgb +sun/awt/image/PixelConverter$Ushort555Rgb +sun/awt/image/PixelConverter$Ushort555Rgbx +sun/awt/image/PixelConverter$Ushort4444Argb +sun/awt/image/PixelConverter$ByteGray +sun/awt/image/PixelConverter$UshortGray +sun/awt/image/PixelConverter$Rgbx +sun/awt/image/PixelConverter$Bgrx +sun/awt/image/PixelConverter$ArgbBm +java/awt/image/ColorModel +java/awt/image/ColorModel$1 +java/awt/image/DirectColorModel +java/awt/image/PackedColorModel +java/awt/color/ColorSpace +java/awt/color/ICC_Profile +sun/java2d/cmm/ProfileDeferralInfo +sun/java2d/cmm/ProfileDeferralMgr +java/awt/color/ICC_ProfileRGB +java/awt/color/ICC_Profile$1 +sun/java2d/cmm/ProfileActivator +java/awt/color/ICC_ColorSpace +sun/java2d/StateTrackableDelegate +sun/java2d/StateTrackableDelegate$2 +sun/java2d/pipe/NullPipe +sun/java2d/pipe/PixelDrawPipe +sun/java2d/pipe/PixelFillPipe +sun/java2d/pipe/ShapeDrawPipe +sun/java2d/pipe/TextPipe +sun/java2d/pipe/DrawImagePipe +java/awt/image/IndexColorModel +sun/java2d/pipe/LoopPipe +sun/java2d/pipe/ParallelogramPipe +sun/java2d/pipe/LoopBasedPipe +sun/java2d/pipe/RenderingEngine +sun/java2d/pipe/RenderingEngine$1 +sun/dc/DuctusRenderingEngine +sun/java2d/pipe/OutlineTextRenderer +sun/java2d/pipe/SolidTextRenderer +sun/java2d/pipe/GlyphListLoopPipe +sun/java2d/pipe/GlyphListPipe +sun/java2d/pipe/AATextRenderer +sun/java2d/pipe/LCDTextRenderer +sun/java2d/pipe/AlphaColorPipe +sun/java2d/pipe/CompositePipe +sun/java2d/SurfaceData$PixelToShapeLoopConverter +sun/java2d/pipe/PixelToShapeConverter +sun/java2d/SurfaceData$PixelToPgramLoopConverter +sun/java2d/pipe/PixelToParallelogramConverter +sun/java2d/pipe/TextRenderer +sun/java2d/pipe/SpanClipRenderer +sun/java2d/pipe/Region +sun/java2d/pipe/RegionIterator +sun/java2d/pipe/Region$ImmutableRegion +sun/java2d/pipe/AAShapePipe +sun/java2d/pipe/AlphaPaintPipe +sun/java2d/pipe/SpanShapeRenderer$Composite +sun/java2d/pipe/SpanShapeRenderer +sun/java2d/pipe/GeneralCompositePipe +sun/java2d/pipe/DrawImage +sun/java2d/loops/RenderCache +sun/java2d/loops/RenderCache$Entry +sun/awt/image/SunVolatileImage +sun/java2d/DestSurfaceProvider +java/awt/image/VolatileImage +java/awt/Image +java/awt/ImageCapabilities +java/awt/Image$1 +sun/awt/image/SurfaceManager$ImageAccessor +sun/awt/image/SurfaceManager +sun/awt/image/VolatileSurfaceManager +sun/awt/windows/WToolkit$2 +sun/java2d/windows/WindowsFlags +sun/java2d/windows/WindowsFlags$1 +sun/java2d/WindowsSurfaceManagerFactory +sun/java2d/SurfaceManagerFactory +sun/awt/SunDisplayChanger +sun/java2d/SunGraphicsEnvironment$1 +sun/misc/FloatingDecimal +sun/misc/FloatingDecimal$ExceptionalBinaryToASCIIBuffer +sun/misc/FloatingDecimal$BinaryToASCIIConverter +sun/misc/FloatingDecimal$BinaryToASCIIBuffer +sun/misc/FloatingDecimal$1 +sun/misc/FloatingDecimal$PreparedASCIIToBinaryBuffer +sun/misc/FloatingDecimal$ASCIIToBinaryConverter +sun/misc/FloatingDecimal$ASCIIToBinaryBuffer +java/awt/Toolkit$2 +java/awt/Toolkit$DesktopPropertyChangeSupport +java/beans/PropertyChangeSupport +java/beans/PropertyChangeSupport$PropertyChangeListenerMap +java/beans/ChangeListenerMap +java/beans/PropertyChangeListener +sun/awt/SunToolkit$ModalityListenerList +sun/awt/ModalityListener +sun/misc/PerformanceLogger +sun/misc/PerformanceLogger$TimeData +sun/awt/windows/WToolkit$ToolkitDisposer +sun/java2d/DisposerRecord +sun/java2d/Disposer +sun/java2d/Disposer$1 +sun/misc/ThreadGroupUtils +sun/awt/AWTAutoShutdown +java/lang/invoke/DirectMethodHandle$Special +java/lang/ApplicationShutdownHooks +java/lang/ApplicationShutdownHooks$1 +java/lang/Shutdown +java/lang/Shutdown$Lock +java/awt/Rectangle +java/awt/Shape +java/awt/geom/Rectangle2D +java/awt/geom/RectangularShape +javax/swing/RepaintManager$ProcessingRunnable +com/sun/java/swing/SwingUtilities3 +javax/swing/UIManager +javax/swing/UIManager$LookAndFeelInfo +sun/awt/OSInfo +sun/awt/OSInfo$WindowsVersion +sun/awt/OSInfo$1 +sun/awt/OSInfo$OSType +sun/awt/HeadlessToolkit +sun/awt/windows/WDesktopProperties +sun/awt/windows/ThemeReader +java/util/concurrent/locks/ReentrantReadWriteLock +java/util/concurrent/locks/ReadWriteLock +sun/nio/ch/Interruptible +java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync +java/util/concurrent/locks/ReentrantReadWriteLock$Sync +java/util/concurrent/locks/ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter +java/util/concurrent/locks/ReentrantReadWriteLock$ReadLock +java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock +java/awt/Color +java/awt/Paint +sun/awt/windows/WDesktopProperties$WinPlaySound +java/awt/RenderingHints +sun/awt/SunHints +sun/awt/SunHints$Key +java/awt/RenderingHints$Key +sun/awt/SunHints$Value +sun/awt/SunHints$LCDContrastKey +java/util/HashMap$KeySet +java/util/HashMap$KeyIterator +java/util/Arrays$LegacyMergeSort +java/util/ComparableTimSort +java/beans/PropertyChangeEvent +java/awt/Toolkit$DesktopPropertyChangeSupport$1 +java/util/IdentityHashMap$Values +java/util/IdentityHashMap$ValueIterator +java/util/IdentityHashMap$IdentityHashMapIterator +sun/swing/SwingUtilities2 +java/awt/font/FontRenderContext +sun/swing/StringUIClientPropertyKey +sun/swing/UIClientPropertyKey +sun/swing/SwingUtilities2$LSBCacheEntry +javax/swing/UIManager$LAFState +javax/swing/UIDefaults +javax/swing/MultiUIDefaults +javax/swing/UIManager$1 +javax/swing/plaf/metal/MetalLookAndFeel +javax/swing/plaf/basic/BasicLookAndFeel +javax/swing/LookAndFeel +sun/swing/DefaultLookup +javax/swing/plaf/metal/OceanTheme +javax/swing/plaf/metal/DefaultMetalTheme +javax/swing/plaf/metal/MetalTheme +javax/swing/plaf/ColorUIResource +javax/swing/plaf/UIResource +sun/swing/PrintColorUIResource +javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate +javax/swing/plaf/FontUIResource +sun/swing/SwingLazyValue +javax/swing/UIDefaults$LazyValue +javax/swing/UIDefaults$ActiveValue +javax/swing/plaf/InsetsUIResource +javax/swing/plaf/BorderUIResource$EmptyBorderUIResource +javax/swing/border/EmptyBorder +javax/swing/border/AbstractBorder +javax/swing/border/Border +sun/swing/SwingUtilities2$2 +javax/swing/plaf/basic/BasicLookAndFeel$2 +javax/swing/plaf/DimensionUIResource +javax/swing/UIDefaults$LazyInputMap +javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue +sun/swing/SwingUtilities2$AATextInfo +javax/swing/plaf/metal/MetalLookAndFeel$AATextListener +java/beans/PropertyChangeListenerProxy +java/util/EventListenerProxy +javax/swing/plaf/metal/OceanTheme$1 +javax/swing/plaf/metal/OceanTheme$2 +javax/swing/plaf/metal/OceanTheme$3 +javax/swing/plaf/metal/OceanTheme$4 +javax/swing/plaf/metal/OceanTheme$5 +javax/swing/plaf/metal/OceanTheme$6 +javax/swing/SwingPaintEventDispatcher +sun/awt/PaintEventDispatcher +java/awt/KeyboardFocusManager +java/awt/KeyEventDispatcher +java/awt/KeyEventPostProcessor +java/awt/KeyboardFocusManager$1 +sun/awt/AWTAccessor$KeyboardFocusManagerAccessor +java/awt/AWTKeyStroke +java/awt/AWTKeyStroke$1 +java/awt/DefaultKeyboardFocusManager +java/awt/DefaultKeyboardFocusManager$1 +sun/awt/AWTAccessor$DefaultKeyboardFocusManagerAccessor +java/awt/DefaultFocusTraversalPolicy +java/awt/ContainerOrderFocusTraversalPolicy +java/awt/FocusTraversalPolicy +java/util/Collections$UnmodifiableSet +sun/awt/windows/WKeyboardFocusManagerPeer +sun/awt/KeyboardFocusManagerPeerImpl +java/awt/peer/KeyboardFocusManagerPeer +javax/swing/UIManager$2 +javax/swing/JRootPane +javax/swing/UIDefaults$TextAndMnemonicHashMap +com/sun/swing/internal/plaf/metal/resources/metal +sun/util/ResourceBundleEnumeration +com/sun/swing/internal/plaf/basic/resources/basic +javax/swing/plaf/metal/MetalLabelUI +javax/swing/plaf/basic/BasicLabelUI +javax/swing/plaf/LabelUI +javax/swing/plaf/ComponentUI +sun/reflect/misc/MethodUtil +sun/reflect/misc/MethodUtil$1 +sun/net/www/protocol/jar/JarURLConnection +java/net/JarURLConnection +sun/net/www/protocol/jar/JarFileFactory +sun/net/www/protocol/jar/URLJarFile$URLJarFileCloseController +java/net/HttpURLConnection +sun/net/www/protocol/jar/URLJarFile +sun/net/www/protocol/jar/URLJarFile$URLJarFileEntry +sun/net/www/protocol/jar/JarURLConnection$JarURLInputStream +java/lang/UnsupportedOperationException +java/lang/reflect/InvocationTargetException +javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate$1 +javax/swing/plaf/basic/BasicHTML +sun/awt/util/IdentityArrayList +java/awt/Window$Type +java/awt/Window$1 +sun/awt/AWTAccessor$WindowAccessor +java/awt/Frame$1 +sun/awt/AWTAccessor$FrameAccessor +java/awt/Cursor +java/awt/Point +java/awt/geom/Point2D +java/awt/Cursor$1 +sun/awt/AWTAccessor$CursorAccessor +java/awt/GraphicsDevice +sun/java2d/d3d/D3DGraphicsDevice +sun/awt/Win32GraphicsDevice +sun/misc/PerfCounter$WindowsClientCounters +sun/java2d/d3d/D3DRenderQueue +sun/java2d/pipe/RenderQueue +sun/java2d/pipe/RenderBuffer +sun/java2d/d3d/D3DRenderQueue$1 +sun/java2d/d3d/D3DGraphicsDevice$1Result +sun/java2d/d3d/D3DGraphicsDevice$1 +sun/java2d/d3d/D3DContext$D3DContextCaps +sun/java2d/pipe/hw/ContextCapabilities +sun/awt/Win32GraphicsConfig +sun/awt/image/SurfaceManager$ProxiedGraphicsConfig +java/awt/GraphicsConfiguration +java/awt/BorderLayout +java/awt/LayoutManager2 +java/awt/Dialog$ModalExclusionType +java/awt/Window$WindowDisposerRecord +javax/swing/JPanel +java/awt/FlowLayout +javax/swing/plaf/basic/BasicPanelUI +javax/swing/plaf/PanelUI +java/awt/Component$BaselineResizeBehavior +sun/swing/SwingLazyValue$1 +javax/swing/JLayeredPane +javax/swing/JRootPane$1 +javax/swing/ArrayTable +javax/swing/JRootPane$RootLayout +javax/swing/BufferStrategyPaintManager +javax/swing/RepaintManager$PaintManager +javax/swing/FocusManager +javax/swing/LayoutFocusTraversalPolicy +javax/swing/SortingFocusTraversalPolicy +javax/swing/InternalFrameFocusTraversalPolicy +javax/swing/SwingContainerOrderFocusTraversalPolicy +javax/swing/SortingFocusTraversalPolicy$1 +java/util/Spliterator$OfLong +java/util/Spliterator$OfPrimitive +java/util/Spliterator +java/util/Spliterator$OfInt +java/util/Spliterator$OfDouble +java/util/stream/IntStream +java/util/stream/BaseStream +java/util/stream/Stream +java/util/stream/DoubleStream +java/util/stream/LongStream +java/util/function/BinaryOperator +java/util/function/BiFunction +java/util/function/DoubleBinaryOperator +java/util/function/IntBinaryOperator +java/util/function/LongBinaryOperator +java/util/function/IntToLongFunction +java/util/function/IntFunction +java/util/function/IntToDoubleFunction +java/util/function/IntUnaryOperator +javax/swing/SwingDefaultFocusTraversalPolicy +javax/swing/LayoutComparator +javax/swing/plaf/metal/MetalRootPaneUI +javax/swing/plaf/basic/BasicRootPaneUI +javax/swing/plaf/RootPaneUI +javax/swing/plaf/basic/BasicRootPaneUI$RootPaneInputMap +javax/swing/plaf/ComponentInputMapUIResource +javax/swing/ComponentInputMap +javax/swing/InputMap +javax/swing/plaf/InputMapUIResource +javax/swing/KeyStroke +java/awt/VKCollection +java/awt/event/KeyEvent +java/awt/event/KeyEvent$1 +sun/awt/AWTAccessor$KeyEventAccessor +sun/reflect/UnsafeQualifiedStaticIntegerFieldAccessorImpl +javax/swing/plaf/basic/LazyActionMap +javax/swing/plaf/ActionMapUIResource +javax/swing/ActionMap +sun/awt/windows/WFramePeer +java/awt/peer/FramePeer +java/awt/peer/WindowPeer +java/awt/peer/ContainerPeer +sun/awt/windows/WWindowPeer +sun/awt/windows/WPanelPeer +java/awt/peer/PanelPeer +sun/awt/windows/WCanvasPeer +java/awt/peer/CanvasPeer +sun/awt/windows/WWindowPeer$ActiveWindowListener +sun/awt/windows/WWindowPeer$GuiDisposedListener +sun/awt/RepaintArea +sun/awt/ExtendedKeyCodes +sun/awt/EmbeddedFrame +sun/awt/LightweightFrame +sun/awt/im/InputMethodWindow +sun/awt/windows/WComponentPeer$2 +javax/swing/RepaintManager$2 +java/awt/event/InvocationEvent +java/awt/ActiveEvent +java/awt/event/InvocationEvent$1 +sun/awt/AWTAccessor$InvocationEventAccessor +java/awt/EventQueue$5 +java/awt/EventDispatchThread +sun/awt/PeerEvent +java/awt/EventDispatchThread$1 +sun/awt/EventQueueItem +java/awt/Conditional +java/awt/EventDispatchThread$HierarchyEventFilter +java/awt/EventFilter +java/awt/event/WindowEvent +java/awt/ModalEventFilter +sun/awt/EventQueueDelegate +java/awt/event/PaintEvent +sun/java2d/ScreenUpdateManager +java/awt/event/MouseEvent +sun/java2d/d3d/D3DScreenUpdateManager +java/awt/EventFilter$FilterAction +sun/awt/dnd/SunDragSourceContextPeer +java/awt/dnd/peer/DragSourceContextPeer +java/awt/EventQueue$3 +java/awt/MenuComponent +java/awt/TrayIcon +java/awt/event/InputMethodEvent +sun/java2d/d3d/D3DGraphicsConfig +java/awt/event/ActionEvent +sun/java2d/pipe/hw/AccelGraphicsConfig +sun/java2d/pipe/hw/BufferedContextProvider +java/util/LinkedList$ListItr +sun/java2d/windows/GDIWindowSurfaceData +javax/swing/RepaintManager$2$1 +sun/java2d/loops/XORComposite +java/awt/Composite +sun/java2d/windows/GDIBlitLoops +sun/java2d/loops/Blit +sun/java2d/loops/GraphicsPrimitive +sun/java2d/loops/GraphicsPrimitiveMgr +sun/java2d/loops/CompositeType +sun/java2d/SunGraphics2D +sun/awt/ConstrainableGraphics +java/awt/Graphics2D +java/awt/AlphaComposite +java/awt/geom/Path2D +java/awt/geom/Path2D$Float +sun/java2d/loops/BlitBg +sun/java2d/loops/ScaledBlit +sun/java2d/loops/FillRect +sun/java2d/loops/FillSpans +sun/java2d/loops/FillParallelogram +sun/java2d/loops/DrawParallelogram +sun/java2d/loops/DrawLine +sun/java2d/loops/DrawRect +sun/java2d/loops/DrawPolygons +sun/java2d/loops/DrawPath +sun/java2d/loops/FillPath +sun/java2d/loops/MaskBlit +sun/java2d/loops/MaskFill +sun/java2d/loops/DrawGlyphList +sun/java2d/loops/DrawGlyphListAA +sun/java2d/loops/DrawGlyphListLCD +sun/java2d/loops/TransformHelper +java/awt/BasicStroke +java/awt/Stroke +sun/java2d/pipe/ValidatePipe +sun/java2d/loops/CustomComponent +sun/java2d/loops/GraphicsPrimitiveProxy +sun/java2d/loops/GeneralRenderer +sun/java2d/loops/GraphicsPrimitiveMgr$1 +sun/java2d/loops/GraphicsPrimitiveMgr$2 +sun/java2d/windows/GDIRenderer +sun/java2d/loops/RenderLoops +sun/java2d/loops/GraphicsPrimitiveMgr$PrimitiveSpec +java/util/TimSort +sun/java2d/DefaultDisposerRecord +sun/java2d/SurfaceDataProxy +sun/awt/image/SurfaceManager$FlushableCacheData +sun/java2d/SurfaceDataProxy$1 +sun/java2d/StateTracker +sun/java2d/StateTracker$1 +sun/java2d/StateTracker$2 +sun/awt/windows/WColor +sun/awt/windows/WFontPeer +sun/awt/PlatformFont +java/awt/peer/FontPeer +sun/awt/NativeLibLoader +sun/awt/NativeLibLoader$1 +sun/font/SunFontManager +sun/java2d/FontSupport +sun/font/FontManagerForSGE +sun/font/FontManager +sun/font/SunFontManager$TTFilter +java/io/FilenameFilter +sun/font/SunFontManager$T1Filter +sun/font/SunFontManager$1 +sun/font/FontManagerNativeLibrary +sun/font/FontManagerNativeLibrary$1 +sun/font/FontUtilities +sun/font/FontUtilities$1 +sun/font/TrueTypeFont +sun/font/FileFont +sun/font/PhysicalFont +sun/font/Font2D +sun/font/Type1Font +java/awt/geom/Point2D$Float +sun/font/StrikeMetrics +java/awt/geom/Rectangle2D$Float +java/awt/geom/GeneralPath +sun/font/CharToGlyphMapper +sun/font/PhysicalStrike +sun/font/FontStrike +sun/font/StrikeCache +sun/font/StrikeCache$1 +sun/font/GlyphList +sun/font/FontManagerFactory +sun/font/FontManagerFactory$1 +sun/awt/Win32FontManager +sun/awt/Win32FontManager$1 +sun/font/CompositeFont +sun/font/SunFontManager$2 +sun/font/SunFontManager$FontRegistrationInfo +sun/awt/windows/WFontConfiguration +sun/awt/FontConfiguration +sun/awt/FontDescriptor +java/io/DataInputStream +java/io/DataInput +sun/font/CompositeFontDescriptor +sun/font/Font2DHandle +sun/font/FontFamily +sun/font/SunFontManager$3 +sun/awt/Win32FontManager$2 +sun/awt/FontConfiguration$2 +sun/awt/windows/WingDings +sun/awt/windows/WingDings$Encoder +sun/awt/Symbol +sun/awt/Symbol$Encoder +sun/awt/im/InputMethodManager +sun/awt/im/ExecutableInputMethodManager +sun/awt/windows/WInputMethodDescriptor +java/awt/im/spi/InputMethodDescriptor +sun/awt/im/InputMethodLocator +sun/awt/im/ExecutableInputMethodManager$3 +java/awt/peer/LightweightPeer +sun/awt/NullComponentPeer +java/awt/EventQueue$4 +java/awt/SplashScreen +sun/awt/dnd/SunDropTargetEvent +java/awt/Dialog +java/awt/event/FocusEvent +java/util/concurrent/locks/LockSupport +java/awt/Dialog$ModalityType +sun/awt/TimedWindowEvent +java/awt/SequencedEvent +java/awt/SequencedEvent$1 +sun/awt/AWTAccessor$SequencedEventAccessor +java/awt/DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent +java/awt/SentEvent +sun/awt/windows/WGlobalCursorManager +sun/awt/event/IgnorePaintEvent +sun/awt/GlobalCursorManager +sun/awt/GlobalCursorManager$NativeUpdater +java/util/ArrayList$ListItr +sun/awt/CausedFocusEvent$Cause +java/awt/KeyboardFocusManager$HeavyweightFocusRequest +java/awt/DefaultKeyboardFocusManager$TypeAheadMarker +java/awt/KeyboardFocusManager$LightweightFocusRequest +sun/awt/CausedFocusEvent +java/util/IdentityHashMap$KeySet +java/util/IdentityHashMap$KeyIterator +javax/swing/RepaintManager$4 +sun/java2d/d3d/D3DSurfaceData$D3DWindowSurfaceData +sun/java2d/d3d/D3DSurfaceData +sun/java2d/pipe/hw/AccelSurface +java/awt/GraphicsCallback$PaintCallback +java/awt/GraphicsCallback +sun/awt/SunGraphicsCallback +javax/swing/BufferStrategyPaintManager$BufferInfo +java/awt/event/WindowListener +java/awt/event/ComponentAdapter +java/awt/event/ComponentListener +java/awt/AWTEventMulticaster +java/awt/event/ContainerListener +java/awt/event/FocusListener +java/awt/event/KeyListener +java/awt/event/MouseListener +java/awt/event/MouseMotionListener +java/awt/event/WindowFocusListener +java/awt/event/WindowStateListener +java/awt/event/ActionListener +java/awt/event/ItemListener +java/awt/event/AdjustmentListener +java/awt/event/TextListener +java/awt/event/InputMethodListener +java/awt/event/HierarchyListener +java/awt/event/HierarchyBoundsListener +java/awt/event/MouseWheelListener +java/awt/BufferCapabilities +java/awt/Component$BltSubRegionBufferStrategy +sun/awt/SubRegionShowable +java/awt/Component$BltBufferStrategy +java/awt/image/BufferStrategy +sun/awt/image/BufferedImageGraphicsConfig +sun/print/PrinterGraphicsConfig +sun/java2d/opengl/WGLGraphicsConfig +sun/java2d/opengl/OGLGraphicsConfig +sun/awt/image/BufImgVolatileSurfaceManager +java/awt/image/Raster +java/awt/image/DataBufferInt +java/awt/image/DataBuffer +java/awt/image/DataBuffer$1 +sun/awt/image/SunWritableRaster$DataStealer +sun/awt/image/SunWritableRaster +java/awt/image/WritableRaster +java/awt/image/SinglePixelPackedSampleModel +java/awt/image/SampleModel +sun/awt/image/IntegerInterleavedRaster +sun/awt/image/IntegerComponentRaster +sun/awt/image/NativeLibLoader +sun/awt/image/NativeLibLoader$1 +java/awt/image/BufferedImage +java/awt/image/WritableRenderedImage +java/awt/image/RenderedImage +java/awt/image/BufferedImage$1 +sun/awt/image/BufImgSurfaceData +sun/awt/image/BufImgSurfaceData$ICMColorData +sun/font/FontDesignMetrics +java/awt/FontMetrics +sun/font/FontDesignMetrics$MetricsKey +sun/font/FontStrikeDesc +sun/font/CompositeStrike +sun/font/FontStrikeDisposer +sun/java2d/Disposer$PollDisposable +sun/font/StrikeCache$SoftDisposerRef +sun/font/StrikeCache$DisposableStrike +sun/font/TrueTypeFont$TTDisposerRecord +sun/font/TrueTypeFont$1 +java/io/RandomAccessFile +java/io/DataOutput +sun/nio/ch/FileChannelImpl +java/nio/channels/FileChannel +java/nio/channels/SeekableByteChannel +java/nio/channels/ByteChannel +java/nio/channels/ReadableByteChannel +java/nio/channels/Channel +java/nio/channels/WritableByteChannel +java/nio/channels/GatheringByteChannel +java/nio/channels/ScatteringByteChannel +java/nio/channels/spi/AbstractInterruptibleChannel +java/nio/channels/InterruptibleChannel +java/nio/file/attribute/FileAttribute +sun/nio/ch/IOUtil +sun/nio/ch/IOUtil$1 +sun/nio/ch/NativeThreadSet +sun/nio/ch/FileDispatcherImpl +sun/nio/ch/FileDispatcher +sun/nio/ch/NativeDispatcher +sun/nio/ch/FileDispatcherImpl$1 +java/nio/channels/spi/AbstractInterruptibleChannel$1 +sun/nio/ch/NativeThread +sun/nio/ch/IOStatus +sun/nio/ch/Util +sun/nio/ch/Util$1 +sun/nio/ch/Util$BufferCache +java/nio/DirectByteBuffer$Deallocator +java/nio/ByteBufferAsIntBufferB +java/nio/IntBuffer +sun/font/TrueTypeFont$DirectoryEntry +java/nio/ByteBufferAsShortBufferB +java/nio/ShortBuffer +sun/nio/cs/UTF_16$Decoder +sun/nio/cs/UnicodeDecoder +sun/font/FileFontStrike +sun/font/FontScaler +sun/font/T2KFontScaler +sun/font/T2KFontScaler$1 +sun/font/TrueTypeGlyphMapper +sun/font/CMap +sun/font/CMap$NullCMapClass +sun/font/CMap$CMapFormat4 +java/nio/ByteBufferAsCharBufferB +sun/font/FontDesignMetrics$KeyReference +sun/font/CompositeGlyphMapper +java/awt/print/PrinterGraphics +java/awt/PrintGraphics +sun/java2d/loops/FontInfo +java/util/jar/Attributes +java/util/jar/Manifest$FastInputStream +sun/nio/cs/UTF_8$Decoder +java/util/jar/Attributes$Name +sun/misc/ASCIICaseInsensitiveComparator +java/util/jar/JarVerifier +java/security/CodeSigner +java/util/jar/JarVerifier$3 +java/io/ByteArrayOutputStream +java/lang/Package +sun/security/util/SignatureFileVerifier +sun/security/util/ManifestEntryVerifier +java/util/MissingResourceException +java/io/StringWriter +javax/swing/JDialog +javax/swing/text/JTextComponent +javax/swing/Scrollable +javax/swing/JTextArea +javax/swing/JScrollPane +javax/swing/ScrollPaneConstants +javax/swing/AbstractButton +java/awt/ItemSelectable +javax/swing/JButton +java/lang/SecurityException +javax/swing/JWindow +java/lang/NumberFormatException +java/io/UnsupportedEncodingException +sun/misc/URLClassPath$FileLoader +java/lang/IndexOutOfBoundsException +java/lang/CloneNotSupportedException +java/lang/InternalError +java/net/UnknownHostException +java/net/Socket +java/net/SocketAddress +java/nio/channels/SocketChannel +java/nio/channels/NetworkChannel +java/nio/channels/spi/AbstractSelectableChannel +java/nio/channels/SelectableChannel +java/net/InetAddress +java/net/SocketException +java/net/SocketImplFactory +java/net/InetSocketAddress +java/net/InetSocketAddress$InetSocketAddressHolder +java/net/Proxy +java/net/SocketImpl +java/net/SocketOptions +java/net/SocksSocketImpl +java/net/SocksConsts +java/net/PlainSocketImpl +java/net/AbstractPlainSocketImpl +java/net/AbstractPlainSocketImpl$1 +java/net/PlainSocketImpl$1 +java/net/DualStackPlainSocketImpl +java/net/InetAddress$1 +java/net/InetAddress$InetAddressHolder +java/net/InetAddress$Cache +java/net/InetAddress$Cache$Type +java/net/InetAddressImplFactory +java/net/Inet6AddressImpl +java/net/InetAddressImpl +java/net/InetAddress$2 +sun/net/spi/nameservice/NameService +sun/net/util/IPAddressUtil +java/net/Inet4Address +java/net/SocksSocketImpl$3 +java/net/ProxySelector +sun/net/spi/DefaultProxySelector +sun/net/spi/DefaultProxySelector$1 +sun/net/NetProperties +sun/net/NetProperties$1 +java/net/Inet6Address +java/net/URI +java/net/URI$Parser +sun/net/spi/DefaultProxySelector$NonProxyInfo +sun/net/spi/DefaultProxySelector$3 +java/net/Proxy$Type +sun/net/NetHooks +java/net/Inet6Address$Inet6AddressHolder +java/net/SocketTimeoutException +java/io/InterruptedIOException +javax/swing/UnsupportedLookAndFeelException +java/net/MalformedURLException +java/lang/UnsatisfiedLinkError +sun/misc/FDBigInteger +java/util/ResourceBundle$Control$1 +java/net/URLClassLoader$2 +java/util/PropertyResourceBundle +java/util/ResourceBundle$BundleReference +java/util/logging/Level +java/util/logging/Level$KnownLevel +java/util/logging/Logger +java/util/logging/Handler +java/util/logging/Logger$LoggerBundle +java/util/concurrent/CopyOnWriteArrayList +java/util/logging/LogManager +java/util/logging/LogManager$1 +java/util/logging/LogManager$SystemLoggerContext +java/util/logging/LogManager$LoggerContext +java/util/logging/LogManager$LogNode +java/util/logging/LoggingPermission +java/util/logging/LogManager$Cleaner +java/util/logging/LogManager$2 +java/util/logging/LogManager$3 +java/util/logging/LogManager$LoggerWeakRef +java/util/logging/LogManager$LoggerContext$1 +java/util/logging/LogManager$RootLogger +java/util/logging/LogManager$5 +java/util/logging/Logger$1 +sun/util/logging/resources/logging +javax/swing/Box +javax/swing/Box$Filler +javax/swing/Icon +javax/swing/BoxLayout +javax/swing/plaf/basic/BasicPopupMenuUI +javax/swing/plaf/PopupMenuUI +javax/swing/ImageIcon +javax/swing/ImageIcon$1 +javax/swing/ImageIcon$2 +javax/swing/ImageIcon$2$1 +java/awt/dnd/DropTarget +java/awt/dnd/DropTargetListener +javax/accessibility/AccessibleContext +sun/reflect/UnsafeObjectFieldAccessorImpl +java/awt/MediaTracker +sun/misc/SoftCache$ValueCell +sun/awt/image/URLImageSource +sun/awt/image/InputStreamImageSource +java/awt/image/ImageProducer +sun/awt/image/ImageFetchable +sun/awt/image/ToolkitImage +javax/swing/ImageIcon$3 +java/awt/ImageMediaEntry +java/awt/MediaEntry +sun/awt/image/MultiResolutionToolkitImage +sun/awt/image/MultiResolutionImage +sun/awt/image/ImageRepresentation +java/awt/image/ImageConsumer +sun/awt/image/ImageWatched +sun/awt/image/ImageWatched$Link +sun/awt/image/ImageWatched$WeakLink +sun/awt/image/ImageConsumerQueue +sun/awt/image/ImageFetcher +sun/awt/image/FetcherInfo +sun/awt/image/ImageFetcher$1 +sun/net/ProgressMonitor +sun/net/DefaultProgressMeteringPolicy +sun/net/ProgressMeteringPolicy +sun/net/www/MimeTable +java/net/FileNameMap +sun/net/www/MimeTable$1 +sun/net/www/MimeTable$DefaultInstanceHolder +sun/net/www/MimeTable$DefaultInstanceHolder$1 +sun/net/www/MimeEntry +java/net/URLConnection$1 +java/text/SimpleDateFormat +java/text/DateFormat +java/text/Format +java/text/DateFormat$Field +java/text/Format$Field +java/util/TimeZone +sun/util/calendar/ZoneInfo +sun/util/calendar/ZoneInfoFile +sun/util/calendar/ZoneInfoFile$1 +sun/util/calendar/ZoneInfoFile$ZoneOffsetTransitionRule +sun/util/calendar/ZoneInfoFile$Checksum +java/util/zip/CRC32 +java/util/zip/Checksum +java/util/TimeZone$1 +java/util/Calendar +sun/util/spi/CalendarProvider +java/util/spi/LocaleServiceProvider +sun/util/locale/provider/LocaleProviderAdapter +sun/util/locale/provider/JRELocaleProviderAdapter +sun/util/locale/provider/ResourceBundleBasedAdapter +sun/util/locale/provider/SPILocaleProviderAdapter +sun/util/locale/provider/AuxLocaleProviderAdapter +sun/util/locale/provider/AuxLocaleProviderAdapter$NullProvider +sun/util/locale/provider/LocaleProviderAdapter$Type +sun/util/locale/provider/LocaleProviderAdapter$1 +sun/util/locale/provider/CalendarProviderImpl +sun/util/locale/provider/AvailableLanguageTags +sun/util/locale/provider/LocaleDataMetaInfo +sun/util/locale/provider/JRELocaleProviderAdapter$1 +java/util/Calendar$Builder +java/util/GregorianCalendar +sun/util/locale/provider/CalendarDataUtility +java/util/spi/CalendarDataProvider +sun/util/locale/provider/LocaleServiceProviderPool +java/text/spi/BreakIteratorProvider +java/text/spi/CollatorProvider +java/text/spi/DateFormatProvider +java/text/spi/DateFormatSymbolsProvider +java/text/spi/DecimalFormatSymbolsProvider +java/text/spi/NumberFormatProvider +java/util/spi/CurrencyNameProvider +java/util/spi/LocaleNameProvider +java/util/spi/TimeZoneNameProvider +sun/util/locale/provider/CalendarDataProviderImpl +sun/util/locale/provider/SPILocaleProviderAdapter$1 +sun/util/locale/provider/CalendarDataUtility$CalendarWeekParameterGetter +sun/util/locale/provider/LocaleServiceProviderPool$LocalizedObjectGetter +sun/util/locale/provider/LocaleResources +sun/util/resources/LocaleData +sun/util/resources/LocaleData$1 +sun/util/resources/LocaleData$LocaleDataResourceBundleControl +sun/util/locale/LanguageTag +java/util/Collections$EmptyIterator +sun/util/resources/CalendarData +sun/util/resources/LocaleNamesBundle +sun/util/resources/OpenListResourceBundle +sun/util/resources/en/CalendarData_en +sun/util/locale/provider/LocaleResources$ResourceReference +sun/util/calendar/Gregorian$Date +sun/util/calendar/BaseCalendar$Date +sun/util/calendar/CalendarDate +sun/util/calendar/CalendarUtils +java/text/DateFormatSymbols +sun/util/locale/provider/DateFormatSymbolsProviderImpl +sun/text/resources/FormatData +sun/util/resources/ParallelListResourceBundle +java/util/concurrent/atomic/AtomicMarkableReference +java/util/concurrent/atomic/AtomicMarkableReference$Pair +sun/text/resources/en/FormatData_en +sun/text/resources/en/FormatData_en_US +sun/util/resources/ParallelListResourceBundle$KeySet +java/text/NumberFormat +sun/util/locale/provider/NumberFormatProviderImpl +java/text/DecimalFormatSymbols +sun/util/locale/provider/DecimalFormatSymbolsProviderImpl +java/util/Currency +java/util/Currency$1 +sun/util/locale/provider/CurrencyNameProviderImpl +java/util/Currency$CurrencyNameGetter +sun/util/resources/CurrencyNames +sun/util/resources/en/CurrencyNames_en_US +java/text/DecimalFormat +java/text/FieldPosition +java/text/DigitList +java/math/RoundingMode +java/text/DontCareFieldPosition +java/text/DontCareFieldPosition$1 +java/text/Format$FieldDelegate +sun/awt/image/GifImageDecoder +sun/awt/image/ImageDecoder +sun/awt/image/GifFrame +java/awt/image/DataBufferByte +java/awt/image/PixelInterleavedSampleModel +java/awt/image/ComponentSampleModel +sun/awt/image/ByteInterleavedRaster +sun/awt/image/ByteComponentRaster +sun/awt/image/BytePackedRaster +javax/swing/plaf/BorderUIResource +javax/swing/BorderFactory +javax/swing/border/BevelBorder +javax/swing/border/EtchedBorder +javax/swing/plaf/metal/MetalIconFactory +javax/swing/plaf/metal/MetalIconFactory$TreeFolderIcon +javax/swing/plaf/metal/MetalIconFactory$FolderIcon16 +java/lang/ClassLoaderHelper +java/util/zip/ZipInputStream +java/io/PushbackInputStream +java/util/zip/ZipUtils +java/io/RandomAccessFile$1 +java/lang/Thread$State +javax/swing/SwingUtilities$SharedOwnerFrame +javax/swing/border/LineBorder +javax/swing/Popup$HeavyWeightWindow +sun/awt/ModalExclude +javax/swing/SizeRequirements +com/sun/java/swing/plaf/windows/WindowsPopupWindow +java/applet/Applet +java/awt/Panel +javax/swing/JRadioButton +javax/swing/JToggleButton +java/lang/ClassFormatError +sun/awt/image/BufImgSurfaceManager +java/awt/geom/RectIterator +java/awt/geom/PathIterator +javax/swing/CellRendererPane +javax/swing/RepaintManager$3 +java/io/ObjectInputStream +java/io/ObjectInput +java/io/ObjectStreamConstants +javax/swing/JTabbedPane +javax/swing/event/MenuListener +javax/swing/event/ChangeListener +javax/swing/DefaultSingleSelectionModel +javax/swing/SingleSelectionModel +javax/swing/JTabbedPane$ModelListener +javax/swing/plaf/metal/MetalTabbedPaneUI +javax/swing/plaf/basic/BasicTabbedPaneUI +javax/swing/plaf/TabbedPaneUI +javax/swing/plaf/metal/MetalTabbedPaneUI$TabbedPaneLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneScrollLayout +javax/swing/plaf/basic/BasicTabbedPaneUI$Handler +sun/reflect/MethodAccessorGenerator +sun/reflect/AccessorGenerator +sun/reflect/ClassFileConstants +sun/reflect/ByteVectorFactory +sun/reflect/ByteVectorImpl +sun/reflect/ByteVector +sun/reflect/ClassFileAssembler +sun/reflect/UTF8 +sun/reflect/Label +sun/reflect/Label$PatchInfo +sun/reflect/MethodAccessorGenerator$1 +sun/reflect/ClassDefiner +sun/reflect/ClassDefiner$1 +sun/reflect/BootstrapConstructorAccessorImpl +javax/swing/JTextField +javax/swing/JViewport +java/awt/CardLayout +javax/swing/text/Document +javax/swing/text/JTextComponent$1 +sun/swing/SwingAccessor$JTextComponentAccessor +javax/swing/text/JTextComponent$4 +com/sun/beans/util/Cache +com/sun/beans/util/Cache$Kind +com/sun/beans/util/Cache$Kind$1 +com/sun/beans/util/Cache$Kind$2 +com/sun/beans/util/Cache$Kind$3 +com/sun/beans/util/Cache$CacheEntry +javax/swing/Action +javax/swing/JTextField$NotifyAction +javax/swing/text/TextAction +javax/swing/AbstractAction +java/lang/ArrayIndexOutOfBoundsException +javax/swing/DropMode +javax/swing/text/JTextComponent$MutableCaretEvent +javax/swing/event/CaretEvent +javax/swing/plaf/metal/MetalTextFieldUI +javax/swing/plaf/basic/BasicTextFieldUI +javax/swing/plaf/basic/BasicTextUI +javax/swing/text/ViewFactory +javax/swing/plaf/TextUI +javax/swing/plaf/basic/BasicTextUI$BasicCursor +javax/swing/text/DefaultEditorKit +javax/swing/text/EditorKit +javax/swing/text/DefaultEditorKit$InsertContentAction +javax/swing/text/DefaultEditorKit$DeletePrevCharAction +javax/swing/text/DefaultEditorKit$DeleteNextCharAction +javax/swing/text/DefaultEditorKit$ReadOnlyAction +javax/swing/text/DefaultEditorKit$DeleteWordAction +javax/swing/text/DefaultEditorKit$WritableAction +javax/swing/text/DefaultEditorKit$CutAction +javax/swing/text/DefaultEditorKit$CopyAction +javax/swing/text/DefaultEditorKit$PasteAction +javax/swing/text/DefaultEditorKit$VerticalPageAction +javax/swing/text/DefaultEditorKit$PageAction +javax/swing/text/DefaultEditorKit$InsertBreakAction +javax/swing/text/DefaultEditorKit$BeepAction +javax/swing/text/DefaultEditorKit$NextVisualPositionAction +javax/swing/text/DefaultEditorKit$BeginWordAction +javax/swing/text/DefaultEditorKit$EndWordAction +javax/swing/text/DefaultEditorKit$PreviousWordAction +javax/swing/text/DefaultEditorKit$NextWordAction +javax/swing/text/DefaultEditorKit$BeginLineAction +javax/swing/text/DefaultEditorKit$EndLineAction +javax/swing/text/DefaultEditorKit$BeginParagraphAction +javax/swing/text/DefaultEditorKit$EndParagraphAction +javax/swing/text/DefaultEditorKit$BeginAction +javax/swing/text/DefaultEditorKit$EndAction +javax/swing/text/DefaultEditorKit$DefaultKeyTypedAction +javax/swing/text/DefaultEditorKit$InsertTabAction +javax/swing/text/DefaultEditorKit$SelectWordAction +javax/swing/text/DefaultEditorKit$SelectLineAction +javax/swing/text/DefaultEditorKit$SelectParagraphAction +javax/swing/text/DefaultEditorKit$SelectAllAction +javax/swing/text/DefaultEditorKit$UnselectAction +javax/swing/text/DefaultEditorKit$ToggleComponentOrientationAction +javax/swing/text/DefaultEditorKit$DumpModelAction +javax/swing/plaf/basic/BasicTextUI$TextTransferHandler +javax/swing/TransferHandler +javax/swing/TransferHandler$TransferAction +sun/swing/UIAction +javax/swing/text/Position$Bias +javax/swing/plaf/basic/BasicTextUI$RootView +javax/swing/text/View +javax/swing/plaf/basic/BasicTextUI$UpdateHandler +javax/swing/event/DocumentListener +javax/swing/plaf/basic/BasicTextUI$DragListener +javax/swing/plaf/basic/DragRecognitionSupport$BeforeDrag +javax/swing/event/MouseInputAdapter +javax/swing/event/MouseInputListener +java/awt/event/MouseAdapter +javax/swing/plaf/metal/MetalBorders +javax/swing/plaf/BorderUIResource$CompoundBorderUIResource +javax/swing/border/CompoundBorder +javax/swing/plaf/metal/MetalBorders$TextFieldBorder +javax/swing/plaf/metal/MetalBorders$Flush3DBorder +javax/swing/plaf/basic/BasicBorders$MarginBorder +javax/swing/plaf/basic/BasicTextUI$BasicCaret +javax/swing/text/DefaultCaret +javax/swing/text/Caret +javax/swing/text/DefaultCaret$Handler +java/awt/datatransfer/ClipboardOwner +javax/swing/Timer +javax/swing/Timer$DoPostEvent +javax/swing/plaf/basic/BasicTextUI$BasicHighlighter +javax/swing/text/DefaultHighlighter +javax/swing/text/LayeredHighlighter +javax/swing/text/Highlighter +javax/swing/text/Highlighter$Highlight +javax/swing/text/DefaultHighlighter$DefaultHighlightPainter +javax/swing/text/LayeredHighlighter$LayerPainter +javax/swing/text/Highlighter$HighlightPainter +javax/swing/text/DefaultHighlighter$SafeDamager +javax/swing/ClientPropertyKey +javax/swing/ClientPropertyKey$1 +sun/awt/AWTAccessor$ClientPropertyKeyAccessor +javax/swing/TransferHandler$SwingDropTarget +java/awt/dnd/DropTargetContext +java/awt/datatransfer/SystemFlavorMap +java/awt/datatransfer/FlavorMap +java/awt/datatransfer/FlavorTable +java/awt/datatransfer/SystemFlavorMap$SoftCache +javax/swing/TransferHandler$DropHandler +javax/swing/TransferHandler$TransferSupport +javax/swing/text/PlainDocument +javax/swing/text/AbstractDocument +javax/swing/text/GapContent +javax/swing/text/AbstractDocument$Content +javax/swing/text/GapVector +javax/swing/text/GapContent$MarkVector +javax/swing/text/GapContent$MarkData +javax/swing/text/StyleContext +javax/swing/text/AbstractDocument$AttributeContext +javax/swing/text/StyleConstants +javax/swing/text/StyleConstants$CharacterConstants +javax/swing/text/AttributeSet$CharacterAttribute +javax/swing/text/StyleConstants$FontConstants +javax/swing/text/AttributeSet$FontAttribute +javax/swing/text/StyleConstants$ColorConstants +javax/swing/text/AttributeSet$ColorAttribute +javax/swing/text/StyleConstants$ParagraphConstants +javax/swing/text/AttributeSet$ParagraphAttribute +javax/swing/text/StyleContext$FontKey +javax/swing/text/SimpleAttributeSet +javax/swing/text/MutableAttributeSet +javax/swing/text/AttributeSet +javax/swing/text/SimpleAttributeSet$EmptyAttributeSet +javax/swing/text/StyleContext$NamedStyle +javax/swing/text/Style +java/util/Collections$EmptyEnumeration +javax/swing/text/StyleContext$SmallAttributeSet +java/util/LinkedHashMap$LinkedKeySet +java/util/Collections$3 +java/util/LinkedHashMap$LinkedKeyIterator +javax/swing/text/AbstractDocument$BidiRootElement +javax/swing/text/AbstractDocument$BranchElement +javax/swing/text/AbstractDocument$AbstractElement +javax/swing/text/Element +javax/swing/tree/TreeNode +javax/swing/text/AbstractDocument$1 +javax/swing/text/AbstractDocument$BidiElement +javax/swing/text/AbstractDocument$LeafElement +javax/swing/text/GapContent$StickyPosition +javax/swing/text/Position +javax/swing/text/StyleContext$KeyEnumeration +javax/swing/text/FieldView +javax/swing/text/PlainView +javax/swing/text/TabExpander +javax/swing/text/JTextComponent$DefaultKeymap +javax/swing/text/Keymap +javax/swing/text/JTextComponent$KeymapWrapper +javax/swing/text/JTextComponent$KeymapActionMap +javax/swing/plaf/basic/BasicTextUI$FocusAction +javax/swing/plaf/basic/BasicTextUI$TextActionWrapper +javax/swing/plaf/synth/SynthUI +javax/swing/plaf/synth/SynthConstants +javax/swing/JEditorPane +javax/swing/DefaultBoundedRangeModel +javax/swing/BoundedRangeModel +javax/swing/JTextField$ScrollRepainter +javax/swing/DefaultButtonModel +javax/swing/ButtonModel +javax/swing/AbstractButton$Handler +javax/swing/plaf/basic/BasicButtonUI +javax/swing/plaf/ButtonUI +javax/swing/plaf/metal/MetalBorders$ButtonBorder +javax/swing/plaf/basic/BasicButtonListener +javax/swing/event/AncestorListener +java/beans/VetoableChangeListener +javax/swing/plaf/metal/MetalComboBoxButton +javax/swing/plaf/basic/BasicArrowButton +javax/swing/plaf/metal/MetalScrollButton +sun/swing/ImageIconUIResource +javax/swing/GrayFilter +java/awt/image/RGBImageFilter +java/awt/image/ImageFilter +java/awt/image/FilteredImageSource +javax/swing/plaf/basic/BasicGraphicsUtils +javax/swing/ButtonGroup +org/xml/sax/SAXException +javax/xml/parsers/ParserConfigurationException +org/xml/sax/EntityResolver +org/w3c/dom/Node +java/io/StringReader +java/security/NoSuchAlgorithmException +java/security/GeneralSecurityException +java/util/zip/DeflaterOutputStream +java/util/zip/GZIPInputStream +org/xml/sax/InputSource +javax/xml/parsers/DocumentBuilderFactory +javax/xml/parsers/FactoryFinder +javax/xml/parsers/SecuritySupport +javax/xml/parsers/SecuritySupport$2 +javax/xml/parsers/SecuritySupport$5 +javax/xml/parsers/FactoryFinder$1 +javax/xml/parsers/DocumentBuilder +org/w3c/dom/Document +org/xml/sax/helpers/DefaultHandler +org/xml/sax/DTDHandler +org/xml/sax/ContentHandler +org/xml/sax/ErrorHandler +org/xml/sax/SAXNotSupportedException +org/xml/sax/Locator +org/xml/sax/SAXNotRecognizedException +org/xml/sax/SAXParseException +org/w3c/dom/NodeList +org/w3c/dom/events/EventTarget +org/w3c/dom/traversal/DocumentTraversal +org/w3c/dom/events/DocumentEvent +org/w3c/dom/ranges/DocumentRange +org/w3c/dom/Entity +org/w3c/dom/Element +org/w3c/dom/CharacterData +org/w3c/dom/CDATASection +org/w3c/dom/Text +org/xml/sax/AttributeList +org/w3c/dom/DOMException +org/w3c/dom/DocumentType +org/w3c/dom/Notation +org/w3c/dom/Attr +org/w3c/dom/EntityReference +org/w3c/dom/ProcessingInstruction +org/w3c/dom/Comment +org/w3c/dom/DocumentFragment +org/w3c/dom/traversal/TreeWalker +org/w3c/dom/ranges/Range +org/w3c/dom/events/Event +org/w3c/dom/events/MutationEvent +org/w3c/dom/traversal/NodeIterator +org/w3c/dom/events/EventException +java/lang/StringIndexOutOfBoundsException +org/w3c/dom/NamedNodeMap +java/awt/GridLayout +javax/swing/JToggleButton$ToggleButtonModel +javax/swing/plaf/metal/MetalRadioButtonUI +javax/swing/plaf/basic/BasicRadioButtonUI +javax/swing/plaf/basic/BasicToggleButtonUI +javax/swing/plaf/basic/BasicBorders +javax/swing/plaf/basic/BasicBorders$RadioButtonBorder +javax/swing/plaf/basic/BasicBorders$ButtonBorder +javax/swing/plaf/metal/MetalIconFactory$RadioButtonIcon +javax/swing/plaf/basic/BasicRadioButtonUI$KeyHandler +javax/swing/plaf/basic/BasicRadioButtonUI$SelectPreviousBtn +javax/swing/plaf/basic/BasicRadioButtonUI$SelectNextBtn +javax/swing/event/ChangeEvent +java/awt/event/ItemEvent +javax/swing/ToolTipManager +javax/swing/ToolTipManager$insideTimerAction +javax/swing/ToolTipManager$outsideTimerAction +javax/swing/ToolTipManager$stillInsideTimerAction +javax/swing/ToolTipManager$MoveBeforeEnterListener +java/awt/event/MouseMotionAdapter +javax/swing/ToolTipManager$AccessibilityKeyListener +java/awt/event/KeyAdapter +java/awt/CardLayout$Card +javax/swing/JComboBox +javax/swing/event/ListDataListener +javax/swing/JCheckBox +javax/swing/JPopupMenu +javax/swing/MenuElement +javax/swing/DefaultComboBoxModel +javax/swing/MutableComboBoxModel +javax/swing/ComboBoxModel +javax/swing/ListModel +javax/swing/AbstractListModel +javax/swing/JComboBox$1 +javax/swing/AncestorNotifier +javax/swing/plaf/metal/MetalComboBoxUI +javax/swing/plaf/basic/BasicComboBoxUI +javax/swing/plaf/ComboBoxUI +javax/swing/plaf/metal/MetalComboBoxUI$MetalComboBoxLayoutManager +javax/swing/plaf/basic/BasicComboBoxUI$ComboBoxLayoutManager +javax/swing/plaf/basic/BasicComboPopup +javax/swing/plaf/basic/ComboPopup +javax/swing/plaf/basic/BasicComboPopup$EmptyListModelClass +javax/swing/plaf/basic/BasicLookAndFeel$AWTEventHelper +java/awt/event/AWTEventListenerProxy +java/awt/Toolkit$SelectiveAWTEventListener +java/awt/Toolkit$ToolkitEventMulticaster +javax/swing/plaf/basic/BasicLookAndFeel$1 +javax/swing/plaf/basic/DefaultMenuLayout +javax/swing/plaf/metal/MetalBorders$PopupMenuBorder +javax/swing/plaf/basic/BasicPopupMenuUI$BasicPopupMenuListener +javax/swing/event/PopupMenuListener +javax/swing/plaf/basic/BasicPopupMenuUI$BasicMenuKeyListener +javax/swing/event/MenuKeyListener +javax/swing/plaf/basic/BasicPopupMenuUI$MouseGrabber +javax/swing/MenuSelectionManager +javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper +javax/swing/plaf/basic/BasicPopupMenuUI$MenuKeyboardHelper$1 +java/awt/event/FocusAdapter +javax/swing/plaf/basic/BasicComboPopup$1 +javax/swing/JList +javax/swing/DefaultListSelectionModel +javax/swing/ListSelectionModel +javax/swing/plaf/basic/BasicListUI +javax/swing/plaf/ListUI +javax/swing/plaf/basic/BasicListUI$ListTransferHandler +javax/swing/DefaultListCellRenderer$UIResource +javax/swing/DefaultListCellRenderer +javax/swing/ListCellRenderer +javax/swing/plaf/basic/BasicListUI$Handler +javax/swing/event/ListSelectionListener +javax/swing/JMenu +javax/swing/JMenuItem +javax/swing/event/ListSelectionEvent +javax/swing/plaf/basic/BasicComboPopup$Handler +javax/swing/ScrollPaneLayout$UIResource +javax/swing/ScrollPaneLayout +javax/swing/ViewportLayout +javax/swing/plaf/basic/BasicViewportUI +javax/swing/plaf/ViewportUI +javax/swing/JScrollPane$ScrollBar +javax/swing/JScrollBar +java/awt/Adjustable +javax/swing/JScrollBar$ModelListener +javax/swing/plaf/metal/MetalScrollBarUI +javax/swing/plaf/basic/BasicScrollBarUI +javax/swing/plaf/ScrollBarUI +javax/swing/plaf/metal/MetalBumps +javax/swing/plaf/basic/BasicScrollBarUI$TrackListener +javax/swing/plaf/basic/BasicScrollBarUI$ArrowButtonListener +javax/swing/plaf/basic/BasicScrollBarUI$ModelListener +javax/swing/plaf/metal/MetalScrollBarUI$ScrollBarListener +javax/swing/plaf/basic/BasicScrollBarUI$PropertyChangeHandler +javax/swing/plaf/basic/BasicScrollBarUI$Handler +javax/swing/plaf/basic/BasicScrollBarUI$ScrollListener +javax/swing/JViewport$ViewListener +javax/swing/plaf/metal/MetalScrollPaneUI +javax/swing/plaf/basic/BasicScrollPaneUI +javax/swing/plaf/ScrollPaneUI +javax/swing/plaf/metal/MetalBorders$ScrollPaneBorder +javax/swing/plaf/basic/BasicScrollPaneUI$Handler +javax/swing/plaf/metal/MetalScrollPaneUI$1 +javax/swing/plaf/basic/BasicComboBoxRenderer$UIResource +javax/swing/plaf/basic/BasicComboBoxRenderer +javax/swing/plaf/metal/MetalComboBoxEditor$UIResource +javax/swing/plaf/metal/MetalComboBoxEditor +javax/swing/plaf/basic/BasicComboBoxEditor +javax/swing/ComboBoxEditor +javax/swing/plaf/basic/BasicComboBoxEditor$BorderlessTextField +javax/swing/plaf/basic/BasicComboBoxEditor$UIResource +javax/swing/text/Segment +java/text/CharacterIterator +javax/swing/plaf/metal/MetalComboBoxEditor$1 +javax/swing/plaf/metal/MetalComboBoxEditor$EditorBorder +javax/swing/JToolBar +javax/swing/plaf/metal/MetalComboBoxUI$MetalPropertyChangeListener +javax/swing/plaf/basic/BasicComboBoxUI$PropertyChangeHandler +javax/swing/plaf/basic/BasicComboBoxUI$Handler +javax/swing/plaf/metal/MetalComboBoxIcon +javax/swing/plaf/metal/MetalComboBoxButton$1 +javax/swing/plaf/basic/BasicComboBoxUI$DefaultKeySelectionManager +javax/swing/JComboBox$KeySelectionManager +javax/swing/plaf/metal/MetalCheckBoxUI +javax/swing/plaf/metal/MetalIconFactory$CheckBoxIcon +java/lang/ExceptionInInitializerError +com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI +javax/swing/JProgressBar +javax/swing/JProgressBar$ModelListener +javax/swing/plaf/metal/MetalProgressBarUI +javax/swing/plaf/basic/BasicProgressBarUI +javax/swing/plaf/ProgressBarUI +javax/swing/plaf/BorderUIResource$LineBorderUIResource +javax/swing/plaf/basic/BasicProgressBarUI$Handler +javax/swing/JTable +javax/swing/event/TableModelListener +javax/swing/event/TableColumnModelListener +javax/swing/event/CellEditorListener +javax/swing/event/RowSorterListener +javax/swing/tree/TreeModel +javax/swing/table/TableCellRenderer +javax/swing/table/JTableHeader +javax/swing/event/TreeExpansionListener +javax/swing/table/AbstractTableModel +javax/swing/table/TableModel +javax/swing/table/DefaultTableCellRenderer +javax/swing/JCheckBoxMenuItem +javax/swing/JTree +javax/swing/tree/TreeSelectionModel +javax/swing/tree/DefaultTreeCellRenderer +javax/swing/tree/TreeCellRenderer +javax/swing/table/TableCellEditor +javax/swing/CellEditor +javax/swing/JToolTip +javax/swing/table/TableColumn +javax/swing/table/DefaultTableColumnModel +javax/swing/table/TableColumnModel +javax/swing/table/DefaultTableModel +javax/swing/event/TableModelEvent +sun/swing/table/DefaultTableCellHeaderRenderer +sun/swing/table/DefaultTableCellHeaderRenderer$EmptyIcon +javax/swing/plaf/basic/BasicTableHeaderUI +javax/swing/plaf/TableHeaderUI +javax/swing/plaf/basic/BasicTableHeaderUI$1 +javax/swing/plaf/basic/BasicTableHeaderUI$MouseInputHandler +javax/swing/DefaultCellEditor +javax/swing/tree/TreeCellEditor +javax/swing/AbstractCellEditor +javax/swing/plaf/basic/BasicTableUI +javax/swing/plaf/TableUI +javax/swing/plaf/basic/BasicTableUI$TableTransferHandler +javax/swing/plaf/basic/BasicTableUI$Handler +javax/swing/tree/DefaultTreeSelectionModel +javax/swing/tree/TreePath +javax/swing/plaf/metal/MetalTreeUI +javax/swing/plaf/basic/BasicTreeUI +javax/swing/plaf/TreeUI +javax/swing/plaf/basic/BasicTreeUI$Actions +javax/swing/plaf/basic/BasicTreeUI$TreeTransferHandler +javax/swing/plaf/metal/MetalTreeUI$LineListener +javax/swing/plaf/basic/BasicTreeUI$Handler +javax/swing/event/TreeModelListener +javax/swing/event/TreeSelectionListener +javax/swing/event/SwingPropertyChangeSupport +javax/swing/tree/VariableHeightLayoutCache +javax/swing/tree/AbstractLayoutCache +javax/swing/tree/RowMapper +javax/swing/plaf/basic/BasicTreeUI$NodeDimensionsHandler +javax/swing/tree/AbstractLayoutCache$NodeDimensions +javax/swing/JTree$TreeModelHandler +javax/swing/tree/VariableHeightLayoutCache$TreeStateNode +javax/swing/tree/DefaultMutableTreeNode +javax/swing/tree/MutableTreeNode +javax/swing/tree/DefaultMutableTreeNode$PreorderEnumeration +java/util/Vector$1 +javax/swing/event/TableColumnModelEvent +javax/swing/JPopupMenu$Separator +javax/swing/JSeparator +java/text/ParseException +java/text/NumberFormat$Field +javax/swing/text/GapContent$InsertUndo +javax/swing/undo/AbstractUndoableEdit +javax/swing/undo/UndoableEdit +javax/swing/text/AbstractDocument$DefaultDocumentEvent +javax/swing/event/DocumentEvent +javax/swing/undo/CompoundEdit +javax/swing/event/DocumentEvent$EventType +javax/swing/text/Utilities +javax/swing/text/SegmentCache +javax/swing/text/SegmentCache$CachedSegment +javax/swing/event/DocumentEvent$ElementChange +javax/swing/event/UndoableEditEvent +javax/swing/event/UndoableEditListener +java/awt/Canvas +java/util/Locale$Category +java/util/Locale$1 +javax/swing/filechooser/FileFilter +java/io/FileWriter +javax/swing/tree/DefaultTreeModel +javax/swing/tree/DefaultTreeCellEditor +javax/swing/tree/DefaultTreeCellEditor$1 +javax/swing/tree/DefaultTreeCellEditor$DefaultTextField +javax/swing/DefaultCellEditor$1 +javax/swing/DefaultCellEditor$EditorDelegate +javax/swing/tree/DefaultTreeCellEditor$EditorContainer +javax/swing/JTree$TreeSelectionRedirector +javax/swing/JMenuItem$MenuItemFocusListener +javax/swing/plaf/basic/BasicMenuItemUI +javax/swing/plaf/MenuItemUI +javax/swing/plaf/metal/MetalBorders$MenuItemBorder +javax/swing/plaf/metal/MetalIconFactory$MenuItemArrowIcon +sun/swing/MenuItemLayoutHelper +javax/swing/plaf/basic/BasicMenuItemUI$Handler +javax/swing/event/MenuDragMouseListener +javax/swing/event/TreeModelEvent +javax/swing/JSplitPane +javax/swing/plaf/metal/MetalSplitPaneUI +javax/swing/plaf/basic/BasicSplitPaneUI +javax/swing/plaf/SplitPaneUI +javax/swing/plaf/basic/BasicSplitPaneDivider +javax/swing/plaf/basic/BasicBorders$SplitPaneBorder +javax/swing/plaf/metal/MetalSplitPaneDivider +javax/swing/plaf/basic/BasicSplitPaneDivider$DividerLayout +javax/swing/plaf/basic/BasicSplitPaneDivider$MouseHandler +javax/swing/plaf/basic/BasicBorders$SplitPaneDividerBorder +javax/swing/plaf/basic/BasicSplitPaneUI$BasicHorizontalLayoutManager +javax/swing/plaf/basic/BasicSplitPaneUI$1 +javax/swing/plaf/basic/BasicSplitPaneUI$Handler +javax/swing/plaf/metal/MetalSplitPaneDivider$1 +javax/swing/plaf/basic/BasicSplitPaneDivider$OneTouchActionHandler +javax/swing/plaf/metal/MetalSplitPaneDivider$2 +javax/swing/border/TitledBorder +javax/swing/plaf/basic/BasicTextAreaUI +javax/swing/text/AbstractDocument$ElementEdit +java/util/Random +java/util/concurrent/atomic/AtomicLong +java/net/NoRouteToHostException +java/net/BindException +javax/swing/tree/PathPlaceHolder +javax/swing/event/TreeSelectionEvent +javax/swing/JList$3 +javax/swing/JList$ListSelectionHandler +javax/swing/JSlider +javax/swing/JSlider$ModelListener +javax/swing/plaf/metal/MetalSliderUI +javax/swing/plaf/basic/BasicSliderUI +javax/swing/plaf/SliderUI +javax/swing/plaf/basic/BasicSliderUI$Actions +javax/swing/plaf/metal/MetalIconFactory$HorizontalSliderThumbIcon +javax/swing/plaf/metal/MetalIconFactory$VerticalSliderThumbIcon +javax/swing/plaf/basic/BasicSliderUI$TrackListener +javax/swing/plaf/basic/BasicSliderUI$Handler +javax/swing/plaf/basic/BasicSliderUI$ScrollListener +javax/swing/plaf/metal/MetalSliderUI$MetalPropertyListener +javax/swing/plaf/basic/BasicSliderUI$PropertyChangeHandler +sun/font/SunFontManager$FamilyDescription +java/util/concurrent/ConcurrentHashMap$KeyIterator +java/util/concurrent/ConcurrentHashMap$BaseIterator +java/util/concurrent/ConcurrentHashMap$Traverser +sun/font/SunFontManager$10 +sun/font/SunFontManager$11 +java/util/concurrent/ConcurrentHashMap$ValueIterator +java/lang/CharacterData00 +javax/swing/DefaultListModel +javax/swing/event/ListDataEvent +javax/sound/sampled/DataLine +javax/sound/sampled/Line +javax/sound/sampled/Line$Info +javax/sound/sampled/DataLine$Info +javax/sound/sampled/Control$Type +javax/sound/sampled/FloatControl$Type +javax/sound/sampled/LineUnavailableException +javax/sound/sampled/UnsupportedAudioFileException +javax/swing/JMenuBar +javax/swing/plaf/basic/BasicMenuBarUI +javax/swing/plaf/MenuBarUI +javax/swing/plaf/metal/MetalBorders$MenuBarBorder +javax/swing/plaf/basic/BasicMenuBarUI$Handler +javax/swing/KeyboardManager +javax/swing/JRadioButtonMenuItem +javax/swing/JMenu$MenuChangeListener +javax/swing/plaf/basic/BasicMenuUI +javax/swing/plaf/metal/MetalIconFactory$MenuArrowIcon +javax/swing/plaf/basic/BasicMenuUI$Handler +javax/swing/JMenuItem$AccessibleJMenuItem +javax/swing/AbstractButton$AccessibleAbstractButton +javax/accessibility/AccessibleAction +javax/accessibility/AccessibleValue +javax/accessibility/AccessibleText +javax/accessibility/AccessibleExtendedComponent +javax/accessibility/AccessibleComponent +javax/swing/JComponent$AccessibleJComponent +java/awt/Container$AccessibleAWTContainer +java/awt/Component$AccessibleAWTComponent +javax/accessibility/AccessibleContext$1 +sun/awt/AWTAccessor$AccessibleContextAccessor +javax/accessibility/AccessibleRelationSet +javax/swing/JMenu$WinListener +java/awt/event/WindowAdapter +javax/swing/plaf/metal/MetalPopupMenuSeparatorUI +javax/swing/plaf/metal/MetalSeparatorUI +javax/swing/plaf/basic/BasicSeparatorUI +javax/swing/plaf/SeparatorUI +javax/accessibility/AccessibleState +javax/accessibility/AccessibleBundle +javax/swing/plaf/basic/BasicCheckBoxMenuItemUI +javax/swing/plaf/metal/MetalIconFactory$CheckBoxMenuItemIcon +javax/swing/JCheckBoxMenuItem$AccessibleJCheckBoxMenuItem +javax/swing/plaf/basic/BasicRadioButtonMenuItemUI +javax/swing/plaf/metal/MetalIconFactory$RadioButtonMenuItemIcon +java/awt/event/ContainerEvent +sun/awt/image/ImageDecoder$1 +java/awt/im/InputContext +sun/awt/im/InputMethodContext +java/awt/im/spi/InputMethodContext +java/awt/im/InputMethodRequests +sun/awt/im/InputContext +sun/awt/windows/WInputMethod +sun/awt/im/InputMethodAdapter +java/awt/im/spi/InputMethod +sun/util/locale/ParseStatus +sun/util/locale/StringTokenIterator +sun/util/locale/InternalLocaleBuilder +sun/util/locale/InternalLocaleBuilder$CaseInsensitiveChar +javax/swing/JTabbedPane$Page +java/net/DatagramSocket +java/net/MulticastSocket +java/net/DatagramPacket +java/net/DatagramPacket$1 +java/net/Inet4AddressImpl +sun/net/InetAddressCachePolicy +sun/net/InetAddressCachePolicy$1 +java/security/Security +java/security/Security$1 +sun/net/InetAddressCachePolicy$2 +java/net/InetAddress$CacheEntry +java/text/Collator +java/net/DefaultDatagramSocketImplFactory +sun/util/locale/provider/CollatorProviderImpl +java/net/DefaultDatagramSocketImplFactory$1 +java/net/DualStackPlainDatagramSocketImpl +java/util/Collections$UnmodifiableList$1 +java/net/AbstractPlainDatagramSocketImpl +java/net/DatagramSocketImpl +sun/text/resources/CollationData +java/net/AbstractPlainDatagramSocketImpl$1 +java/text/RuleBasedCollator +java/net/TwoStacksPlainDatagramSocketImpl +java/text/RBCollationTables +java/net/DatagramSocket$1 +java/text/RBTableBuilder +java/net/NetworkInterface +java/text/RBCollationTables$BuildAPI +sun/text/IntHashtable +sun/net/ResourceManager +sun/text/UCompactIntArray +sun/text/normalizer/NormalizerImpl +sun/text/normalizer/ICUData +java/net/NetworkInterface$1 +java/net/InterfaceAddress +java/net/DefaultInterface +java/net/ServerSocket +sun/text/normalizer/NormalizerDataReader +sun/text/normalizer/ICUBinary$Authenticate +sun/text/normalizer/ICUBinary +sun/text/normalizer/NormalizerImpl$FCDTrieImpl +sun/text/normalizer/Trie$DataManipulate +sun/text/normalizer/NormalizerImpl$NormTrieImpl +sun/text/normalizer/NormalizerImpl$AuxTrieImpl +sun/text/normalizer/IntTrie +sun/text/normalizer/Trie +sun/text/normalizer/CharTrie +sun/text/normalizer/CharTrie$FriendAgent +sun/text/normalizer/UnicodeSet +sun/text/normalizer/UnicodeMatcher +sun/text/normalizer/NormalizerImpl$DecomposeArgs +java/text/MergeCollation +java/text/PatternEntry$Parser +java/text/PatternEntry +java/text/EntryPair +sun/text/ComposedCharIter +sun/text/normalizer/UTF16 +sun/net/www/protocol/http/Handler +java/security/SignatureException +java/security/InvalidKeyException +java/security/KeyException +java/security/Signature +java/security/SignatureSpi +java/io/ObjectInputStream$BlockDataInputStream +java/io/ObjectInputStream$PeekInputStream +java/io/ObjectInputStream$HandleTable +java/io/ObjectInputStream$HandleTable$HandleList +java/io/ObjectInputStream$ValidationList +java/io/Bits +java/io/ObjectStreamClass +sun/security/provider/DSAPublicKey +java/security/interfaces/DSAPublicKey +java/security/interfaces/DSAKey +java/security/PublicKey +java/security/Key +sun/security/x509/X509Key +java/io/ObjectStreamClass$Caches +java/io/ObjectStreamClass$WeakClassKey +java/io/ObjectStreamClass$EntryFuture +java/io/ObjectOutputStream +java/io/ObjectOutput +java/lang/reflect/Proxy +java/lang/reflect/InvocationHandler +java/lang/reflect/WeakCache +java/lang/reflect/Proxy$KeyFactory +java/lang/reflect/Proxy$ProxyClassFactory +java/io/Externalizable +java/io/ObjectStreamClass$2 +sun/security/x509/AlgorithmId +sun/security/util/DerEncoder +sun/security/util/BitArray +sun/reflect/SerializationConstructorAccessorImpl +sun/reflect/UnsafeQualifiedStaticLongFieldAccessorImpl +java/io/ObjectStreamClass$FieldReflectorKey +sun/security/util/DerOutputStream +java/io/ObjectStreamClass$FieldReflector +sun/security/util/DerValue +java/io/ObjectStreamClass$1 +java/io/DataOutputStream +java/io/ObjectStreamClass$MemberSignature +java/math/BigInteger +java/io/ObjectStreamClass$3 +java/io/ObjectStreamClass$4 +java/security/interfaces/DSAParams +java/io/ObjectStreamClass$5 +java/io/ObjectStreamClass$ClassDataSlot +java/io/SerialCallbackContext +java/security/MessageDigest +java/security/MessageDigestSpi +sun/security/util/DerInputStream +sun/security/jca/GetInstance +sun/security/util/DerInputBuffer +sun/security/jca/Providers +java/lang/InheritableThreadLocal +sun/security/util/ObjectIdentifier +sun/security/jca/ProviderList +sun/security/jca/ProviderConfig +java/security/Provider +sun/security/jca/ProviderList$3 +sun/security/jca/ProviderList$1 +java/security/Provider$ServiceKey +java/security/Provider$EngineDescription +java/security/AlgorithmParameters +java/security/AlgorithmParametersSpi +sun/security/jca/ProviderList$2 +sun/security/jca/ProviderConfig$2 +sun/security/provider/Sun +sun/security/provider/SunEntries +sun/security/provider/SunEntries$1 +sun/security/provider/NativePRNG +sun/security/provider/NativePRNG$Blocking +sun/security/provider/NativePRNG$NonBlocking +java/security/Provider$Service +java/security/Provider$UString +sun/security/provider/SHA +sun/security/provider/DSAParameters +sun/security/provider/DigestBase +sun/security/jca/GetInstance$Instance +java/security/MessageDigest$Delegate +sun/security/util/ByteArrayLexOrder +sun/security/util/ByteArrayTagOrder +sun/security/provider/ByteArrayAccess +sun/security/util/DerIndefLenConverter +java/io/ObjectOutputStream$BlockDataOutputStream +java/io/ObjectOutputStream$HandleTable +java/io/ObjectOutputStream$ReplaceTable +java/io/ObjectStreamClass$ExceptionInfo +java/io/ObjectInputStream$GetFieldImpl +java/io/ObjectInputStream$GetField +java/math/BigInteger$UnsafeHolder +sun/security/jca/ServiceId +sun/security/jca/ProviderList$ServiceList +sun/security/jca/ProviderList$ServiceList$1 +java/security/Signature$Delegate +java/util/ArrayList$SubList +java/util/ArrayList$SubList$1 +java/security/interfaces/DSAPrivateKey +java/security/PrivateKey +javax/security/auth/Destroyable +sun/security/provider/DSA$SHA1withDSA +sun/security/provider/DSA$LegacyDSA +sun/security/provider/DSA +java/security/spec/DSAParameterSpec +java/security/spec/AlgorithmParameterSpec +java/math/MutableBigInteger +java/math/SignedMutableBigInteger +javax/swing/TimerQueue +java/util/concurrent/DelayQueue +java/util/concurrent/BlockingQueue +java/util/AbstractQueue +java/util/PriorityQueue +javax/swing/TimerQueue$1 +javax/swing/TimerQueue$DelayedTimer +java/util/concurrent/Delayed +java/util/concurrent/TimeUnit +java/util/concurrent/TimeUnit$1 +java/util/concurrent/TimeUnit$2 +java/util/concurrent/TimeUnit$3 +java/util/concurrent/TimeUnit$4 +java/util/concurrent/TimeUnit$5 +java/util/concurrent/TimeUnit$6 +java/util/concurrent/TimeUnit$7 +java/awt/Window$1DisposeAction +java/awt/EventQueue$1AWTInvocationLock +java/awt/LightweightDispatcher$2 +java/awt/Component$FlipBufferStrategy +java/lang/StrictMath +javax/swing/JLayer +javax/swing/JInternalFrame +javax/swing/KeyboardManager$ComponentKeyStrokePair +sun/swing/MenuItemLayoutHelper$RectSize +javax/swing/JTable$2 +javax/swing/JTable$Resizable3 +javax/swing/JTable$Resizable2 +javax/swing/JTable$5 +java/awt/Label +sun/awt/windows/WLabelPeer +java/awt/peer/LabelPeer +java/awt/Event +sun/awt/PlatformFont$PlatformFontCache +sun/nio/cs/UTF_16LE$Encoder +sun/nio/cs/UnicodeEncoder +sun/nio/cs/UTF_16LE$Decoder +sun/nio/cs/Surrogate$Parser +sun/nio/cs/Surrogate +java/awt/KeyboardFocusManager$3 +java/net/Authenticator +sun/awt/AppContext$PostShutdownEventRunnable +sun/awt/AWTAutoShutdown$1 +java/net/ConnectException +java/lang/Throwable$WrappedPrintStream +java/lang/Throwable$PrintStreamOrWriter +sun/awt/image/PNGImageDecoder +sun/awt/image/PNGFilterInputStream +sun/awt/image/OffScreenImage +sun/util/locale/provider/TimeZoneNameUtility +sun/util/locale/provider/TimeZoneNameProviderImpl +sun/util/locale/provider/TimeZoneNameUtility$TimeZoneNameGetter +sun/util/resources/TimeZoneNames +sun/util/resources/TimeZoneNamesBundle +sun/util/resources/en/TimeZoneNames_en +java/io/FilterReader +java/io/EOFException +javax/swing/filechooser/FileSystemView +javax/swing/filechooser/WindowsFileSystemView +javax/swing/filechooser/FileSystemView$1 +java/util/jar/JarFile$JarEntryIterator +java/util/zip/ZipFile$ZipEntryIterator +java/lang/IllegalAccessError +java/text/MessageFormat +java/text/MessageFormat$Field +java/util/Hashtable$ValueCollection +javax/swing/event/CaretListener +javax/swing/plaf/metal/MetalButtonUI +javax/swing/plaf/metal/MetalToggleButtonUI +javax/swing/plaf/metal/MetalBorders$ToggleButtonBorder +javax/swing/event/MenuEvent +javax/swing/border/MatteBorder +sun/font/StandardGlyphVector +java/awt/font/GlyphVector +sun/font/StandardGlyphVector$GlyphStrike +sun/font/CoreMetrics +sun/font/FontLineMetrics +java/awt/font/LineMetrics +javax/swing/JToolBar$DefaultToolBarLayout +javax/swing/plaf/metal/MetalToolBarUI +javax/swing/plaf/basic/BasicToolBarUI +javax/swing/plaf/ToolBarUI +javax/swing/plaf/metal/MetalBorders$ToolBarBorder +javax/swing/plaf/metal/MetalBorders$RolloverButtonBorder +javax/swing/plaf/metal/MetalBorders$RolloverMarginBorder +javax/swing/plaf/basic/BasicBorders$RolloverMarginBorder +javax/swing/plaf/metal/MetalToolBarUI$MetalDockingListener +javax/swing/plaf/basic/BasicToolBarUI$DockingListener +javax/swing/plaf/basic/BasicToolBarUI$Handler +javax/swing/JToolBar$Separator +javax/swing/plaf/basic/BasicToolBarSeparatorUI +java/awt/event/AdjustmentEvent +java/awt/MenuBar +# 7b979133406b8b9a diff --git a/runtime/jre/lib/cmm/CIEXYZ.pf b/runtime/jre/lib/cmm/CIEXYZ.pf new file mode 100644 index 0000000..48c9dd8 Binary files /dev/null and b/runtime/jre/lib/cmm/CIEXYZ.pf differ diff --git a/runtime/jre/lib/cmm/GRAY.pf b/runtime/jre/lib/cmm/GRAY.pf new file mode 100644 index 0000000..8af309c Binary files /dev/null and b/runtime/jre/lib/cmm/GRAY.pf differ diff --git a/runtime/jre/lib/cmm/LINEAR_RGB.pf b/runtime/jre/lib/cmm/LINEAR_RGB.pf new file mode 100644 index 0000000..3e0b177 Binary files /dev/null and b/runtime/jre/lib/cmm/LINEAR_RGB.pf differ diff --git a/runtime/jre/lib/cmm/PYCC.pf b/runtime/jre/lib/cmm/PYCC.pf new file mode 100644 index 0000000..0cee015 Binary files /dev/null and b/runtime/jre/lib/cmm/PYCC.pf differ diff --git a/runtime/jre/lib/cmm/sRGB.pf b/runtime/jre/lib/cmm/sRGB.pf new file mode 100644 index 0000000..7b552ad Binary files /dev/null and b/runtime/jre/lib/cmm/sRGB.pf differ diff --git a/runtime/jre/lib/content-types.properties b/runtime/jre/lib/content-types.properties new file mode 100644 index 0000000..8949352 --- /dev/null +++ b/runtime/jre/lib/content-types.properties @@ -0,0 +1,276 @@ +#sun.net.www MIME content-types table +# +# Property fields: +# +# ::= 'description' '=' +# ::= 'file_extensions' '=' +# ::= 'icon' '=' +# ::= 'browser' | 'application' | 'save' | 'unknown' +# ::= 'application' '=' +# + +# +# The "we don't know anything about this data" type(s). +# Used internally to mark unrecognized types. +# +content/unknown: description=Unknown Content +unknown/unknown: description=Unknown Data Type + +# +# The template we should use for temporary files when launching an application +# to view a document of given type. +# +temp.file.template: c:\\temp\\%s + +# +# The "real" types. +# +application/octet-stream: \ + description=Generic Binary Stream;\ + file_extensions=.saveme,.dump,.hqx,.arc,.obj,.lib,.bin,.exe,.zip,.gz + +application/oda: \ + description=ODA Document;\ + file_extensions=.oda + +application/pdf: \ + description=Adobe PDF Format;\ + file_extensions=.pdf + +application/postscript: \ + description=Postscript File;\ + file_extensions=.eps,.ai,.ps;\ + icon=ps + +application/rtf: \ + description=Wordpad Document;\ + file_extensions=.rtf;\ + action=application;\ + application=wordpad.exe %s + +application/x-dvi: \ + description=TeX DVI File;\ + file_extensions=.dvi + +application/x-hdf: \ + description=Hierarchical Data Format;\ + file_extensions=.hdf;\ + action=save + +application/x-latex: \ + description=LaTeX Source;\ + file_extensions=.latex + +application/x-netcdf: \ + description=Unidata netCDF Data Format;\ + file_extensions=.nc,.cdf;\ + action=save + +application/x-tex: \ + description=TeX Source;\ + file_extensions=.tex + +application/x-texinfo: \ + description=Gnu Texinfo;\ + file_extensions=.texinfo,.texi + +application/x-troff: \ + description=Troff Source;\ + file_extensions=.t,.tr,.roff + +application/x-troff-man: \ + description=Troff Manpage Source;\ + file_extensions=.man + +application/x-troff-me: \ + description=Troff ME Macros;\ + file_extensions=.me + +application/x-troff-ms: \ + description=Troff MS Macros;\ + file_extensions=.ms + +application/x-wais-source: \ + description=Wais Source;\ + file_extensions=.src,.wsrc + +application/zip: \ + description=Zip File;\ + file_extensions=.zip;\ + icon=zip;\ + action=save + +application/x-bcpio: \ + description=Old Binary CPIO Archive;\ + file_extensions=.bcpio;\ + action=save + +application/x-cpio: \ + description=Unix CPIO Archive;\ + file_extensions=.cpio;\ + action=save + +application/x-gtar: \ + description=Gnu Tar Archive;\ + file_extensions=.gtar;\ + icon=tar;\ + action=save + +application/x-shar: \ + description=Shell Archive;\ + file_extensions=.sh,.shar;\ + action=save + +application/x-sv4cpio: \ + description=SVR4 CPIO Archive;\ + file_extensions=.sv4cpio;\ + action=save + +application/x-sv4crc: \ + description=SVR4 CPIO with CRC;\ + file_extensions=.sv4crc;\ + action=save + +application/x-tar: \ + description=Tar Archive;\ + file_extensions=.tar;\ + icon=tar;\ + action=save + +application/x-ustar: \ + description=US Tar Archive;\ + file_extensions=.ustar;\ + action=save + +audio/basic: \ + description=Basic Audio;\ + file_extensions=.snd,.au;\ + icon=audio + +audio/x-aiff: \ + description=Audio Interchange Format File;\ + file_extensions=.aifc,.aif,.aiff;\ + icon=aiff + +audio/x-wav: \ + description=Wav Audio;\ + file_extensions=.wav;\ + icon=wav;\ + action=application;\ + application=mplayer.exe %s + +image/gif: \ + description=GIF Image;\ + file_extensions=.gif;\ + icon=gif;\ + action=browser + +image/ief: \ + description=Image Exchange Format;\ + file_extensions=.ief + +image/jpeg: \ + description=JPEG Image;\ + file_extensions=.jfif,.jfif-tbnl,.jpe,.jpg,.jpeg;\ + icon=jpeg;\ + action=browser + +image/tiff: \ + description=TIFF Image;\ + file_extensions=.tif,.tiff;\ + icon=tiff + +image/vnd.fpx: \ + description=FlashPix Image;\ + file_extensions=.fpx,.fpix + +image/x-cmu-rast: \ + description=CMU Raster Image;\ + file_extensions=.ras + +image/x-portable-anymap: \ + description=PBM Anymap Image;\ + file_extensions=.pnm + +image/x-portable-bitmap: \ + description=PBM Bitmap Image;\ + file_extensions=.pbm + +image/x-portable-graymap: \ + description=PBM Graymap Image;\ + file_extensions=.pgm + +image/x-portable-pixmap: \ + description=PBM Pixmap Image;\ + file_extensions=.ppm + +image/x-rgb: \ + description=RGB Image;\ + file_extensions=.rgb + +image/x-xbitmap: \ + description=X Bitmap Image;\ + file_extensions=.xbm,.xpm + +image/x-xwindowdump: \ + description=X Window Dump Image;\ + file_extensions=.xwd + +image/png: \ + description=PNG Image;\ + file_extensions=.png;\ + icon=png;\ + action=browser + +image/bmp: \ + description=Bitmap Image;\ + file_extensions=.bmp; + +text/html: \ + description=HTML Document;\ + file_extensions=.htm,.html;\ + icon=html + +text/plain: \ + description=Plain Text;\ + file_extensions=.text,.c,.cc,.c++,.h,.pl,.txt,.java,.el;\ + icon=text;\ + action=browser + +text/tab-separated-values: \ + description=Tab Separated Values Text;\ + file_extensions=.tsv + +text/x-setext: \ + description=Structure Enhanced Text;\ + file_extensions=.etx + +video/mpeg: \ + description=MPEG Video Clip;\ + file_extensions=.mpg,.mpe,.mpeg;\ + icon=mpeg + +video/quicktime: \ + description=QuickTime Video Clip;\ + file_extensions=.mov,.qt + +application/x-troff-msvideo: \ + description=AVI Video;\ + file_extensions=.avi;\ + icon=avi;\ + action=application;\ + application=mplayer.exe %s + +video/x-sgi-movie: \ + description=SGI Movie;\ + file_extensions=.movie,.mv + +message/rfc822: \ + description=Internet Email Message;\ + file_extensions=.mime + +application/xml: \ + description=XML document;\ + file_extensions=.xml + + diff --git a/runtime/jre/lib/currency.data b/runtime/jre/lib/currency.data new file mode 100644 index 0000000..6be2222 Binary files /dev/null and b/runtime/jre/lib/currency.data differ diff --git a/runtime/jre/lib/ext/access-bridge-64.jar b/runtime/jre/lib/ext/access-bridge-64.jar new file mode 100644 index 0000000..94c07ce Binary files /dev/null and b/runtime/jre/lib/ext/access-bridge-64.jar differ diff --git a/runtime/jre/lib/ext/cldrdata.jar b/runtime/jre/lib/ext/cldrdata.jar new file mode 100644 index 0000000..f59cc33 Binary files /dev/null and b/runtime/jre/lib/ext/cldrdata.jar differ diff --git a/runtime/jre/lib/ext/dnsns.jar b/runtime/jre/lib/ext/dnsns.jar new file mode 100644 index 0000000..a6fbd2e Binary files /dev/null and b/runtime/jre/lib/ext/dnsns.jar differ diff --git a/runtime/jre/lib/ext/jaccess.jar b/runtime/jre/lib/ext/jaccess.jar new file mode 100644 index 0000000..fcdff06 Binary files /dev/null and b/runtime/jre/lib/ext/jaccess.jar differ diff --git a/runtime/jre/lib/ext/localedata.jar b/runtime/jre/lib/ext/localedata.jar new file mode 100644 index 0000000..7dd534f Binary files /dev/null and b/runtime/jre/lib/ext/localedata.jar differ diff --git a/runtime/jre/lib/ext/meta-index b/runtime/jre/lib/ext/meta-index new file mode 100644 index 0000000..6ae0d77 --- /dev/null +++ b/runtime/jre/lib/ext/meta-index @@ -0,0 +1,32 @@ +% VERSION 2 +% WARNING: this file is auto-generated; do not edit +% UNSUPPORTED: this file and its format may change and/or +% may be removed in a future release +! access-bridge-64.jar +com/sun/java/accessibility/ +! cldrdata.jar +sun/text +sun/util +# dnsns.jar +META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor +sun/net +! jaccess.jar +com/sun/java/accessibility/ +# localedata.jar +sun/text +sun/util +# nashorn.jar +jdk/nashorn +META-INF/services/javax.script.ScriptEngineFactory +jdk/internal +! sunec.jar +sun/security +! sunjce_provider.jar +com/sun/crypto/ +! sunmscapi.jar +sun/security +! sunpkcs11.jar +sun/security +# zipfs.jar +META-INF/services/java.nio.file.spi.FileSystemProvider +com/sun/nio/ diff --git a/runtime/jre/lib/ext/nashorn.jar b/runtime/jre/lib/ext/nashorn.jar new file mode 100644 index 0000000..ff8e92f Binary files /dev/null and b/runtime/jre/lib/ext/nashorn.jar differ diff --git a/runtime/jre/lib/ext/sunec.jar b/runtime/jre/lib/ext/sunec.jar new file mode 100644 index 0000000..13b3591 Binary files /dev/null and b/runtime/jre/lib/ext/sunec.jar differ diff --git a/runtime/jre/lib/ext/sunjce_provider.jar b/runtime/jre/lib/ext/sunjce_provider.jar new file mode 100644 index 0000000..8c42217 Binary files /dev/null and b/runtime/jre/lib/ext/sunjce_provider.jar differ diff --git a/runtime/jre/lib/ext/sunmscapi.jar b/runtime/jre/lib/ext/sunmscapi.jar new file mode 100644 index 0000000..84e7903 Binary files /dev/null and b/runtime/jre/lib/ext/sunmscapi.jar differ diff --git a/runtime/jre/lib/ext/sunpkcs11.jar b/runtime/jre/lib/ext/sunpkcs11.jar new file mode 100644 index 0000000..1a6bc9b Binary files /dev/null and b/runtime/jre/lib/ext/sunpkcs11.jar differ diff --git a/runtime/jre/lib/ext/zipfs.jar b/runtime/jre/lib/ext/zipfs.jar new file mode 100644 index 0000000..2275e8e Binary files /dev/null and b/runtime/jre/lib/ext/zipfs.jar differ diff --git a/runtime/jre/lib/flavormap.properties b/runtime/jre/lib/flavormap.properties new file mode 100644 index 0000000..c80f1cf --- /dev/null +++ b/runtime/jre/lib/flavormap.properties @@ -0,0 +1,77 @@ +# +# This properties file is used to initialize the default +# java.awt.datatransfer.SystemFlavorMap. It contains the Win32 platform- +# specific, default mappings between common Win32 Clipboard atoms and platform- +# independent MIME type strings, which will be converted into +# java.awt.datatransfer.DataFlavors. +# +# These default mappings may be augmented by specifying the +# +# AWT.DnD.flavorMapFileURL +# +# property in the appropriate awt.properties file. The specified properties URL +# will be loaded into the SystemFlavorMap. +# +# The standard format is: +# +# = +# +# should be a string identifier that the native platform will +# recognize as a valid data format. should specify both a MIME +# primary type and a MIME subtype separated by a '/'. The MIME type may include +# parameters, where each parameter is a key/value pair separated by '=', and +# where each parameter to the MIME type is separated by a ';'. +# +# Because SystemFlavorMap implements FlavorTable, developers are free to +# duplicate both native keys and DataFlavor values. If a mapping contains a +# duplicate key or value, earlier mappings which included this key or value +# will be preferred. +# +# Mappings whose values specify DataFlavors with primary MIME types of +# "text", and which support the charset parameter, should specify the exact +# format in which the native platform expects the data. The "charset" +# parameter specifies the char to byte encoding, the "eoln" parameter +# specifies the end-of-line marker, and the "terminators" parameter specifies +# the number of terminating NUL bytes. Note that "eoln" and "terminators" +# are not standardized MIME type parameters. They are specific to this file +# format ONLY. They will not appear in any of the DataFlavors returned by the +# SystemFlavorMap at the Java level. +# +# If the "charset" parameter is omitted, or has zero length, the platform +# default encoding is assumed. If the "eoln" parameter is omitted, or has +# zero length, "\n" is assumed. If the "terminators" parameter is omitted, +# or has a value less than zero, zero is assumed. +# +# Upon initialization, the data transfer subsystem will record the specified +# details of the native text format, but the default SystemFlavorMap will +# present a large set of synthesized DataFlavors which map, in both +# directions, to the native. After receiving data from the application in one +# of the synthetic DataFlavors, the data transfer subsystem will transform +# the data stream into the format specified in this file before passing the +# transformed stream to the native system. +# +# Mappings whose values specify DataFlavors with primary MIME types of +# "text", but which do not support the charset parameter, will be treated as +# opaque, 8-bit data. They will not undergo any transformation process, and +# any "charset", "eoln", or "terminators" parameters specified in this file +# will be ignored. +# +# See java.awt.datatransfer.DataFlavor.selectBestTextFlavor for a list of +# text flavors which support the charset parameter. + +UNICODE\ TEXT=text/plain;charset=utf-16le;eoln="\r\n";terminators=2 +TEXT=text/plain;eoln="\r\n";terminators=1 +HTML\ Format=text/html;charset=utf-8;eoln="\r\n";terminators=1 +Rich\ Text\ Format=text/rtf +HDROP=application/x-java-file-list;class=java.util.List +PNG=image/x-java-image;class=java.awt.Image +JFIF=image/x-java-image;class=java.awt.Image +DIB=image/x-java-image;class=java.awt.Image +ENHMETAFILE=image/x-java-image;class=java.awt.Image +METAFILEPICT=image/x-java-image;class=java.awt.Image +LOCALE=application/x-java-text-encoding;class="[B" +UniformResourceLocator=application/x-java-url;class=java.net.URL +UniformResourceLocator=text/uri-list;eoln="\r\n";terminators=1 +UniformResourceLocator=text/plain;eoln="\r\n";terminators=1 +FileGroupDescriptorW=application/x-java-file-list;class=java.util.List +FileGroupDescriptor=application/x-java-file-list;class=java.util.List diff --git a/runtime/jre/lib/fontconfig.bfc b/runtime/jre/lib/fontconfig.bfc new file mode 100644 index 0000000..f04d529 Binary files /dev/null and b/runtime/jre/lib/fontconfig.bfc differ diff --git a/runtime/jre/lib/fontconfig.properties.src b/runtime/jre/lib/fontconfig.properties.src new file mode 100644 index 0000000..5c8883f --- /dev/null +++ b/runtime/jre/lib/fontconfig.properties.src @@ -0,0 +1,302 @@ +# +# +# Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Version + +version=1 + +# Component Font Mappings + +allfonts.chinese-ms936=SimSun +allfonts.chinese-ms936-extb=SimSun-ExtB +allfonts.chinese-gb18030=SimSun-18030 +allfonts.chinese-gb18030-extb=SimSun-ExtB +allfonts.chinese-hkscs=MingLiU_HKSCS +allfonts.chinese-ms950-extb=MingLiU-ExtB +allfonts.devanagari=Mangal +allfonts.dingbats=Wingdings +allfonts.lucida=Lucida Sans Regular +allfonts.symbol=Symbol +allfonts.symbols=Segoe UI Symbol +allfonts.thai=Lucida Sans Regular +allfonts.georgian=Sylfaen + +serif.plain.alphabetic=Times New Roman +serif.plain.chinese-ms950=MingLiU +serif.plain.chinese-ms950-extb=MingLiU-ExtB +serif.plain.hebrew=David +serif.plain.japanese=MS Mincho +serif.plain.korean=Batang + +serif.bold.alphabetic=Times New Roman Bold +serif.bold.chinese-ms950=PMingLiU +serif.bold.chinese-ms950-extb=PMingLiU-ExtB +serif.bold.hebrew=David Bold +serif.bold.japanese=MS Mincho +serif.bold.korean=Batang + +serif.italic.alphabetic=Times New Roman Italic +serif.italic.chinese-ms950=PMingLiU +serif.italic.chinese-ms950-extb=PMingLiU-ExtB +serif.italic.hebrew=David +serif.italic.japanese=MS Mincho +serif.italic.korean=Batang + +serif.bolditalic.alphabetic=Times New Roman Bold Italic +serif.bolditalic.chinese-ms950=PMingLiU +serif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB +serif.bolditalic.hebrew=David Bold +serif.bolditalic.japanese=MS Mincho +serif.bolditalic.korean=Batang + +sansserif.plain.alphabetic=Arial +sansserif.plain.chinese-ms950=MingLiU +sansserif.plain.chinese-ms950-extb=MingLiU-ExtB +sansserif.plain.hebrew=David +sansserif.plain.japanese=MS Gothic +sansserif.plain.korean=Gulim + +sansserif.bold.alphabetic=Arial Bold +sansserif.bold.chinese-ms950=PMingLiU +sansserif.bold.chinese-ms950-extb=PMingLiU-ExtB +sansserif.bold.hebrew=David Bold +sansserif.bold.japanese=MS Gothic +sansserif.bold.korean=Gulim + +sansserif.italic.alphabetic=Arial Italic +sansserif.italic.chinese-ms950=PMingLiU +sansserif.italic.chinese-ms950-extb=PMingLiU-ExtB +sansserif.italic.hebrew=David +sansserif.italic.japanese=MS Gothic +sansserif.italic.korean=Gulim + +sansserif.bolditalic.alphabetic=Arial Bold Italic +sansserif.bolditalic.chinese-ms950=PMingLiU +sansserif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB +sansserif.bolditalic.hebrew=David Bold +sansserif.bolditalic.japanese=MS Gothic +sansserif.bolditalic.korean=Gulim + +monospaced.plain.alphabetic=Courier New +monospaced.plain.chinese-ms950=MingLiU +monospaced.plain.chinese-ms950-extb=MingLiU-ExtB +monospaced.plain.hebrew=Courier New +monospaced.plain.japanese=MS Gothic +monospaced.plain.korean=GulimChe + +monospaced.bold.alphabetic=Courier New Bold +monospaced.bold.chinese-ms950=PMingLiU +monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB +monospaced.bold.hebrew=Courier New Bold +monospaced.bold.japanese=MS Gothic +monospaced.bold.korean=GulimChe + +monospaced.italic.alphabetic=Courier New Italic +monospaced.italic.chinese-ms950=PMingLiU +monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB +monospaced.italic.hebrew=Courier New +monospaced.italic.japanese=MS Gothic +monospaced.italic.korean=GulimChe + +monospaced.bolditalic.alphabetic=Courier New Bold Italic +monospaced.bolditalic.chinese-ms950=PMingLiU +monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB +monospaced.bolditalic.hebrew=Courier New Bold +monospaced.bolditalic.japanese=MS Gothic +monospaced.bolditalic.korean=GulimChe + +dialog.plain.alphabetic=Arial +dialog.plain.chinese-ms950=MingLiU +dialog.plain.chinese-ms950-extb=MingLiU-ExtB +dialog.plain.hebrew=David +dialog.plain.japanese=MS Gothic +dialog.plain.korean=Gulim + +dialog.bold.alphabetic=Arial Bold +dialog.bold.chinese-ms950=PMingLiU +dialog.bold.chinese-ms950-extb=PMingLiU-ExtB +dialog.bold.hebrew=David Bold +dialog.bold.japanese=MS Gothic +dialog.bold.korean=Gulim + +dialog.italic.alphabetic=Arial Italic +dialog.italic.chinese-ms950=PMingLiU +dialog.italic.chinese-ms950-extb=PMingLiU-ExtB +dialog.italic.hebrew=David +dialog.italic.japanese=MS Gothic +dialog.italic.korean=Gulim + +dialog.bolditalic.alphabetic=Arial Bold Italic +dialog.bolditalic.chinese-ms950=PMingLiU +dialog.bolditalic.chinese-ms950-extb=PMingLiU-ExtB +dialog.bolditalic.hebrew=David Bold +dialog.bolditalic.japanese=MS Gothic +dialog.bolditalic.korean=Gulim + +dialoginput.plain.alphabetic=Courier New +dialoginput.plain.chinese-ms950=MingLiU +dialoginput.plain.chinese-ms950-extb=MingLiU-ExtB +dialoginput.plain.hebrew=David +dialoginput.plain.japanese=MS Gothic +dialoginput.plain.korean=Gulim + +dialoginput.bold.alphabetic=Courier New Bold +dialoginput.bold.chinese-ms950=PMingLiU +dialoginput.bold.chinese-ms950-extb=PMingLiU-ExtB +dialoginput.bold.hebrew=David Bold +dialoginput.bold.japanese=MS Gothic +dialoginput.bold.korean=Gulim + +dialoginput.italic.alphabetic=Courier New Italic +dialoginput.italic.chinese-ms950=PMingLiU +dialoginput.italic.chinese-ms950-extb=PMingLiU-ExtB +dialoginput.italic.hebrew=David +dialoginput.italic.japanese=MS Gothic +dialoginput.italic.korean=Gulim + +dialoginput.bolditalic.alphabetic=Courier New Bold Italic +dialoginput.bolditalic.chinese-ms950=PMingLiU +dialoginput.bolditalic.chinese-ms950-extb=PMingLiU-ExtB +dialoginput.bolditalic.hebrew=David Bold +dialoginput.bolditalic.japanese=MS Gothic +dialoginput.bolditalic.korean=Gulim + +# Search Sequences + +sequence.allfonts=alphabetic/default,dingbats,symbol + +sequence.serif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb +sequence.sansserif.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb +sequence.monospaced.GBK=chinese-ms936,alphabetic,dingbats,symbol,chinese-ms936-extb +sequence.dialog.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb +sequence.dialoginput.GBK=alphabetic,chinese-ms936,dingbats,symbol,chinese-ms936-extb + +sequence.serif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb +sequence.sansserif.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb +sequence.monospaced.GB18030=chinese-gb18030,alphabetic,dingbats,symbol,chinese-gb18030-extb +sequence.dialog.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb +sequence.dialoginput.GB18030=alphabetic,chinese-gb18030,dingbats,symbol,chinese-gb18030-extb + +sequence.serif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb +sequence.sansserif.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb +sequence.monospaced.x-windows-950=chinese-ms950,alphabetic,dingbats,symbol,chinese-ms950-extb +sequence.dialog.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb +sequence.dialoginput.x-windows-950=alphabetic,chinese-ms950,dingbats,symbol,chinese-ms950-extb + +sequence.serif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.sansserif.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.monospaced.x-MS950-HKSCS=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.dialog.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.dialoginput.x-MS950-HKSCS=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb + +sequence.serif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.sansserif.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.monospaced.x-MS950-HKSCS-XP=chinese-ms950,alphabetic,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb +sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb + +sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol +sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol + +sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol + +sequence.serif.windows-31j=alphabetic,japanese,dingbats,symbol +sequence.sansserif.windows-31j=alphabetic,japanese,dingbats,symbol +sequence.monospaced.windows-31j=japanese,alphabetic,dingbats,symbol +sequence.dialog.windows-31j=alphabetic,japanese,dingbats,symbol +sequence.dialoginput.windows-31j=alphabetic,japanese,dingbats,symbol + +sequence.serif.x-windows-949=alphabetic,korean,dingbats,symbol +sequence.sansserif.x-windows-949=alphabetic,korean,dingbats,symbol +sequence.monospaced.x-windows-949=korean,alphabetic,dingbats,symbol +sequence.dialog.x-windows-949=alphabetic,korean,dingbats,symbol +sequence.dialoginput.x-windows-949=alphabetic,korean,dingbats,symbol + +sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol + +sequence.fallback=lucida,symbols,\ + chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\ + japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian + +# Exclusion Ranges + +exclusion.alphabetic=0700-1cff,1d80-1e9f,1f00-2017,2020-20ab,20ad-f8ff +exclusion.chinese-gb18030=0390-03d6,2200-22ef,2701-27be +exclusion.hebrew=0041-005a,0060-007a,007f-00ff,20ac-20ac + +# Monospaced to Proportional width variant mapping +# (Experimental private syntax) +proportional.MS_Gothic=MS PGothic +proportional.MS_Mincho=MS PMincho +proportional.MingLiU=PMingLiU +proportional.MingLiU-ExtB=PMingLiU-ExtB + +# Font File Names + +filename.Arial=ARIAL.TTF +filename.Arial_Bold=ARIALBD.TTF +filename.Arial_Italic=ARIALI.TTF +filename.Arial_Bold_Italic=ARIALBI.TTF + +filename.Courier_New=COUR.TTF +filename.Courier_New_Bold=COURBD.TTF +filename.Courier_New_Italic=COURI.TTF +filename.Courier_New_Bold_Italic=COURBI.TTF + +filename.Times_New_Roman=TIMES.TTF +filename.Times_New_Roman_Bold=TIMESBD.TTF +filename.Times_New_Roman_Italic=TIMESI.TTF +filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF + +filename.SimSun=SIMSUN.TTC +filename.SimSun-18030=SIMSUN18030.TTC +filename.SimSun-ExtB=SIMSUNB.TTF + +filename.MingLiU=MINGLIU.TTC +filename.MingLiU-ExtB=MINGLIUB.TTC +filename.PMingLiU=MINGLIU.TTC +filename.PMingLiU-ExtB=MINGLIUB.TTC +filename.MingLiU_HKSCS=hkscsm3u.ttf + +filename.David=DAVID.TTF +filename.David_Bold=DAVIDBD.TTF + +filename.MS_Mincho=MSMINCHO.TTC +filename.MS_PMincho=MSMINCHO.TTC +filename.MS_Gothic=MSGOTHIC.TTC +filename.MS_PGothic=MSGOTHIC.TTC + +filename.Gulim=gulim.TTC +filename.Batang=batang.TTC +filename.GulimChe=gulim.TTC + +filename.Lucida_Sans_Regular=LucidaSansRegular.ttf +filename.Mangal=MANGAL.TTF +filename.Symbol=SYMBOL.TTF +filename.Wingdings=WINGDING.TTF + +filename.Sylfaen=sylfaen.ttf +filename.Segoe_UI_Symbol=SEGUISYM.TTF diff --git a/runtime/jre/lib/hijrah-config-umalqura.properties b/runtime/jre/lib/hijrah-config-umalqura.properties new file mode 100644 index 0000000..1786c14 --- /dev/null +++ b/runtime/jre/lib/hijrah-config-umalqura.properties @@ -0,0 +1,369 @@ +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# This properties file defines a Hijrah calendar variant. +# +# Fields: +# +# ::= 'version' '=' +# ::= 'id' '=' +# ::= 'type' '=' +# ::= 'iso-start' '=' +# ::= '=' +# +# version ... (Required) +# +# id ... (Required) +# Identifies the Java Chronology +# +# type ... (Required) +# Identifies the type of calendar in the standard calendar ID scheme +# iso-start ... (Required) +# Specifies the corresponding ISO date to the first Hijrah day +# in the defined range of dates +# +# year ... (Required) +# Number of days for each month of a Hijrah year +# * Each line defines a year. The years must be in chronological +# order and no gap is allowed. +# * Each line is in the form indicated above. is a Hijrah year and +# nn is the number of days for a month listed in the order of the months. +# * Each year must have 12 months. +# * Each month should be 29 or 30 days long. +# * There must be one or more space characters between the months. +# + +# Version of this definition +version=1.8.0_1 + +# Java chronology ID +id=Hijrah-umalqura + +# Standard calendar type specification +type=islamic-umalqura + +# defines the corresponding ISO date to the earliest Hijrah date +iso-start=1882-11-12 + +# 1 2 3 4 5 6 7 8 9 10 11 12 +1300=30 29 30 29 30 29 30 29 30 29 30 29 +1301=30 30 29 30 29 30 29 30 29 30 29 29 +1302=30 30 30 29 30 30 29 29 30 29 29 30 +1303=29 30 30 29 30 30 29 30 29 30 29 29 +1304=29 30 30 29 30 30 30 29 30 29 30 29 +1305=29 29 30 30 29 30 30 29 30 30 29 29 +1306=30 29 30 29 30 29 30 29 30 30 29 30 +1307=29 30 29 30 29 30 29 30 29 30 29 30 +1308=29 30 30 29 30 29 30 29 30 29 29 30 +1309=29 30 30 30 30 29 29 30 29 29 30 29 +1310=30 29 30 30 30 29 30 29 30 29 29 30 +1311=29 30 29 30 30 30 29 30 29 30 29 29 +1312=30 29 30 29 30 30 29 30 30 29 30 29 +1313=29 30 29 30 29 30 29 30 30 30 29 29 +1314=30 30 29 30 29 29 30 29 30 30 29 30 +1315=29 30 30 29 30 29 29 30 29 30 29 30 +1316=29 30 30 30 29 30 29 29 30 29 30 29 +1317=30 29 30 30 29 30 29 30 29 30 29 29 +1318=30 29 30 30 29 30 30 29 30 29 30 29 +1319=29 30 29 30 30 29 30 29 30 30 29 30 +1320=29 30 29 29 30 29 30 29 30 30 30 29 +1321=30 29 30 29 29 30 29 29 30 30 30 30 +1322=29 30 29 30 29 29 29 30 29 30 30 30 +1323=29 30 30 29 30 29 29 29 30 29 30 30 +1324=29 30 30 29 30 29 30 29 29 30 29 30 +1325=30 29 30 29 30 30 29 30 29 30 29 30 +1326=29 29 30 29 30 30 29 30 29 30 30 29 +1327=30 29 29 30 29 30 29 30 30 29 30 30 +1328=29 30 29 29 30 29 29 30 30 30 29 30 +1329=30 29 30 29 29 30 29 29 30 30 29 30 +1330=30 30 29 30 29 29 30 29 29 30 30 29 +1331=30 30 29 30 30 29 29 30 29 30 29 30 +1332=29 30 29 30 30 29 30 29 30 30 29 29 +1333=30 29 29 30 30 29 30 30 29 30 30 29 +1334=29 29 30 29 30 29 30 30 30 29 30 29 +1335=30 29 30 29 29 30 29 30 30 29 30 30 +1336=29 30 29 30 29 29 30 29 30 29 30 30 +1337=30 29 30 29 30 29 29 30 29 30 29 30 +1338=29 30 30 29 30 30 29 29 30 29 30 29 +1339=30 29 30 29 30 30 30 29 30 29 29 30 +1340=29 29 30 29 30 30 30 30 29 30 29 29 +1341=30 29 29 30 29 30 30 30 29 30 30 29 +1342=29 29 30 29 30 29 30 30 29 30 30 29 +1343=30 29 29 30 29 30 29 30 29 30 30 29 +1344=30 29 30 29 30 30 29 29 30 29 30 29 +1345=30 29 30 30 30 29 30 29 29 30 29 29 +1346=30 29 30 30 30 30 29 30 29 29 30 29 +1347=29 30 29 30 30 30 29 30 30 29 29 30 +1348=29 29 30 29 30 30 29 30 30 30 29 29 +1349=30 29 29 30 29 30 30 29 30 30 29 30 +1350=29 30 29 30 29 30 29 29 30 30 29 30 +1351=30 29 30 29 30 29 30 29 29 30 29 30 +1352=30 29 30 30 29 30 29 30 29 29 30 29 +1353=30 29 30 30 30 29 30 29 29 30 29 30 +1354=29 30 29 30 30 29 30 30 29 30 29 29 +1355=30 29 29 30 30 29 30 30 29 30 30 29 +1356=29 30 29 30 29 30 29 30 29 30 30 30 +1357=29 29 30 29 30 29 29 30 29 30 30 30 +1358=29 30 29 30 29 30 29 29 30 29 30 30 +1359=29 30 30 29 30 29 30 29 29 29 30 30 +1360=29 30 30 30 29 30 29 30 29 29 30 29 +1361=30 29 30 30 29 30 30 29 29 30 29 30 +1362=29 30 29 30 29 30 30 29 30 29 30 29 +1363=30 29 30 29 30 29 30 29 30 29 30 30 +1364=29 30 29 30 29 29 30 29 30 29 30 30 +1365=30 30 29 29 30 29 29 30 29 30 29 30 +1366=30 30 29 30 29 30 29 29 30 29 30 29 +1367=30 30 29 30 30 29 30 29 29 30 29 30 +1368=29 30 29 30 30 30 29 29 30 29 30 29 +1369=30 29 30 29 30 30 29 30 29 30 30 29 +1370=30 29 29 30 29 30 29 30 29 30 30 30 +1371=29 30 29 29 30 29 30 29 30 29 30 30 +1372=30 29 29 30 29 30 29 29 30 29 30 30 +1373=30 29 30 29 30 29 30 29 29 30 29 30 +1374=30 29 30 30 29 30 29 30 29 29 30 29 +1375=30 29 30 30 29 30 30 29 30 29 30 29 +1376=29 30 29 30 29 30 30 30 29 30 29 30 +1377=29 29 30 29 29 30 30 30 29 30 30 29 +1378=30 29 29 29 30 29 30 30 29 30 30 30 +1379=29 30 29 29 29 30 29 30 30 29 30 30 +1380=29 30 29 30 29 30 29 30 29 30 29 30 +1381=29 30 29 30 30 29 30 29 30 29 29 30 +1382=29 30 29 30 30 29 30 30 29 30 29 29 +1383=30 29 29 30 30 30 29 30 30 29 30 29 +1384=29 30 29 29 30 30 29 30 30 30 29 30 +1385=29 29 30 29 29 30 30 29 30 30 30 29 +1386=30 29 29 30 29 29 30 30 29 30 30 29 +1387=30 29 30 29 30 29 30 29 30 29 30 29 +1388=30 30 29 30 29 30 29 30 29 30 29 29 +1389=30 30 29 30 30 29 30 30 29 29 30 29 +1390=29 30 29 30 30 30 29 30 29 30 29 30 +1391=29 29 30 29 30 30 29 30 30 29 30 29 +1392=30 29 29 30 29 30 29 30 30 29 30 30 +1393=29 30 29 29 30 29 30 29 30 29 30 30 +1394=30 29 30 29 29 30 29 30 29 30 29 30 +1395=30 29 30 30 29 30 29 29 30 29 29 30 +1396=30 29 30 30 29 30 30 29 29 30 29 29 +1397=30 29 30 30 29 30 30 30 29 29 29 30 +1398=29 30 29 30 30 29 30 30 29 30 29 29 +1399=30 29 30 29 30 29 30 30 29 30 29 30 +1400=30 29 30 29 29 30 29 30 29 30 29 30 +1401=30 30 29 30 29 29 30 29 29 30 29 30 +1402=30 30 30 29 30 29 29 30 29 29 30 29 +1403=30 30 30 29 30 30 29 29 30 29 29 30 +1404=29 30 30 29 30 30 29 30 29 30 29 29 +1405=30 29 30 29 30 30 30 29 30 29 29 30 +1406=30 29 29 30 29 30 30 29 30 29 30 30 +1407=29 30 29 29 30 29 30 29 30 29 30 30 +1408=30 29 30 29 30 29 29 30 29 29 30 30 +1409=30 30 29 30 29 30 29 29 30 29 29 30 +1410=30 30 29 30 30 29 30 29 29 30 29 29 +1411=30 30 29 30 30 29 30 30 29 29 30 29 +1412=30 29 30 29 30 29 30 30 30 29 29 30 +1413=29 30 29 29 30 29 30 30 30 29 30 29 +1414=30 29 30 29 29 30 29 30 30 29 30 30 +1415=29 30 29 30 29 29 30 29 30 29 30 30 +1416=30 29 30 29 30 29 29 30 29 30 29 30 +1417=30 29 30 30 29 29 30 29 30 29 30 29 +1418=30 29 30 30 29 30 29 30 29 30 29 30 +1419=29 30 29 30 29 30 29 30 30 30 29 29 +1420=29 30 29 29 30 29 30 30 30 30 29 30 +1421=29 29 30 29 29 29 30 30 30 30 29 30 +1422=30 29 29 30 29 29 29 30 30 30 29 30 +1423=30 29 30 29 30 29 29 30 29 30 29 30 +1424=30 29 30 30 29 30 29 29 30 29 30 29 +1425=30 29 30 30 29 30 29 30 30 29 30 29 +1426=29 30 29 30 29 30 30 29 30 30 29 30 +1427=29 29 30 29 30 29 30 30 29 30 30 29 +1428=30 29 29 30 29 29 30 30 30 29 30 30 +1429=29 30 29 29 30 29 29 30 30 29 30 30 +1430=29 30 30 29 29 30 29 30 29 30 29 30 +1431=29 30 30 29 30 29 30 29 30 29 29 30 +1432=29 30 30 30 29 30 29 30 29 30 29 29 +1433=30 29 30 30 29 30 30 29 30 29 30 29 +1434=29 30 29 30 29 30 30 29 30 30 29 29 +1435=30 29 30 29 30 29 30 29 30 30 29 30 +1436=29 30 29 30 29 30 29 30 29 30 29 30 +1437=30 29 30 30 29 29 30 29 30 29 29 30 +1438=30 29 30 30 30 29 29 30 29 29 30 29 +1439=30 29 30 30 30 29 30 29 30 29 29 30 +1440=29 30 29 30 30 30 29 30 29 30 29 29 +1441=30 29 30 29 30 30 29 30 30 29 30 29 +1442=29 30 29 30 29 30 29 30 30 29 30 29 +1443=30 29 30 29 30 29 30 29 30 29 30 30 +1444=29 30 29 30 30 29 29 30 29 30 29 30 +1445=29 30 30 30 29 30 29 29 30 29 29 30 +1446=29 30 30 30 29 30 30 29 29 30 29 29 +1447=30 29 30 30 30 29 30 29 30 29 30 29 +1448=29 30 29 30 30 29 30 30 29 30 29 30 +1449=29 29 30 29 30 29 30 30 29 30 30 29 +1450=30 29 30 29 29 30 29 30 29 30 30 29 +1451=30 30 30 29 29 30 29 29 30 30 29 30 +1452=30 29 30 30 29 29 30 29 29 30 29 30 +1453=30 29 30 30 29 30 29 30 29 29 30 29 +1454=30 29 30 30 29 30 30 29 30 29 30 29 +1455=29 30 29 30 30 29 30 29 30 30 29 30 +1456=29 29 30 29 30 29 30 29 30 30 30 29 +1457=30 29 29 30 29 29 30 29 30 30 30 30 +1458=29 30 29 29 30 29 29 30 29 30 30 30 +1459=29 30 30 29 29 30 29 29 30 29 30 30 +1460=29 30 30 29 30 29 30 29 29 30 29 30 +1461=29 30 30 29 30 29 30 29 30 30 29 29 +1462=30 29 30 29 30 30 29 30 29 30 30 29 +1463=29 30 29 30 29 30 29 30 30 30 29 30 +1464=29 30 29 29 30 29 29 30 30 30 29 30 +1465=30 29 30 29 29 30 29 29 30 30 29 30 +1466=30 30 29 30 29 29 29 30 29 30 30 29 +1467=30 30 29 30 30 29 29 30 29 30 29 30 +1468=29 30 29 30 30 29 30 29 30 29 30 29 +1469=29 30 29 30 30 29 30 30 29 30 29 30 +1470=29 29 30 29 30 30 29 30 30 29 30 29 +1471=30 29 29 30 29 30 29 30 30 29 30 30 +1472=29 30 29 29 30 29 30 29 30 30 29 30 +1473=29 30 29 30 30 29 29 30 29 30 29 30 +1474=29 30 30 29 30 30 29 29 30 29 30 29 +1475=29 30 30 29 30 30 30 29 29 30 29 29 +1476=30 29 30 29 30 30 30 29 30 29 30 29 +1477=29 30 29 29 30 30 30 30 29 30 29 30 +1478=29 29 30 29 30 29 30 30 29 30 30 29 +1479=30 29 29 30 29 30 29 30 29 30 30 29 +1480=30 29 30 29 30 29 30 29 30 29 30 29 +1481=30 29 30 30 29 30 29 30 29 30 29 29 +1482=30 29 30 30 30 30 29 30 29 29 30 29 +1483=29 30 29 30 30 30 29 30 30 29 29 30 +1484=29 29 30 29 30 30 30 29 30 29 30 29 +1485=30 29 29 30 29 30 30 29 30 30 29 30 +1486=29 30 29 29 30 29 30 29 30 30 29 30 +1487=30 29 30 29 30 29 29 30 29 30 29 30 +1488=30 29 30 30 29 30 29 29 30 29 30 29 +1489=30 29 30 30 30 29 30 29 29 30 29 30 +1490=29 30 29 30 30 29 30 30 29 29 30 29 +1491=30 29 29 30 30 29 30 30 29 30 29 30 +1492=29 30 29 29 30 30 29 30 29 30 30 29 +1493=30 29 30 29 30 29 29 30 29 30 30 30 +1494=29 30 29 30 29 30 29 29 29 30 30 30 +1495=29 30 30 29 30 29 29 30 29 29 30 30 +1496=29 30 30 30 29 30 29 29 30 29 29 30 +1497=30 29 30 30 29 30 29 30 29 30 29 30 +1498=29 30 29 30 29 30 30 29 30 29 30 29 +1499=30 29 30 29 29 30 30 29 30 29 30 30 +1500=29 30 29 30 29 29 30 29 30 29 30 30 +1501=30 29 30 29 30 29 29 29 30 29 30 30 +1502=30 30 29 30 29 30 29 29 29 30 30 29 +1503=30 30 29 30 30 29 30 29 29 29 30 30 +1504=29 30 29 30 30 30 29 29 30 29 30 29 +1505=30 29 30 29 30 30 29 30 29 30 30 29 +1506=29 30 29 29 30 30 29 30 30 29 30 30 +1507=29 29 30 29 29 30 30 29 30 29 30 30 +1508=30 29 29 30 29 30 29 29 30 29 30 30 +1509=30 29 30 29 30 29 30 29 29 30 29 30 +1510=30 29 30 30 29 30 29 30 29 29 30 29 +1511=30 29 30 30 29 30 30 29 30 29 29 30 +1512=29 30 29 30 29 30 30 30 29 30 29 30 +1513=29 29 29 30 29 30 30 30 29 30 30 29 +1514=30 29 29 29 30 29 30 30 29 30 30 30 +1515=29 29 30 29 29 30 29 30 30 29 30 30 +1516=29 30 29 30 29 29 30 29 30 29 30 30 +1517=29 30 29 30 29 30 30 29 29 30 29 30 +1518=29 30 29 30 30 29 30 30 29 30 29 29 +1519=30 29 29 30 30 30 29 30 30 29 30 29 +1520=29 30 29 29 30 30 30 29 30 30 29 30 +1521=29 29 29 30 29 30 30 29 30 30 29 30 +1522=30 29 29 29 30 29 30 30 29 30 30 29 +1523=30 29 30 29 30 29 30 29 29 30 30 29 +1524=30 30 29 30 29 30 29 30 29 29 30 29 +1525=30 30 29 30 30 29 30 29 30 29 29 30 +1526=29 30 29 30 30 30 29 30 29 30 29 29 +1527=30 29 30 29 30 30 29 30 30 29 30 29 +1528=30 29 29 30 29 30 29 30 30 29 30 30 +1529=29 30 29 29 30 29 30 29 30 29 30 30 +1530=29 30 30 29 29 30 29 30 29 29 30 30 +1531=29 30 30 30 29 29 30 29 30 29 29 30 +1532=29 30 30 30 29 30 30 29 29 29 30 29 +1533=30 29 30 30 30 29 30 29 30 29 29 30 +1534=29 30 29 30 30 29 30 30 29 29 30 29 +1535=30 29 30 29 30 29 30 30 29 30 29 30 +1536=29 30 29 30 29 30 29 30 29 30 29 30 +1537=30 29 30 30 29 29 30 29 29 30 29 30 +1538=30 30 29 30 30 29 29 30 29 29 30 29 +1539=30 30 30 29 30 30 29 29 30 29 29 30 +1540=29 30 30 29 30 30 29 30 29 29 30 29 +1541=30 29 30 29 30 30 30 29 30 29 29 30 +1542=29 30 29 30 29 30 30 29 30 29 30 30 +1543=29 30 29 29 30 29 30 29 30 29 30 30 +1544=30 29 30 29 29 30 29 30 29 30 29 30 +1545=30 30 29 30 29 29 30 29 30 29 29 30 +1546=30 30 29 30 29 30 29 30 29 30 29 29 +1547=30 30 29 30 30 29 30 29 30 29 30 29 +1548=30 29 29 30 30 29 30 30 29 30 29 30 +1549=29 30 29 29 30 29 30 30 30 29 30 29 +1550=30 29 30 29 29 29 30 30 30 29 30 30 +1551=29 30 29 29 30 29 29 30 30 29 30 30 +1552=30 29 30 29 29 30 29 29 30 30 29 30 +1553=30 29 30 29 30 29 30 29 30 29 30 29 +1554=30 29 30 29 30 30 29 30 29 30 29 30 +1555=29 29 30 29 30 30 29 30 30 29 30 29 +1556=30 29 29 30 29 30 29 30 30 30 29 30 +1557=29 30 29 29 29 30 29 30 30 30 30 29 +1558=30 29 30 29 29 29 30 29 30 30 30 29 +1559=30 30 29 29 30 29 29 30 30 29 30 29 +1560=30 30 29 30 29 30 29 30 29 30 29 30 +1561=29 30 30 29 30 29 30 30 29 29 30 29 +1562=29 30 30 29 30 29 30 30 30 29 29 30 +1563=29 30 29 29 30 29 30 30 30 29 30 29 +1564=30 29 30 29 29 30 29 30 30 30 29 30 +1565=29 30 29 30 29 29 30 29 30 30 29 30 +1566=30 29 30 29 30 29 29 30 29 30 29 30 +1567=30 29 30 30 29 30 29 30 29 29 30 29 +1568=30 29 30 30 30 29 30 29 30 29 29 29 +1569=30 29 30 30 30 29 30 30 29 30 29 29 +1570=29 30 29 30 30 29 30 30 30 29 29 30 +1571=29 29 30 29 30 30 29 30 30 29 30 29 +1572=30 29 29 30 29 30 29 30 30 29 30 29 +1573=30 29 30 30 29 30 29 29 30 29 30 29 +1574=30 30 29 30 30 29 30 29 29 30 29 29 +1575=30 30 30 29 30 30 29 30 29 29 29 30 +1576=29 30 30 29 30 30 30 29 30 29 29 29 +1577=30 29 30 30 29 30 30 29 30 29 30 29 +1578=29 30 29 30 29 30 30 29 30 30 29 30 +1579=29 30 29 30 29 29 30 30 29 30 29 30 +1580=29 30 30 29 30 29 29 30 29 30 29 30 +1581=30 30 29 30 29 30 29 29 30 29 30 29 +1582=30 30 29 30 30 29 30 29 30 29 29 29 +1583=30 30 29 30 30 30 29 30 29 30 29 29 +1584=29 30 30 29 30 30 29 30 30 29 30 29 +1585=29 30 29 30 29 30 29 30 30 29 30 30 +1586=29 29 30 29 30 29 29 30 30 30 29 30 +1587=29 30 30 29 29 29 30 29 30 29 30 30 +1588=30 29 30 30 29 29 29 30 29 30 29 30 +1589=30 29 30 30 29 30 29 29 30 29 30 29 +1590=30 29 30 30 30 29 29 30 29 30 29 30 +1591=29 30 29 30 30 29 30 29 30 29 30 29 +1592=30 29 30 29 30 29 30 29 30 30 30 29 +1593=30 29 29 30 29 29 30 29 30 30 30 29 +1594=30 30 29 29 30 29 29 29 30 30 30 30 +1595=29 30 29 30 29 29 30 29 29 30 30 30 +1596=29 30 30 29 30 29 29 30 29 30 29 30 +1597=29 30 30 29 30 29 30 29 30 29 30 29 +1598=30 29 30 29 30 30 29 30 29 30 30 29 +1599=29 30 29 30 29 30 29 30 30 30 29 30 +1600=29 29 30 29 30 29 29 30 30 30 29 30 diff --git a/runtime/jre/lib/images/cursors/cursors.properties b/runtime/jre/lib/images/cursors/cursors.properties new file mode 100644 index 0000000..77ce925 --- /dev/null +++ b/runtime/jre/lib/images/cursors/cursors.properties @@ -0,0 +1,40 @@ +# +# +# Cursors Properties file +# +# Names GIF89 sources for Custom Cursors and their associated HotSpots +# +# Note: the syntax of the property name is significant and is parsed +# by java.awt.Cursor +# +# The syntax is: Cursor...File=win32_ +# Cursor...HotSpot=, +# Cursor...Name= +# +Cursor.CopyDrop.32x32.File=win32_CopyDrop32x32.gif +Cursor.CopyDrop.32x32.HotSpot=0,0 +Cursor.CopyDrop.32x32.Name=CopyDrop32x32 +# +Cursor.MoveDrop.32x32.File=win32_MoveDrop32x32.gif +Cursor.MoveDrop.32x32.HotSpot=0,0 +Cursor.MoveDrop.32x32.Name=MoveDrop32x32 +# +Cursor.LinkDrop.32x32.File=win32_LinkDrop32x32.gif +Cursor.LinkDrop.32x32.HotSpot=0,0 +Cursor.LinkDrop.32x32.Name=LinkDrop32x32 +# +Cursor.CopyNoDrop.32x32.File=win32_CopyNoDrop32x32.gif +Cursor.CopyNoDrop.32x32.HotSpot=6,2 +Cursor.CopyNoDrop.32x32.Name=CopyNoDrop32x32 +# +Cursor.MoveNoDrop.32x32.File=win32_MoveNoDrop32x32.gif +Cursor.MoveNoDrop.32x32.HotSpot=6,2 +Cursor.MoveNoDrop.32x32.Name=MoveNoDrop32x32 +# +Cursor.LinkNoDrop.32x32.File=win32_LinkNoDrop32x32.gif +Cursor.LinkNoDrop.32x32.HotSpot=6,2 +Cursor.LinkNoDrop.32x32.Name=LinkNoDrop32x32 +# +Cursor.Invalid.32x32.File=invalid32x32.gif +Cursor.Invalid.32x32.HotSpot=6,2 +Cursor.Invalid.32x32.Name=Invalid32x32 diff --git a/runtime/jre/lib/images/cursors/invalid32x32.gif b/runtime/jre/lib/images/cursors/invalid32x32.gif new file mode 100644 index 0000000..64c265d Binary files /dev/null and b/runtime/jre/lib/images/cursors/invalid32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_CopyDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_CopyDrop32x32.gif new file mode 100644 index 0000000..8a47b47 Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_CopyDrop32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_CopyNoDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_CopyNoDrop32x32.gif new file mode 100644 index 0000000..64c265d Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_CopyNoDrop32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_LinkDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_LinkDrop32x32.gif new file mode 100644 index 0000000..be3628f Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_LinkDrop32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_LinkNoDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_LinkNoDrop32x32.gif new file mode 100644 index 0000000..64c265d Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_LinkNoDrop32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_MoveDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_MoveDrop32x32.gif new file mode 100644 index 0000000..a2d986b Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_MoveDrop32x32.gif differ diff --git a/runtime/jre/lib/images/cursors/win32_MoveNoDrop32x32.gif b/runtime/jre/lib/images/cursors/win32_MoveNoDrop32x32.gif new file mode 100644 index 0000000..64c265d Binary files /dev/null and b/runtime/jre/lib/images/cursors/win32_MoveNoDrop32x32.gif differ diff --git a/runtime/jre/lib/jce.jar b/runtime/jre/lib/jce.jar new file mode 100644 index 0000000..eea04fe Binary files /dev/null and b/runtime/jre/lib/jce.jar differ diff --git a/runtime/jre/lib/jfr.jar b/runtime/jre/lib/jfr.jar new file mode 100644 index 0000000..8634706 Binary files /dev/null and b/runtime/jre/lib/jfr.jar differ diff --git a/runtime/jre/lib/jfr/default.jfc b/runtime/jre/lib/jfr/default.jfc new file mode 100644 index 0000000..2675008 --- /dev/null +++ b/runtime/jre/lib/jfr/default.jfc @@ -0,0 +1,846 @@ + + + + + + + + true + everyChunk + + + + true + 1000 ms + + + + true + everyChunk + + + + true + 1000 ms + + + + true + true + + + + true + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + false + true + 20 ms + + + + true + true + 0 ms + + + + true + true + 0 ms + + + + true + true + 0 ms + + + + true + true + + + + false + true + 0 ms + + + + false + true + + + + false + + + + true + beginChunk + + + + true + beginChunk + + + + true + 20 ms + + + + true + 20 ms + + + + true + 10 ms + + + + false + 10 ms + + + + false + 10 ms + + + + false + 10 ms + + + + false + 10 ms + + + + false + 10 ms + + + + true + 10 ms + + + + true + true + + + + true + everyChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + false + everyChunk + + + + true + everyChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + false + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + true + + + + true + true + + + + true + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + true + 0 ms + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + false + + + + false + + + + true + + + + false + true + + + + true + + + + false + everyChunk + + + + false + + + + true + false + 0 ns + + + + true + beginChunk + + + + true + 1000 ms + + + + true + 1000 ms + + + + true + 60 s + + + + false + + + + false + + + + true + beginChunk + + + + true + everyChunk + + + + true + 100 ms + + + + true + beginChunk + + + + true + everyChunk + + + + true + + + + true + beginChunk + + + + true + beginChunk + + + + true + 10 s + + + + true + 1000 ms + + + + true + 10 s + + + + true + beginChunk + + + + true + endChunk + + + + true + 5 s + + + + true + beginChunk + + + + true + everyChunk + + + + false + true + + + + false + true + + + + true + everyChunk + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + true + true + 20 ms + + + + false + true + + + + true + true + + + + true + 1000 ms + + + + true + + + + true + + + + true + + + + true + + + + true + 10 ms + + + + true + 0 ms + + + + true + 10 ms + + + + true + 10 ms + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 20 ms + + 20 ms + + 20 ms + + false + + + + diff --git a/runtime/jre/lib/jfr/profile.jfc b/runtime/jre/lib/jfr/profile.jfc new file mode 100644 index 0000000..cf8738f --- /dev/null +++ b/runtime/jre/lib/jfr/profile.jfc @@ -0,0 +1,847 @@ + + + + + + + + true + everyChunk + + + + true + 1000 ms + + + + true + everyChunk + + + + true + 1000 ms + + + + true + true + + + + true + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 0 ms + + + + true + true + 0 ms + + + + true + true + 0 ms + + + + true + true + + + + false + true + 0 ms + + + + false + true + + + + false + + + + true + beginChunk + + + + true + beginChunk + + + + true + 10 ms + + + + true + 20 ms + + + + true + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + true + 0 ms + + + + true + true + + + + true + 60 s + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + false + everyChunk + + + + true + everyChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + true + beginChunk + + + + false + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + true + + + + true + true + + + + true + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + true + 0 ms + + + + false + 0 ms + + + + false + 0 ms + + + + true + 0 ms + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + true + + + + false + true + + + + true + + + + false + everyChunk + + + + false + + + + true + true + 0 ns + + + + true + beginChunk + + + + true + 1000 ms + + + + true + 100 ms + + + + true + 10 s + + + + true + + + + false + + + + true + beginChunk + + + + true + everyChunk + + + + true + 100 ms + + + + true + beginChunk + + + + true + everyChunk + + + + true + + + + true + beginChunk + + + + true + beginChunk + + + + true + 10 s + + + + true + 1000 ms + + + + true + 10 s + + + + true + beginChunk + + + + true + endChunk + + + + true + 5 s + + + + true + beginChunk + + + + true + everyChunk + + + + true + true + + + + true + true + + + + true + everyChunk + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + true + true + 10 ms + + + + false + true + + + + true + true + + + + true + 1000 ms + + + + true + + + + true + + + + true + + + + true + + + + true + 10 ms + + + + true + 0 ms + + + + 10 ms + true + + + + true + 10 ms + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 ms + + 10 ms + + 10 ms + + false + + + + diff --git a/runtime/jre/lib/jsse.jar b/runtime/jre/lib/jsse.jar new file mode 100644 index 0000000..cb1e0d0 Binary files /dev/null and b/runtime/jre/lib/jsse.jar differ diff --git a/runtime/jre/lib/jvm.hprof.txt b/runtime/jre/lib/jvm.hprof.txt new file mode 100644 index 0000000..3c8e5fc --- /dev/null +++ b/runtime/jre/lib/jvm.hprof.txt @@ -0,0 +1,86 @@ +Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + - Neither the name of Oracle nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Header for -agentlib:hprof (or -Xrunhprof) ASCII Output (JDK 5.0 JVMTI based) + +WARNING! This file format is under development, and is subject to +change without notice. + +This file contains the following types of records: + +THREAD START +THREAD END mark the lifetime of Java threads + +TRACE represents a Java stack trace. Each trace consists + of a series of stack frames. Other records refer to + TRACEs to identify (1) where object allocations have + taken place, (2) the frames in which GC roots were + found, and (3) frequently executed methods. + +HEAP DUMP is a complete snapshot of all live objects in the Java + heap. Following distinctions are made: + + ROOT root set as determined by GC + CLS classes + OBJ instances + ARR arrays + +SITES is a sorted list of allocation sites. This identifies + the most heavily allocated object types, and the TRACE + at which those allocations occurred. + +CPU SAMPLES is a statistical profile of program execution. The VM + periodically samples all running threads, and assigns + a quantum to active TRACEs in those threads. Entries + in this record are TRACEs ranked by the percentage of + total quanta they consumed; top-ranked TRACEs are + typically hot spots in the program. + +CPU TIME is a profile of program execution obtained by measuring + the time spent in individual methods (excluding the time + spent in callees), as well as by counting the number of + times each method is called. Entries in this record are + TRACEs ranked by the percentage of total CPU time. The + "count" field indicates the number of times each TRACE + is invoked. + +MONITOR TIME is a profile of monitor contention obtained by measuring + the time spent by a thread waiting to enter a monitor. + Entries in this record are TRACEs ranked by the percentage + of total monitor contention time and a brief description + of the monitor. The "count" field indicates the number of + times the monitor was contended at that TRACE. + +MONITOR DUMP is a complete snapshot of all the monitors and threads in + the System. + +HEAP DUMP, SITES, CPU SAMPLES|TIME and MONITOR DUMP|TIME records are generated +at program exit. They can also be obtained during program execution by typing +Ctrl-\ (on Solaris) or by typing Ctrl-Break (on Win32). diff --git a/runtime/jre/lib/logging.properties b/runtime/jre/lib/logging.properties new file mode 100644 index 0000000..65cf1b1 --- /dev/null +++ b/runtime/jre/lib/logging.properties @@ -0,0 +1,59 @@ +############################################################ +# Default Logging Configuration File +# +# You can use a different file by specifying a filename +# with the java.util.logging.config.file system property. +# For example java -Djava.util.logging.config.file=myfile +############################################################ + +############################################################ +# Global properties +############################################################ + +# "handlers" specifies a comma separated list of log Handler +# classes. These handlers will be installed during VM startup. +# Note that these classes must be on the system classpath. +# By default we only configure a ConsoleHandler, which will only +# show messages at the INFO and above levels. +handlers= java.util.logging.ConsoleHandler + +# To also add the FileHandler, use the following line instead. +#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler + +# Default global logging level. +# This specifies which kinds of events are logged across +# all loggers. For any given facility this global level +# can be overriden by a facility specific level +# Note that the ConsoleHandler also has a separate level +# setting to limit messages printed to the console. +.level= INFO + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +# default file output is in user's home directory. +java.util.logging.FileHandler.pattern = %h/java%u.log +java.util.logging.FileHandler.limit = 50000 +java.util.logging.FileHandler.count = 1 +java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter + +# Limit the message that are printed on the console to INFO and above. +java.util.logging.ConsoleHandler.level = INFO +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +# Example to customize the SimpleFormatter output format +# to print one-line log message like this: +# : [] +# +# java.util.logging.SimpleFormatter.format=%4$s: %5$s [%1$tc]%n + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages: +com.xyz.foo.level = SEVERE diff --git a/runtime/jre/lib/management-agent.jar b/runtime/jre/lib/management-agent.jar new file mode 100644 index 0000000..4ecee03 Binary files /dev/null and b/runtime/jre/lib/management-agent.jar differ diff --git a/runtime/jre/lib/management/jmxremote.access b/runtime/jre/lib/management/jmxremote.access new file mode 100644 index 0000000..ce80b47 --- /dev/null +++ b/runtime/jre/lib/management/jmxremote.access @@ -0,0 +1,79 @@ +###################################################################### +# Default Access Control File for Remote JMX(TM) Monitoring +###################################################################### +# +# Access control file for Remote JMX API access to monitoring. +# This file defines the allowed access for different roles. The +# password file (jmxremote.password by default) defines the roles and their +# passwords. To be functional, a role must have an entry in +# both the password and the access files. +# +# The default location of this file is $JRE/lib/management/jmxremote.access +# You can specify an alternate location by specifying a property in +# the management config file $JRE/lib/management/management.properties +# (See that file for details) +# +# The file format for password and access files is syntactically the same +# as the Properties file format. The syntax is described in the Javadoc +# for java.util.Properties.load. +# A typical access file has multiple lines, where each line is blank, +# a comment (like this one), or an access control entry. +# +# An access control entry consists of a role name, and an +# associated access level. The role name is any string that does not +# itself contain spaces or tabs. It corresponds to an entry in the +# password file (jmxremote.password). The access level is one of the +# following: +# "readonly" grants access to read attributes of MBeans. +# For monitoring, this means that a remote client in this +# role can read measurements but cannot perform any action +# that changes the environment of the running program. +# "readwrite" grants access to read and write attributes of MBeans, +# to invoke operations on them, and optionally +# to create or remove them. This access should be granted +# only to trusted clients, since they can potentially +# interfere with the smooth operation of a running program. +# +# The "readwrite" access level can optionally be followed by the "create" and/or +# "unregister" keywords. The "unregister" keyword grants access to unregister +# (delete) MBeans. The "create" keyword grants access to create MBeans of a +# particular class or of any class matching a particular pattern. Access +# should only be granted to create MBeans of known and trusted classes. +# +# For example, the following entry would grant readwrite access +# to "controlRole", as well as access to create MBeans of the class +# javax.management.monitor.CounterMonitor and to unregister any MBean: +# controlRole readwrite \ +# create javax.management.monitor.CounterMonitorMBean \ +# unregister +# or equivalently: +# controlRole readwrite unregister create javax.management.monitor.CounterMBean +# +# The following entry would grant readwrite access as well as access to create +# MBeans of any class in the packages javax.management.monitor and +# javax.management.timer: +# controlRole readwrite \ +# create javax.management.monitor.*,javax.management.timer.* \ +# unregister +# +# The \ character is defined in the Properties file syntax to allow continuation +# lines as shown here. A * in a class pattern matches a sequence of characters +# other than dot (.), so javax.management.monitor.* matches +# javax.management.monitor.CounterMonitor but not +# javax.management.monitor.foo.Bar. +# +# A given role should have at most one entry in this file. If a role +# has no entry, it has no access. +# If multiple entries are found for the same role name, then the last +# access entry is used. +# +# +# Default access control entries: +# o The "monitorRole" role has readonly access. +# o The "controlRole" role has readwrite access and can create the standard +# Timer and Monitor MBeans defined by the JMX API. + +monitorRole readonly +controlRole readwrite \ + create javax.management.monitor.*,javax.management.timer.* \ + unregister diff --git a/runtime/jre/lib/management/jmxremote.password.template b/runtime/jre/lib/management/jmxremote.password.template new file mode 100644 index 0000000..a7e7daa --- /dev/null +++ b/runtime/jre/lib/management/jmxremote.password.template @@ -0,0 +1,64 @@ +# ---------------------------------------------------------------------- +# Template for jmxremote.password +# +# o Copy this template to jmxremote.password +# o Set the user/password entries in jmxremote.password +# o Change the permission of jmxremote.password to read-only +# by the owner. +# +# See below for the location of jmxremote.password file. +# ---------------------------------------------------------------------- + +############################################################## +# Password File for Remote JMX Monitoring +############################################################## +# +# Password file for Remote JMX API access to monitoring. This +# file defines the different roles and their passwords. The access +# control file (jmxremote.access by default) defines the allowed +# access for each role. To be functional, a role must have an entry +# in both the password and the access files. +# +# Default location of this file is $JRE/lib/management/jmxremote.password +# You can specify an alternate location by specifying a property in +# the management config file $JRE/lib/management/management.properties +# or by specifying a system property (See that file for details). + + +############################################################## +# File permissions of the jmxremote.password file +############################################################## +# Since there are cleartext passwords stored in this file, +# this file must be readable by ONLY the owner, +# otherwise the program will exit with an error. +# +# The file format for password and access files is syntactically the same +# as the Properties file format. The syntax is described in the Javadoc +# for java.util.Properties.load. +# Typical password file has multiple lines, where each line is blank, +# a comment (like this one), or a password entry. +# +# +# A password entry consists of a role name and an associated +# password. The role name is any string that does not itself contain +# spaces or tabs. The password is again any string that does not +# contain spaces or tabs. Note that passwords appear in the clear in +# this file, so it is a good idea not to use valuable passwords. +# +# A given role should have at most one entry in this file. If a role +# has no entry, it has no access. +# If multiple entries are found for the same role name, then the last one +# is used. +# +# In a typical installation, this file can be read by anybody on the +# local machine, and possibly by people on other machines. +# For # security, you should either restrict the access to this file, +# or specify another, less accessible file in the management config file +# as described above. +# +# Following are two commented-out entries. The "measureRole" role has +# password "QED". The "controlRole" role has password "R&D". +# +# monitorRole QED +# controlRole R&D + diff --git a/runtime/jre/lib/management/management.properties b/runtime/jre/lib/management/management.properties new file mode 100644 index 0000000..70efa2e --- /dev/null +++ b/runtime/jre/lib/management/management.properties @@ -0,0 +1,331 @@ +##################################################################### +# Default Configuration File for Java Platform Management +##################################################################### +# +# The Management Configuration file (in java.util.Properties format) +# will be read if one of the following system properties is set: +# -Dcom.sun.management.jmxremote.port= +# or -Dcom.sun.management.snmp.port= +# or -Dcom.sun.management.config.file= +# +# The default Management Configuration file is: +# +# $JRE/lib/management/management.properties +# +# Another location for the Management Configuration File can be specified +# by the following property on the Java command line: +# +# -Dcom.sun.management.config.file= +# +# If -Dcom.sun.management.config.file= is set, the port +# number for the management agent can be specified in the config file +# using the following lines: +# +# ################ Management Agent Port ######################### +# +# For setting the JMX RMI agent port use the following line +# com.sun.management.jmxremote.port= +# +# For setting the SNMP agent port use the following line +# com.sun.management.snmp.port= + +##################################################################### +# Optional Instrumentation +##################################################################### +# +# By default only the basic instrumentation with low overhead is on. +# The following properties allow to selectively turn on optional +# instrumentation which are off by default and may have some +# additional overhead. +# +# com.sun.management.enableThreadContentionMonitoring +# +# This option enables thread contention monitoring if the +# Java virtual machine supports such instrumentation. +# Refer to the specification for the java.lang.management.ThreadMBean +# interface - see isThreadContentionMonitoringSupported() method. +# + +# To enable thread contention monitoring, uncomment the following line +# com.sun.management.enableThreadContentionMonitoring + +##################################################################### +# SNMP Management Properties +##################################################################### +# +# If the system property -Dcom.sun.management.snmp.port= +# is set then +# - The SNMP agent (with the Java virtual machine MIB) is started +# that listens on the specified port for incoming SNMP requests. +# - the following properties for read for SNMP management. +# +# The configuration can be specified only at startup time. +# Later changes to the above system property (e.g. via setProperty method), this +# config file, or the ACL file has no effect to the running SNMP agent. +# + +# +# ##################### SNMP Trap Port ######################### +# +# com.sun.management.snmp.trap= +# Specifies the remote port number at which managers are expected +# to listen for trap. For each host defined in the ACL file, +# the SNMP agent will send traps at : +# Default for this property is 162. +# + +# To set port for sending traps to a different port use the following line +# com.sun.management.snmp.trap= + +# +# ################ SNMP listen interface ######################### +# +# com.sun.management.snmp.interface= +# Specifies the local interface on which the SNMP agent will bind. +# This is useful when running on machines which have several +# interfaces defined. It makes it possible to listen to a specific +# subnet accessible through that interface. +# Default for this property is "localhost". +# +# The format of the value for that property is any string accepted +# by java.net.InetAddress.getByName(String). +# + +# For restricting the port on which SNMP agent listens use the following line +# com.sun.management.snmp.interface= + +# +# #################### SNMP ACL file ######################### +# +# com.sun.management.snmp.acl=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then the ACL file +# is not checked: all manager hosts are allowed all access. +# + +# For SNMP without checking ACL file uncomment the following line +# com.sun.management.snmp.acl=false + +# +# com.sun.management.snmp.acl.file=filepath +# Specifies location for ACL file +# This is optional - default location is +# $JRE/lib/management/snmp.acl +# +# If the property "com.sun.management.snmp.acl" is set to false, +# then this property and the ACL file are ignored. +# Otherwise the ACL file must exist and be in the valid format. +# If the ACL file is empty or non existent then no access is allowed. +# +# The SNMP agent will read the ACL file at startup time. +# Modification to the ACL file has no effect to any running SNMP +# agents which read that ACL file at startup. +# + +# For a non-default acl file location use the following line +# com.sun.management.snmp.acl.file=filepath + +##################################################################### +# RMI Management Properties +##################################################################### +# +# If system property -Dcom.sun.management.jmxremote.port= +# is set then +# - A MBean server is started +# - JRE Platform MBeans are registered in the MBean server +# - RMI connector is published in a private readonly registry at +# specified port using a well known name, "jmxrmi" +# - the following properties are read for JMX remote management. +# +# The configuration can be specified only at startup time. +# Later changes to above system property (e.g. via setProperty method), +# this config file, the password file, or the access file have no effect to the +# running MBean server, the connector, or the registry. +# + +# +# ########## RMI connector settings for local management ########## +# +# com.sun.management.jmxremote.local.only=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as true then the local JMX RMI connector +# server will only accept connection requests from clients running on +# the host where the out-of-the-box JMX management agent is running. +# In order to ensure backwards compatibility this property could be +# set to false. However, deploying the local management agent in this +# way is discouraged because the local JMX RMI connector server will +# accept connection requests from any client either local or remote. +# For remote management the remote JMX RMI connector server should +# be used instead with authentication and SSL/TLS encryption enabled. +# + +# For allowing the local management agent accept local +# and remote connection requests use the following line +# com.sun.management.jmxremote.local.only=false + +# +# ###################### RMI SSL ############################# +# +# com.sun.management.jmxremote.ssl=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then SSL is not used. +# + +# For RMI monitoring without SSL use the following line +# com.sun.management.jmxremote.ssl=false + +# com.sun.management.jmxremote.ssl.config.file=filepath +# Specifies the location of the SSL configuration file. A properties +# file can be used to supply the keystore and truststore location and +# password settings thus avoiding to pass them as cleartext in the +# command-line. +# +# The current implementation of the out-of-the-box management agent will +# look up and use the properties specified below to configure the SSL +# keystore and truststore, if present: +# javax.net.ssl.keyStore= +# javax.net.ssl.keyStorePassword= +# javax.net.ssl.trustStore= +# javax.net.ssl.trustStorePassword= +# Any other properties in the file will be ignored. This will allow us +# to extend the property set in the future if required by the default +# SSL implementation. +# +# If the property "com.sun.management.jmxremote.ssl" is set to false, +# then this property is ignored. +# + +# For supplying the keystore settings in a file use the following line +# com.sun.management.jmxremote.ssl.config.file=filepath + +# com.sun.management.jmxremote.ssl.enabled.cipher.suites= +# The value of this property is a string that is a comma-separated list +# of SSL/TLS cipher suites to enable. This property can be specified in +# conjunction with the previous property "com.sun.management.jmxremote.ssl" +# in order to control which particular SSL/TLS cipher suites are enabled +# for use by accepted connections. If this property is not specified then +# the SSL/TLS RMI Server Socket Factory uses the SSL/TLS cipher suites that +# are enabled by default. +# + +# com.sun.management.jmxremote.ssl.enabled.protocols= +# The value of this property is a string that is a comma-separated list +# of SSL/TLS protocol versions to enable. This property can be specified in +# conjunction with the previous property "com.sun.management.jmxremote.ssl" +# in order to control which particular SSL/TLS protocol versions are +# enabled for use by accepted connections. If this property is not +# specified then the SSL/TLS RMI Server Socket Factory uses the SSL/TLS +# protocol versions that are enabled by default. +# + +# com.sun.management.jmxremote.ssl.need.client.auth=true|false +# Default for this property is false. (Case for true/false ignored) +# If this property is specified as true in conjunction with the previous +# property "com.sun.management.jmxremote.ssl" then the SSL/TLS RMI Server +# Socket Factory will require client authentication. +# + +# For RMI monitoring with SSL client authentication use the following line +# com.sun.management.jmxremote.ssl.need.client.auth=true + +# com.sun.management.jmxremote.registry.ssl=true|false +# Default for this property is false. (Case for true/false ignored) +# If this property is specified as true then the RMI registry used +# to bind the RMIServer remote object is protected with SSL/TLS +# RMI Socket Factories that can be configured with the properties: +# com.sun.management.jmxremote.ssl.config.file +# com.sun.management.jmxremote.ssl.enabled.cipher.suites +# com.sun.management.jmxremote.ssl.enabled.protocols +# com.sun.management.jmxremote.ssl.need.client.auth +# If the two properties below are true at the same time, i.e. +# com.sun.management.jmxremote.ssl=true +# com.sun.management.jmxremote.registry.ssl=true +# then the RMIServer remote object and the RMI registry are +# both exported with the same SSL/TLS RMI Socket Factories. +# + +# For using an SSL/TLS protected RMI registry use the following line +# com.sun.management.jmxremote.registry.ssl=true + +# +# ################ RMI User authentication ################ +# +# com.sun.management.jmxremote.authenticate=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then no authentication is +# performed and all users are allowed all access. +# + +# For RMI monitoring without any checking use the following line +# com.sun.management.jmxremote.authenticate=false + +# +# ################ RMI Login configuration ################### +# +# com.sun.management.jmxremote.login.config= +# Specifies the name of a JAAS login configuration entry to use when +# authenticating users of RMI monitoring. +# +# Setting this property is optional - the default login configuration +# specifies a file-based authentication that uses the password file. +# +# When using this property to override the default login configuration +# then the named configuration entry must be in a file that gets loaded +# by JAAS. In addition, the login module(s) specified in the configuration +# should use the name and/or password callbacks to acquire the user's +# credentials. See the NameCallback and PasswordCallback classes in the +# javax.security.auth.callback package for more details. +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# + +# For a non-default login configuration use the following line +# com.sun.management.jmxremote.login.config= + +# +# ################ RMI Password file location ################## +# +# com.sun.management.jmxremote.password.file=filepath +# Specifies location for password file +# This is optional - default location is +# $JRE/lib/management/jmxremote.password +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# Otherwise the password file must exist and be in the valid format. +# If the password file is empty or non-existent then no access is allowed. +# + +# For a non-default password file location use the following line +# com.sun.management.jmxremote.password.file=filepath + +# +# ################ RMI Access file location ##################### +# +# com.sun.management.jmxremote.access.file=filepath +# Specifies location for access file +# This is optional - default location is +# $JRE/lib/management/jmxremote.access +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# Otherwise, the access file must exist and be in the valid format. +# If the access file is empty or non-existent then no access is allowed. +# + +# For a non-default password file location use the following line +# com.sun.management.jmxremote.access.file=filepath +# + +# ################ Management agent listen interface ######################### +# +# com.sun.management.jmxremote.host= +# Specifies the local interface on which the JMX RMI agent will bind. +# This is useful when running on machines which have several +# interfaces defined. It makes it possible to listen to a specific +# subnet accessible through that interface. +# +# The format of the value for that property is any string accepted +# by java.net.InetAddress.getByName(String). +# diff --git a/runtime/jre/lib/management/snmp.acl.template b/runtime/jre/lib/management/snmp.acl.template new file mode 100644 index 0000000..0e76676 --- /dev/null +++ b/runtime/jre/lib/management/snmp.acl.template @@ -0,0 +1,110 @@ +# ---------------------------------------------------------------------- +# Template for SNMP Access Control List File +# +# o Copy this template to snmp.acl +# o Set access control for SNMP support +# o Change the permission of snmp.acl to be read-only +# by the owner. +# +# See below for the location of snmp.acl file. +# ---------------------------------------------------------------------- + +############################################################ +# SNMP Access Control List File +############################################################ +# +# Default location of this file is $JRE/lib/management/snmp.acl. +# You can specify an alternate location by specifying a property in +# the management config file $JRE/lib/management/management.properties +# or by specifying a system property (See that file for details). +# + + +############################################################## +# File permissions of the snmp.acl file +############################################################## +# +# Since there are cleartext community strings stored in this file, +# this ACL file must be readable by ONLY the owner, +# otherwise the program will exit with an error. +# +############################################################## +# Format of the acl group +############################################################## +# +# communities: a list of SNMP community strings to which the +# access control applies separated by commas. +# +# access: either "read-only" or "read-write". +# +# managers: a list of hosts to be granted the access rights. +# Each can be expressed as any one of the following: +# - hostname: hubble +# - ip v4 and v6 addresses: 123.456.789.12 , fe80::a00:20ff:fe9b:ea82 +# - ip v4 and v6 netmask prefix notation: 123.456.789.0/24, +# fe80::a00:20ff:fe9b:ea82/64 +# see RFC 2373 (http://www.ietf.org/rfc/rfc2373.txt) +# +# An example of two community groups for multiple hosts: +# acl = { +# { +# communities = public, private +# access = read-only +# managers = hubble, snowbell, nanak +# } +# { +# communities = jerry +# access = read-write +# managers = hubble, telescope +# } +# } +# +############################################################## +# Format of the trap group +############################################################## +# +# trap-community: a single SNMP community string that will be included +# in the traps sent to the hosts. +# +# hosts: a list of hosts to which the SNMP agent will send traps. +# +# An example of two trap community definitions for multiple hosts: +# trap = { +# { +# trap-community = public +# hosts = hubble, snowbell +# } +# { +# trap-community = private +# hosts = telescope +# } +# } +# +############################################################ +# +# Update the community strings (public and private) below +# before copying this template file +# +# Common SNMP ACL Example +# ------------------------ +# +# o Only localhost can connect, and access rights +# are limited to read-only +# o Traps are sent to localhost only +# +# +# acl = { +# { +# communities = public, private +# access = read-only +# managers = localhost +# } +# } +# +# +# trap = { +# { +# trap-community = public +# hosts = localhost +# } +# } diff --git a/runtime/jre/lib/meta-index b/runtime/jre/lib/meta-index new file mode 100644 index 0000000..3a10c81 --- /dev/null +++ b/runtime/jre/lib/meta-index @@ -0,0 +1,88 @@ +% VERSION 2 +% WARNING: this file is auto-generated; do not edit +% UNSUPPORTED: this file and its format may change and/or +% may be removed in a future release +# charsets.jar +sun/nio +sun/awt +! jce.jar +javax/crypto +sun/security +# jfr.jar +jdk/jfr +jdk/management +! jsse.jar +sun/security +com/sun/net/ +! management-agent.jar +@ resources.jar +com/sun/java/util/jar/pack/ +META-INF/services/sun.util.spi.XmlPropertiesProvider +META-INF/services/javax.print.PrintServiceLookup +com/sun/corba/ +META-INF/services/javax.sound.midi.spi.SoundbankReader +sun/print +META-INF/services/javax.sound.midi.spi.MidiFileReader +META-INF/services/sun.java2d.cmm.CMMServiceProvider +javax/swing +META-INF/services/javax.sound.sampled.spi.AudioFileReader +META-INF/services/javax.sound.midi.spi.MidiDeviceProvider +sun/net +META-INF/services/javax.sound.sampled.spi.AudioFileWriter +com/sun/imageio/ +META-INF/services/sun.java2d.pipe.RenderingEngine +META-INF/mimetypes.default +META-INF/services/javax.sound.midi.spi.MidiFileWriter +sun/rmi +javax/sql +META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin +com/sun/rowset/ +META-INF/services/javax.print.StreamPrintServiceFactory +META-INF/mailcap.default +java/lang +sun/text +javax/xml +META-INF/services/javax.sound.sampled.spi.MixerProvider +com/sun/xml/ +META-INF/services/com.sun.tools.internal.xjc.Plugin +com/sun/java/swing/ +com/sun/jndi/ +com/sun/org/ +META-INF/services/javax.sound.sampled.spi.FormatConversionProvider +! rt.jar +com/sun/java/util/jar/pack/ +java/ +org/ietf/ +com/sun/beans/ +com/sun/tracing/ +com/sun/java/browser/ +com/sun/corba/ +com/sun/media/ +com/sun/awt/ +com/sun/management/ +sun/ +com/sun/jmx/ +com/sun/demo/ +com/sun/imageio/ +com/sun/net/ +com/sun/rmi/ +org/w3c/ +com/sun/swing/ +com/sun/activation/ +com/sun/nio/ +com/sun/rowset/ +org/jcp/ +com/sun/istack/ +jdk/ +com/sun/naming/ +org/xml/ +org/omg/ +com/sun/security/ +com/sun/xml/ +com/sun/java/swing/ +com/oracle/ +com/sun/java_cup/ +com/sun/jndi/ +com/sun/accessibility/ +com/sun/org/ +javax/ diff --git a/runtime/jre/lib/net.properties b/runtime/jre/lib/net.properties new file mode 100644 index 0000000..a541eef --- /dev/null +++ b/runtime/jre/lib/net.properties @@ -0,0 +1,121 @@ +############################################################ +# Default Networking Configuration File +# +# This file may contain default values for the networking system properties. +# These values are only used when the system properties are not specified +# on the command line or set programatically. +# For now, only the various proxy settings can be configured here. +############################################################ + +# Whether or not the DefaultProxySelector will default to System Proxy +# settings when they do exist. +# Set it to 'true' to enable this feature and check for platform +# specific proxy settings +# Note that the system properties that do explicitely set proxies +# (like http.proxyHost) do take precedence over the system settings +# even if java.net.useSystemProxies is set to true. + +java.net.useSystemProxies=false + +#------------------------------------------------------------------------ +# Proxy configuration for the various protocol handlers. +# DO NOT uncomment these lines if you have set java.net.useSystemProxies +# to true as the protocol specific properties will take precedence over +# system settings. +#------------------------------------------------------------------------ + +# HTTP Proxy settings. proxyHost is the name of the proxy server +# (e.g. proxy.mydomain.com), proxyPort is the port number to use (default +# value is 80) and nonProxyHosts is a '|' separated list of hostnames which +# should be accessed directly, ignoring the proxy server (default value is +# localhost & 127.0.0.1). +# +# http.proxyHost= +# http.proxyPort=80 +http.nonProxyHosts=localhost|127.*|[::1] +# +# HTTPS Proxy Settings. proxyHost is the name of the proxy server +# (e.g. proxy.mydomain.com), proxyPort is the port number to use (default +# value is 443). The HTTPS protocol handlers uses the http nonProxyHosts list. +# +# https.proxyHost= +# https.proxyPort=443 +# +# FTP Proxy settings. proxyHost is the name of the proxy server +# (e.g. proxy.mydomain.com), proxyPort is the port number to use (default +# value is 80) and nonProxyHosts is a '|' separated list of hostnames which +# should be accessed directly, ignoring the proxy server (default value is +# localhost & 127.0.0.1). +# +# ftp.proxyHost= +# ftp.proxyPort=80 +ftp.nonProxyHosts=localhost|127.*|[::1] +# +# Gopher Proxy settings. proxyHost is the name of the proxy server +# (e.g. proxy.mydomain.com), proxyPort is the port number to use (default +# value is 80) +# +# gopher.proxyHost= +# gopher.proxyPort=80 +# +# Socks proxy settings. socksProxyHost is the name of the proxy server +# (e.g. socks.domain.com), socksProxyPort is the port number to use +# (default value is 1080) +# +# socksProxyHost= +# socksProxyPort=1080 +# +# HTTP Keep Alive settings. remainingData is the maximum amount of data +# in kilobytes that will be cleaned off the underlying socket so that it +# can be reused (default value is 512K), queuedConnections is the maximum +# number of Keep Alive connections to be on the queue for clean up (default +# value is 10). +# http.KeepAlive.remainingData=512 +# http.KeepAlive.queuedConnections=10 + +# Authentication Scheme restrictions for HTTP and HTTPS. +# +# In some environments certain authentication schemes may be undesirable +# when proxying HTTP or HTTPS. For example, "Basic" results in effectively the +# cleartext transmission of the user's password over the physical network. +# This section describes the mechanism for disabling authentication schemes +# based on the scheme name. Disabled schemes will be treated as if they are not +# supported by the implementation. +# +# The 'jdk.http.auth.tunneling.disabledSchemes' property lists the authentication +# schemes that will be disabled when tunneling HTTPS over a proxy, HTTP CONNECT. +# The 'jdk.http.auth.proxying.disabledSchemes' property lists the authentication +# schemes that will be disabled when proxying HTTP. +# +# In both cases the property is a comma-separated list of, case-insensitive, +# authentication scheme names, as defined by their relevant RFCs. An +# implementation may, but is not required to, support common schemes whose names +# include: 'Basic', 'Digest', 'NTLM', 'Kerberos', 'Negotiate'. A scheme that +# is not known, or not supported, by the implementation is ignored. +# +# Note: This property is currently used by the JDK Reference implementation. It +# is not guaranteed to be examined and used by other implementations. +# +#jdk.http.auth.proxying.disabledSchemes= +jdk.http.auth.tunneling.disabledSchemes=Basic + +# +# Transparent NTLM HTTP authentication mode on Windows. Transparent authentication +# can be used for the NTLM scheme, where the security credentials based on the +# currently logged in user's name and password can be obtained directly from the +# operating system, without prompting the user. This property has three possible +# values which regulate the behavior as shown below. Other unrecognized values +# are handled the same as 'disabled'. Note, that NTLM is not considered to be a +# strongly secure authentication scheme and care should be taken before enabling +# this mechanism. +# +# Transparent authentication never used. +#jdk.http.ntlm.transparentAuth=disabled +# +# Enabled for all hosts. +#jdk.http.ntlm.transparentAuth=allHosts +# +# Enabled for hosts that are trusted in Windows Internet settings +#jdk.http.ntlm.transparentAuth=trustedHosts +# +jdk.http.ntlm.transparentAuth=disabled diff --git a/runtime/jre/lib/psfont.properties.ja b/runtime/jre/lib/psfont.properties.ja new file mode 100644 index 0000000..d17cf40 --- /dev/null +++ b/runtime/jre/lib/psfont.properties.ja @@ -0,0 +1,119 @@ +# +# +# Copyright (c) 1996, 2000, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Japanese PostScript printer property file +# +font.num=16 +# +serif=serif +timesroman=serif +sansserif=sansserif +helvetica=sansserif +monospaced=monospaced +courier=monospaced +dialog=sansserif +dialoginput=monospaced +# +serif.latin1.plain=Times-Roman +serif.latin1.italic=Times-Italic +serif.latin1.bolditalic=Times-BoldItalic +serif.latin1.bold=Times-Bold +# +sansserif.latin1.plain=Helvetica +sansserif.latin1.italic=Helvetica-Oblique +sansserif.latin1.bolditalic=Helvetica-BoldOblique +sansserif.latin1.bold=Helvetica-Bold +# +monospaced.latin1.plain=Courier +monospaced.latin1.italic=Courier-Oblique +monospaced.latin1.bolditalic=Courier-BoldOblique +monospaced.latin1.bold=Courier-Bold +# +serif.x11jis0208.plain=Ryumin-Light-H +serif.x11jis0208.italic=Ryumin-Light-H +serif.x11jis0208.bolditalic=Ryumin-Light-H +serif.x11jis0208.bold=Ryumin-Light-H +# +sansserif.x11jis0208.plain=GothicBBB-Medium-H +sansserif.x11jis0208.italic=GothicBBB-Medium-H +sansserif.x11jis0208.bolditalic=GothicBBB-Medium-H +sansserif.x11jis0208.bold=GothicBBB-Medium-H +# +monospaced.x11jis0208.plain=GothicBBB-Medium-H +monospaced.x11jis0208.italic=GothicBBB-Medium-H +monospaced.x11jis0208.bolditalic=GothicBBB-Medium-H +monospaced.x11jis0208.bold=GothicBBB-Medium-H +# +serif.x11jis0201.plain=Ryumin-Light.Hankaku +serif.x11jis0201.italic=Ryumin-Light.Hankaku +serif.x11jis0201.bolditalic=Ryumin-Light.Hankaku +serif.x11jis0201.bold=Ryumin-Light.Hankaku +# +sansserif.x11jis0201.plain=GothicBBB-Medium.Hankaku +sansserif.x11jis0201.italic=GothicBBB-Medium.Hankaku +sansserif.x11jis0201.bolditalic=GothicBBB-Medium.Hankaku +sansserif.x11jis0201.bold=GothicBBB-Medium.Hankaku +# +monospaced.x11jis0201.plain=GothicBBB-Medium.Hankaku +monospaced.x11jis0201.italic=GothicBBB-Medium.Hankaku +monospaced.x11jis0201.bolditalic=GothicBBB-Medium.Hankaku +monospaced.x11jis0201.bold=GothicBBB-Medium.Hankaku +# +Helvetica=0 +Helvetica-Bold=1 +Helvetica-Oblique=2 +Helvetica-BoldOblique=3 +Times-Roman=4 +Times-Bold=5 +Times-Italic=6 +Times-BoldItalic=7 +Courier=8 +Courier-Bold=9 +Courier-Oblique=10 +Courier-BoldOblique=11 +GothicBBB-Medium-H=12 +Ryumin-Light-H=13 +GothicBBB-Medium.Hankaku=14 +Ryumin-Light.Hankaku=15 +# +font.0=Helvetica ISOF +font.1=Helvetica-Bold ISOF +font.2=Helvetica-Oblique ISOF +font.3=Helvetica-BoldOblique ISOF +font.4=Times-Roman ISOF +font.5=Times-Bold ISOF +font.6=Times-Italic ISOF +font.7=Times-BoldItalic ISOF +font.8=Courier ISOF +font.9=Courier-Bold ISOF +font.10=Courier-Oblique ISOF +font.11=Courier-BoldOblique ISOF +font.12=GothicBBB-Medium-H findfont +font.13=Ryumin-Light-H findfont +font.14=GothicBBB-Medium.Hankaku findfont +font.15=Ryumin-Light.Hankaku findfont +# diff --git a/runtime/jre/lib/psfontj2d.properties b/runtime/jre/lib/psfontj2d.properties new file mode 100644 index 0000000..5eb2c4b --- /dev/null +++ b/runtime/jre/lib/psfontj2d.properties @@ -0,0 +1,323 @@ +# +# +# Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. + +# +# PostScript printer property file for Java 2D printing. +# +# WARNING: This is an internal implementation file, not a public file. +# Any customisation or reliance on the existence of this file and its +# contents or syntax is discouraged and unsupported. +# It may be incompatibly changed or removed without any notice. +# +# +font.num=35 +# +# Legacy logical font family names and logical font aliases should all +# map to the primary logical font names. +# +serif=serif +times=serif +timesroman=serif +sansserif=sansserif +helvetica=sansserif +dialog=sansserif +dialoginput=monospaced +monospaced=monospaced +courier=monospaced +# +# Next, physical fonts which can be safely mapped to standard postscript fonts +# These keys generally map to a value which is the same as the key, so +# the key/value is just a way to say the font has a mapping. +# Sometimes however we map more than one screen font to the same PS font. +# +avantgarde=avantgarde_book +avantgarde_book=avantgarde_book +avantgarde_demi=avantgarde_demi +avantgarde_book_oblique=avantgarde_book_oblique +avantgarde_demi_oblique=avantgarde_demi_oblique +# +itcavantgarde=avantgarde_book +itcavantgarde=avantgarde_book +itcavantgarde_demi=avantgarde_demi +itcavantgarde_oblique=avantgarde_book_oblique +itcavantgarde_demi_oblique=avantgarde_demi_oblique +# +bookman=bookman_light +bookman_light=bookman_light +bookman_demi=bookman_demi +bookman_light_italic=bookman_light_italic +bookman_demi_italic=bookman_demi_italic +# +# Exclude "helvetica" on its own as that's a legacy name for a logical font +helvetica_bold=helvetica_bold +helvetica_oblique=helvetica_oblique +helvetica_bold_oblique=helvetica_bold_oblique +# +itcbookman_light=bookman_light +itcbookman_demi=bookman_demi +itcbookman_light_italic=bookman_light_italic +itcbookman_demi_italic=bookman_demi_italic +# +# Exclude "courier" on its own as that's a legacy name for a logical font +courier_bold=courier_bold +courier_oblique=courier_oblique +courier_bold_oblique=courier_bold_oblique +# +courier_new=courier +courier_new_bold=courier_bold +# +monotype_century_schoolbook=newcenturyschoolbook +monotype_century_schoolbook_bold=newcenturyschoolbook_bold +monotype_century_schoolbook_italic=newcenturyschoolbook_italic +monotype_century_schoolbook_bold_italic=newcenturyschoolbook_bold_italic +# +newcenturyschoolbook=newcenturyschoolbook +newcenturyschoolbook_bold=newcenturyschoolbook_bold +newcenturyschoolbook_italic=newcenturyschoolbook_italic +newcenturyschoolbook_bold_italic=newcenturyschoolbook_bold_italic +# +palatino=palatino +palatino_bold=palatino_bold +palatino_italic=palatino_italic +palatino_bold_italic=palatino_bold_italic +# +# Exclude "times" on its own as that's a legacy name for a logical font +times_bold=times_roman_bold +times_italic=times_roman_italic +times_bold_italic=times_roman_bold_italic +# +times_roman=times_roman +times_roman_bold=times_roman_bold +times_roman_italic=times_roman_italic +times_roman_bold_italic=times_roman_bold_italic +# +times_new_roman=times_roman +times_new_roman_bold=times_roman_bold +times_new_roman_italic=times_roman_italic +times_new_roman_bold_italic=times_roman_bold_italic +# +zapfchancery_italic=zapfchancery_italic +itczapfchancery_italic=zapfchancery_italic +# +# Next the mapping of the font name + charset + style to Postscript font name +# for the logical fonts. +# +serif.latin1.plain=Times-Roman +serif.latin1.bold=Times-Bold +serif.latin1.italic=Times-Italic +serif.latin1.bolditalic=Times-BoldItalic +serif.symbol.plain=Symbol +serif.dingbats.plain=ZapfDingbats +serif.symbol.bold=Symbol +serif.dingbats.bold=ZapfDingbats +serif.symbol.italic=Symbol +serif.dingbats.italic=ZapfDingbats +serif.symbol.bolditalic=Symbol +serif.dingbats.bolditalic=ZapfDingbats +# +sansserif.latin1.plain=Helvetica +sansserif.latin1.bold=Helvetica-Bold +sansserif.latin1.italic=Helvetica-Oblique +sansserif.latin1.bolditalic=Helvetica-BoldOblique +sansserif.symbol.plain=Symbol +sansserif.dingbats.plain=ZapfDingbats +sansserif.symbol.bold=Symbol +sansserif.dingbats.bold=ZapfDingbats +sansserif.symbol.italic=Symbol +sansserif.dingbats.italic=ZapfDingbats +sansserif.symbol.bolditalic=Symbol +sansserif.dingbats.bolditalic=ZapfDingbats +# +monospaced.latin1.plain=Courier +monospaced.latin1.bold=Courier-Bold +monospaced.latin1.italic=Courier-Oblique +monospaced.latin1.bolditalic=Courier-BoldOblique +monospaced.symbol.plain=Symbol +monospaced.dingbats.plain=ZapfDingbats +monospaced.symbol.bold=Symbol +monospaced.dingbats.bold=ZapfDingbats +monospaced.symbol.italic=Symbol +monospaced.dingbats.italic=ZapfDingbats +monospaced.symbol.bolditalic=Symbol +monospaced.dingbats.bolditalic=ZapfDingbats +# +# Next the mapping of the font name + charset + style to Postscript font name +# for the physical fonts. Since these always report style as plain, the +# style key is always plain. So we map using the face name to the correct +# style for the postscript font. This is possible since the face names can +# be replied upon to be different for each style. +# However an application may try to create a Font applying a style to an +# physical name. We want to map to the correct Postscript font there too +# if possible but we do not map cases where the application tries to +# augment a style (eg ask for a bold version of a bold font) +# Defer to the 2D package to attempt create an artificially styled version +# +avantgarde_book.latin1.plain=AvantGarde-Book +avantgarde_demi.latin1.plain=AvantGarde-Demi +avantgarde_book_oblique.latin1.plain=AvantGarde-BookOblique +avantgarde_demi_oblique.latin1.plain=AvantGarde-DemiOblique +# +avantgarde_book.latin1.bold=AvantGarde-Demi +avantgarde_book.latin1.italic=AvantGarde-BookOblique +avantgarde_book.latin1.bolditalic=AvantGarde-DemiOblique +avantgarde_demi.latin1.italic=AvantGarde-DemiOblique +avantgarde_book_oblique.latin1.bold=AvantGarde-DemiOblique +# +bookman_light.latin1.plain=Bookman-Light +bookman_demi.latin1.plain=Bookman-Demi +bookman_light_italic.latin1.plain=Bookman-LightItalic +bookman_demi_italic.latin1.plain=Bookman-DemiItalic +# +bookman_light.latin1.bold=Bookman-Demi +bookman_light.latin1.italic=Bookman-LightItalic +bookman_light.latin1.bolditalic=Bookman-DemiItalic +bookman_light_bold.latin1.italic=Bookman-DemiItalic +bookman_light_italic.latin1.bold=Bookman-DemiItalic +# +courier.latin1.plain=Courier +courier_bold.latin1.plain=Courier-Bold +courier_oblique.latin1.plain=Courier-Oblique +courier_bold_oblique.latin1.plain=Courier-BoldOblique +courier.latin1.bold=Courier-Bold +courier.latin1.italic=Courier-Oblique +courier.latin1.bolditalic=Courier-BoldOblique +courier_bold.latin1.italic=Courier-BoldOblique +courier_italic.latin1.bold=Courier-BoldOblique +# +helvetica_bold.latin1.plain=Helvetica-Bold +helvetica_oblique.latin1.plain=Helvetica-Oblique +helvetica_bold_oblique.latin1.plain=Helvetica-BoldOblique +helvetica.latin1.bold=Helvetica-Bold +helvetica.latin1.italic=Helvetica-Oblique +helvetica.latin1.bolditalic=Helvetica-BoldOblique +helvetica_bold.latin1.italic=Helvetica-BoldOblique +helvetica_italic.latin1.bold=Helvetica-BoldOblique +# +newcenturyschoolbook.latin1.plain=NewCenturySchlbk-Roman +newcenturyschoolbook_bold.latin1.plain=NewCenturySchlbk-Bold +newcenturyschoolbook_italic.latin1.plain=NewCenturySchlbk-Italic +newcenturyschoolbook_bold_italic.latin1.plain=NewCenturySchlbk-BoldItalic +newcenturyschoolbook.latin1.bold=NewCenturySchlbk-Bold +newcenturyschoolbook.latin1.italic=NewCenturySchlbk-Italic +newcenturyschoolbook.latin1.bolditalic=NewCenturySchlbk-BoldItalic +newcenturyschoolbook_bold.latin1.italic=NewCenturySchlbk-BoldItalic +newcenturyschoolbook_italic.latin1.bold=NewCenturySchlbk-BoldItalic +# +palatino.latin1.plain=Palatino-Roman +palatino_bold.latin1.plain=Palatino-Bold +palatino_italic.latin1.plain=Palatino-Italic +palatino_bold_italic.latin1.plain=Palatino-BoldItalic +palatino.latin1.bold=Palatino-Bold +palatino.latin1.italic=Palatino-Italic +palatino.latin1.bolditalic=Palatino-BoldItalic +palatino_bold.latin1.italic=Palatino-BoldItalic +palatino_italic.latin1.bold=Palatino-BoldItalic +# +times_roman.latin1.plain=Times-Roman +times_roman_bold.latin1.plain=Times-Bold +times_roman_italic.latin1.plain=Times-Italic +times_roman_bold_italic.latin1.plain=Times-BoldItalic +times_roman.latin1.bold=Times-Bold +times_roman.latin1.italic=Times-Italic +times_roman.latin1.bolditalic=Times-BoldItalic +times_roman_bold.latin1.italic=Times-BoldItalic +times_roman_italic.latin1.bold=Times-BoldItalic +# +zapfchancery_italic.latin1.plain=ZapfChancery-MediumItalic +# +# Finally the mappings of PS font names to indexes. +# +AvantGarde-Book=0 +AvantGarde-BookOblique=1 +AvantGarde-Demi=2 +AvantGarde-DemiOblique=3 +Bookman-Demi=4 +Bookman-DemiItalic=5 +Bookman-Light=6 +Bookman-LightItalic=7 +Courier=8 +Courier-Bold=9 +Courier-BoldOblique=10 +Courier-Oblique=11 +Helvetica=12 +Helvetica-Bold=13 +Helvetica-BoldOblique=14 +Helvetica-Narrow=15 +Helvetica-Narrow-Bold=16 +Helvetica-Narrow-BoldOblique=17 +Helvetica-Narrow-Oblique=18 +Helvetica-Oblique=19 +NewCenturySchlbk-Bold=20 +NewCenturySchlbk-BoldItalic=21 +NewCenturySchlbk-Italic=22 +NewCenturySchlbk-Roman=23 +Palatino-Bold=24 +Palatino-BoldItalic=25 +Palatino-Italic=26 +Palatino-Roman=27 +Symbol=28 +Times-Bold=29 +Times-BoldItalic=30 +Times-Italic=31 +Times-Roman=32 +ZapfDingbats=33 +ZapfChancery-MediumItalic=34 +# +font.0=AvantGarde-Book ISOF +font.1=AvantGarde-BookOblique ISOF +font.2=AvantGarde-Demi ISOF +font.3=AvantGarde-DemiOblique ISOF +font.4=Bookman-Demi ISOF +font.5=Bookman-DemiItalic ISOF +font.6=Bookman-Light ISOF +font.7=Bookman-LightItalic ISOF +font.8=Courier ISOF +font.9=Courier-Bold ISOF +font.10=Courier-BoldOblique ISOF +font.11=Courier-Oblique ISOF +font.12=Helvetica ISOF +font.13=Helvetica-Bold ISOF +font.14=Helvetica-BoldOblique ISOF +font.15=Helvetica-Narrow ISOF +font.16=Helvetica-Narrow-Bold ISOF +font.17=Helvetica-Narrow-BoldOblique ISOF +font.18=Helvetica-Narrow-Oblique ISOF +font.19=Helvetica-Oblique ISOF +font.20=NewCenturySchlbk-Bold ISOF +font.21=NewCenturySchlbk-BoldItalic ISOF +font.22=NewCenturySchlbk-Italic ISOF +font.23=NewCenturySchlbk-Roman ISOF +font.24=Palatino-Bold ISOF +font.25=Palatino-BoldItalic ISOF +font.26=Palatino-Italic ISOF +font.27=Palatino-Roman ISOF +font.28=Symbol findfont +font.29=Times-Bold ISOF +font.30=Times-BoldItalic ISOF +font.31=Times-Italic ISOF +font.32=Times-Roman ISOF +font.33=ZapfDingbats findfont +font.34=ZapfChancery-MediumItalic ISOF +# diff --git a/runtime/jre/lib/resources.jar b/runtime/jre/lib/resources.jar new file mode 100644 index 0000000..242f4c7 Binary files /dev/null and b/runtime/jre/lib/resources.jar differ diff --git a/runtime/jre/lib/rt.jar b/runtime/jre/lib/rt.jar new file mode 100644 index 0000000..deb7926 Binary files /dev/null and b/runtime/jre/lib/rt.jar differ diff --git a/runtime/jre/lib/security/blacklisted.certs b/runtime/jre/lib/security/blacklisted.certs new file mode 100644 index 0000000..beded9e --- /dev/null +++ b/runtime/jre/lib/security/blacklisted.certs @@ -0,0 +1,39 @@ +Algorithm=SHA-256 +03DB9E5E79FE6117177F81C11595AF598CB176AF766290DBCEB2C318B32E39A2 +08C396C006A21055D00826A5781A5CCFCE2C8D053AB3C197637A4A7A5BB9A650 +14E6D2764A4B06701C6CBC376A253775F79C782FBCB6C0EE6F99DE4BA1024ADD +1C5E6985ACC09221DBD1A4B7BBC6D3A8C3F8540D19F20763A9537FDD42B4FFE7 +1F6BF8A3F2399AF7FD04516C2719C566CBAD51F412738F66D0457E1E6BDE6F2D +2A464E4113141352C7962FBD1706ED4B88533EF24D7BBA6CCC5D797FD202F1C4 +31C8FD37DB9B56E708B03D1F01848B068C6DA66F36FB5D82C008C6040FA3E133 +3946901F46B0071E90D78279E82FABABCA177231A704BE72C5B0E8918566EA66 +3E11CF90719F6FB44D94EAC9A156B89BEBE7B8598F28EC58913F2BFCAF91D0C0 +423279423B9FC8CB06F1BB7C3B247522B948D5F18939F378ECC901126DE40BFB +450F1B421BB05C8609854884559C323319619E8B06B001EA2DCBB74A23AA3BE2 +4CBBF8256BC9888A8007B2F386940A2E394378B0D903CBB3863C5A6394B889CE +4FEE0163686ECBD65DB968E7494F55D84B25486D438E9DE558D629D28CD4D176 +535D04DFCE027C70BD5F8A9E0AD4F218E9AFDCF5BBCF9B6DE0D81E148E2E3172 +568FAF38D9F155F624838E2181B1CEB4D8459305EE652B0F810C97C3611BFE19 +585CFE6B7436CBD4E732763A2137D7F49599BA9B1790E688FCEC799C58EB84A6 +5E83124D68D24E8E177E306DF643D5EA99C5A94D6FC34B072F7544A1CABB7C7B +71CB00749B9130FB2707A2664BFF958D0FCC8E161D9674C7450BA0FC2BEAF9D3 +76A45A496031E4DD2D7ED23E8F6FF97DBDEA980BAAC8B0BA94D7EDB551348645 +8A1BD21661C60015065212CC98B1ABB50DFD14C872A208E66BAE890F25C448AF +9ED8F9B0E8E42A1656B8E1DD18F42BA42DC06FE52686173BA2FC70E756F207DC +9FADCE80D62A959F9930D748488C1E22E821F4E1E4A43584B848C2FC11E04D77 +A686FEE577C88AB664D0787ECDFFF035F4806F3DE418DC9E4D516324FFF02083 +A90132CEA1D4F7185E4F688EFFD16F6AC14DFD78356A807599A5DABBEEF3333E +B8686723E415534BC0DBD16326F9486F85B0B0799BF6639334E61DAAE67F36CD +C0D1F42B9F4BF7ACC045B7BB5D4805E10737F67B6310CE505248D543D0D5FE07 +D0156949F1381943442C6974E9B5B49EF441BB799EF20477B90A89C3F33620CE +D151962D954970501C60079258EBCFA38502E0A9F03CD640322B08C0A3117FE5 +D24566BF315F4E597D6E381C87119FB4198F5E9E2607F5F4AB362EF7E2E7672F +D3A936E1A7775A45217C8296A1F22AC5631DCDEC45594099E78EEEBBEDCBA967 +D6CEAE5D9E047FAF7D797858D229AC991AD44316D1E2A37A21926D763153593A +DF21016B00FC54F9FE3BC8B039911BB216E9162FAD2FD14D990AB96E951B49BE +E0E740E4B0F8B3548181FF75B5372FAF4C70B99EC995D694ED0FB91B03FF8D21 +EC30C9C3065A06BB07DC5B1C6B497F370C1CA65C0F30C08E042BA6BCECC78F2C +F5B6F88F75D391A4B1EB336F9E201239FB6B1377DB8CFA7B84736216E5AFFFD7 +FBB12938ABD86C125796EDF4162D291028890A7D6C0C1CCA75FD4B95EBFA7A1A +FC02FD48DB92D4DCE6F11679D38354CF750CFC7F584A520EB90BDE80E241F2BD +FDEDB5BDFCB67411513A61AEE5CB5B5D7C52AF06028EFC996CC1B05B1D6CEA2B diff --git a/runtime/jre/lib/security/cacerts b/runtime/jre/lib/security/cacerts new file mode 100644 index 0000000..f6bd60c Binary files /dev/null and b/runtime/jre/lib/security/cacerts differ diff --git a/runtime/jre/lib/security/java.policy b/runtime/jre/lib/security/java.policy new file mode 100644 index 0000000..59d99a9 --- /dev/null +++ b/runtime/jre/lib/security/java.policy @@ -0,0 +1,51 @@ + +// Standard extensions get all permissions by default + +grant codeBase "file:${{java.ext.dirs}}/*" { + permission java.security.AllPermission; +}; + +// default permissions granted to all domains + +grant { + // Allows any thread to stop itself using the java.lang.Thread.stop() + // method that takes no argument. + // Note that this permission is granted by default only to remain + // backwards compatible. + // It is strongly recommended that you either remove this permission + // from this policy file or further restrict it to code sources + // that you specify, because Thread.stop() is potentially unsafe. + // See the API specification of java.lang.Thread.stop() for more + // information. + permission java.lang.RuntimePermission "stopThread"; + + // allows anyone to listen on dynamic ports + permission java.net.SocketPermission "localhost:0", "listen"; + + // "standard" properies that can be read by anyone + + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + permission java.util.PropertyPermission "sun.security.pkcs11.disableKeyExtraction", "read"; +}; + diff --git a/runtime/jre/lib/security/java.security b/runtime/jre/lib/security/java.security new file mode 100644 index 0000000..9b4bda2 --- /dev/null +++ b/runtime/jre/lib/security/java.security @@ -0,0 +1,1230 @@ +# +# This is the "master security properties file". +# +# An alternate java.security properties file may be specified +# from the command line via the system property +# +# -Djava.security.properties= +# +# This properties file appends to the master security properties file. +# If both properties files specify values for the same key, the value +# from the command-line properties file is selected, as it is the last +# one loaded. +# +# Also, if you specify +# +# -Djava.security.properties== (2 equals), +# +# then that properties file completely overrides the master security +# properties file. +# +# To disable the ability to specify an additional properties file from +# the command line, set the key security.overridePropertiesFile +# to false in the master security properties file. It is set to true +# by default. + +# In this file, various security properties are set for use by +# java.security classes. This is where users can statically register +# Cryptography Package Providers ("providers" for short). The term +# "provider" refers to a package or set of packages that supply a +# concrete implementation of a subset of the cryptography aspects of +# the Java Security API. A provider may, for example, implement one or +# more digital signature algorithms or message digest algorithms. +# +# Each provider must implement a subclass of the Provider class. +# To register a provider in this master security properties file, +# specify the Provider subclass name and priority in the format +# +# security.provider.= +# +# This declares a provider, and specifies its preference +# order n. The preference order is the order in which providers are +# searched for requested algorithms (when no specific provider is +# requested). The order is 1-based; 1 is the most preferred, followed +# by 2, and so on. +# +# must specify the subclass of the Provider class whose +# constructor sets the values of various properties that are required +# for the Java Security API to look up the algorithms or other +# facilities implemented by the provider. +# +# There must be at least one provider specification in java.security. +# There is a default provider that comes standard with the JDK. It +# is called the "SUN" provider, and its Provider subclass +# named Sun appears in the sun.security.provider package. Thus, the +# "SUN" provider is registered via the following: +# +# security.provider.1=sun.security.provider.Sun +# +# (The number 1 is used for the default provider.) +# +# Note: Providers can be dynamically registered instead by calls to +# either the addProvider or insertProviderAt method in the Security +# class. + +# +# List of providers and their preference orders (see above): +# +security.provider.1=sun.security.provider.Sun +security.provider.2=sun.security.rsa.SunRsaSign +security.provider.3=sun.security.ec.SunEC +security.provider.4=com.sun.net.ssl.internal.ssl.Provider +security.provider.5=com.sun.crypto.provider.SunJCE +security.provider.6=sun.security.jgss.SunProvider +security.provider.7=com.sun.security.sasl.Provider +security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI +security.provider.9=sun.security.smartcardio.SunPCSC +security.provider.10=sun.security.mscapi.SunMSCAPI + +# +# Sun Provider SecureRandom seed source. +# +# Select the primary source of seed data for the "SHA1PRNG" and +# "NativePRNG" SecureRandom implementations in the "Sun" provider. +# (Other SecureRandom implementations might also use this property.) +# +# On Unix-like systems (for example, Solaris/Linux/MacOS), the +# "NativePRNG" and "SHA1PRNG" implementations obtains seed data from +# special device files such as file:/dev/random. +# +# On Windows systems, specifying the URLs "file:/dev/random" or +# "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding +# mechanism for SHA1PRNG. +# +# By default, an attempt is made to use the entropy gathering device +# specified by the "securerandom.source" Security property. If an +# exception occurs while accessing the specified URL: +# +# SHA1PRNG: +# the traditional system/thread activity algorithm will be used. +# +# NativePRNG: +# a default value of /dev/random will be used. If neither +# are available, the implementation will be disabled. +# "file" is the only currently supported protocol type. +# +# The entropy gathering device can also be specified with the System +# property "java.security.egd". For example: +# +# % java -Djava.security.egd=file:/dev/random MainClass +# +# Specifying this System property will override the +# "securerandom.source" Security property. +# +# In addition, if "file:/dev/random" or "file:/dev/urandom" is +# specified, the "NativePRNG" implementation will be more preferred than +# SHA1PRNG in the Sun provider. +# +securerandom.source=file:/dev/random + +# +# A list of known strong SecureRandom implementations. +# +# To help guide applications in selecting a suitable strong +# java.security.SecureRandom implementation, Java distributions should +# indicate a list of known strong implementations using the property. +# +# This is a comma-separated list of algorithm and/or algorithm:provider +# entries. +# +securerandom.strongAlgorithms=Windows-PRNG:SunMSCAPI,SHA1PRNG:SUN + +# +# Class to instantiate as the javax.security.auth.login.Configuration +# provider. +# +login.configuration.provider=sun.security.provider.ConfigFile + +# +# Default login configuration file +# +#login.config.url.1=file:${user.home}/.java.login.config + +# +# Class to instantiate as the system Policy. This is the name of the class +# that will be used as the Policy object. +# +policy.provider=sun.security.provider.PolicyFile + +# The default is to have a single system-wide policy file, +# and a policy file in the user's home directory. +policy.url.1=file:${java.home}/lib/security/java.policy +policy.url.2=file:${user.home}/.java.policy + +# whether or not we expand properties in the policy file +# if this is set to false, properties (${...}) will not be expanded in policy +# files. +policy.expandProperties=true + +# whether or not we allow an extra policy to be passed on the command line +# with -Djava.security.policy=somefile. Comment out this line to disable +# this feature. +policy.allowSystemProperty=true + +# whether or not we look into the IdentityScope for trusted Identities +# when encountering a 1.1 signed JAR file. If the identity is found +# and is trusted, we grant it AllPermission. +policy.ignoreIdentityScope=false + +# +# Default keystore type. +# +keystore.type=jks + +# +# Controls compatibility mode for the JKS keystore type. +# +# When set to 'true', the JKS keystore type supports loading +# keystore files in either JKS or PKCS12 format. When set to 'false' +# it supports loading only JKS keystore files. +# +keystore.type.compat=true + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.resolver.helpers.,\ + com.sun.org.apache.xml.internal.resolver.readers.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools.,\ + jdk.xml.internal.,\ + com.sun.activation.registries.,\ + com.sun.java.accessibility.,\ + jdk.jfr.events.,\ + jdk.jfr.internal.,\ + jdk.management.jfr.internal. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, none of the class loaders supplied with the JDK call +# checkPackageDefinition. +# +package.definition=sun.,\ + com.sun.xml.internal.,\ + com.sun.imageio.,\ + com.sun.istack.internal.,\ + com.sun.jmx.,\ + com.sun.media.sound.,\ + com.sun.naming.internal.,\ + com.sun.proxy.,\ + com.sun.corba.se.,\ + com.sun.org.apache.bcel.internal.,\ + com.sun.org.apache.regexp.internal.,\ + com.sun.org.apache.xerces.internal.,\ + com.sun.org.apache.xpath.internal.,\ + com.sun.org.apache.xalan.internal.extensions.,\ + com.sun.org.apache.xalan.internal.lib.,\ + com.sun.org.apache.xalan.internal.res.,\ + com.sun.org.apache.xalan.internal.templates.,\ + com.sun.org.apache.xalan.internal.utils.,\ + com.sun.org.apache.xalan.internal.xslt.,\ + com.sun.org.apache.xalan.internal.xsltc.cmdline.,\ + com.sun.org.apache.xalan.internal.xsltc.compiler.,\ + com.sun.org.apache.xalan.internal.xsltc.trax.,\ + com.sun.org.apache.xalan.internal.xsltc.util.,\ + com.sun.org.apache.xml.internal.res.,\ + com.sun.org.apache.xml.internal.resolver.helpers.,\ + com.sun.org.apache.xml.internal.resolver.readers.,\ + com.sun.org.apache.xml.internal.security.,\ + com.sun.org.apache.xml.internal.serializer.utils.,\ + com.sun.org.apache.xml.internal.utils.,\ + com.sun.org.glassfish.,\ + com.oracle.xmlns.internal.,\ + com.oracle.webservices.internal.,\ + oracle.jrockit.jfr.,\ + org.jcp.xml.dsig.internal.,\ + jdk.internal.,\ + jdk.nashorn.internal.,\ + jdk.nashorn.tools.,\ + jdk.xml.internal.,\ + com.sun.activation.registries.,\ + com.sun.java.accessibility.,\ + jdk.jfr.events.,\ + jdk.jfr.internal.,\ + jdk.management.jfr.internal. + +# +# Determines whether this properties file can be appended to +# or overridden on the command line via -Djava.security.properties +# +security.overridePropertiesFile=true + +# +# Determines the default key and trust manager factory algorithms for +# the javax.net.ssl package. +# +ssl.KeyManagerFactory.algorithm=SunX509 +ssl.TrustManagerFactory.algorithm=PKIX + +# +# The Java-level namelookup cache policy for successful lookups: +# +# any negative value: caching forever +# any positive value: the number of seconds to cache an address for +# zero: do not cache +# +# default value is forever (FOREVER). For security reasons, this +# caching is made forever when a security manager is set. When a security +# manager is not set, the default behavior in this implementation +# is to cache for 30 seconds. +# +# NOTE: setting this to anything other than the default value can have +# serious security implications. Do not set it unless +# you are sure you are not exposed to DNS spoofing attack. +# +#networkaddress.cache.ttl=-1 + +# The Java-level namelookup cache policy for failed lookups: +# +# any negative value: cache forever +# any positive value: the number of seconds to cache negative lookup results +# zero: do not cache +# +# In some Microsoft Windows networking environments that employ +# the WINS name service in addition to DNS, name service lookups +# that fail may take a noticeably long time to return (approx. 5 seconds). +# For this reason the default caching policy is to maintain these +# results for 10 seconds. +# +# +networkaddress.cache.negative.ttl=10 + +# +# Properties to configure OCSP for certificate revocation checking +# + +# Enable OCSP +# +# By default, OCSP is not used for certificate revocation checking. +# This property enables the use of OCSP when set to the value "true". +# +# NOTE: SocketPermission is required to connect to an OCSP responder. +# +# Example, +# ocsp.enable=true + +# +# Location of the OCSP responder +# +# By default, the location of the OCSP responder is determined implicitly +# from the certificate being validated. This property explicitly specifies +# the location of the OCSP responder. The property is used when the +# Authority Information Access extension (defined in RFC 5280) is absent +# from the certificate or when it requires overriding. +# +# Example, +# ocsp.responderURL=http://ocsp.example.net:80 + +# +# Subject name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where +# the subject name alone is not sufficient to uniquely identify the certificate +# then both the "ocsp.responderCertIssuerName" and +# "ocsp.responderCertSerialNumber" properties must be used instead. When this +# property is set then those two properties are ignored. +# +# Example, +# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp" + +# +# Issuer name of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this +# property is ignored. +# +# Example, +# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" + +# +# Serial number of the OCSP responder's certificate +# +# By default, the certificate of the OCSP responder is that of the issuer +# of the certificate being validated. This property identifies the certificate +# of the OCSP responder when the default does not apply. Its value is a string +# of hexadecimal digits (colon or space separators may be present) which +# identifies a certificate in the set of certificates supplied during cert path +# validation. When this property is set then the "ocsp.responderCertIssuerName" +# property must also be set. When the "ocsp.responderCertSubjectName" property +# is set then this property is ignored. +# +# Example, +# ocsp.responderCertSerialNumber=2A:FF:00 + +# +# Policy for failed Kerberos KDC lookups: +# +# When a KDC is unavailable (network error, service failure, etc), it is +# put inside a blacklist and accessed less often for future requests. The +# value (case-insensitive) for this policy can be: +# +# tryLast +# KDCs in the blacklist are always tried after those not on the list. +# +# tryLess[:max_retries,timeout] +# KDCs in the blacklist are still tried by their order in the configuration, +# but with smaller max_retries and timeout values. max_retries and timeout +# are optional numerical parameters (default 1 and 5000, which means once +# and 5 seconds). Please notes that if any of the values defined here is +# more than what is defined in krb5.conf, it will be ignored. +# +# Whenever a KDC is detected as available, it is removed from the blacklist. +# The blacklist is reset when krb5.conf is reloaded. You can add +# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is +# reloaded whenever a JAAS authentication is attempted. +# +# Example, +# krb5.kdc.bad.policy = tryLast +# krb5.kdc.bad.policy = tryLess:2,2000 +krb5.kdc.bad.policy = tryLast + +# +# Kerberos cross-realm referrals (RFC 6806) +# +# OpenJDK's Kerberos client supports cross-realm referrals as defined in +# RFC 6806. This allows to setup more dynamic environments in which clients +# do not need to know in advance how to reach the realm of a target principal +# (either a user or service). +# +# When a client issues an AS or a TGS request, the "canonicalize" option +# is set to announce support of this feature. A KDC server may fulfill the +# request or reply referring the client to a different one. If referred, +# the client will issue a new request and the cycle repeats. +# +# In addition to referrals, the "canonicalize" option allows the KDC server +# to change the client name in response to an AS request. For security reasons, +# RFC 6806 (section 11) FAST scheme is enforced. +# +# Disable Kerberos cross-realm referrals. Value may be overwritten with a +# System property (-Dsun.security.krb5.disableReferrals). +sun.security.krb5.disableReferrals=false + +# Maximum number of AS or TGS referrals to avoid infinite loops. Value may +# be overwritten with a System property (-Dsun.security.krb5.maxReferrals). +sun.security.krb5.maxReferrals=5 + +# +# This property contains a list of disabled EC Named Curves that can be included +# in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this +# list in any of the disabledAlgorithms properties, add the property name as +# an entry. +jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ + secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ + secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ + sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ + sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ + sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ + X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ + X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ + X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ + brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 + +# +# Algorithm restrictions for certification path (CertPath) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# for certification path building and validation. For example, "MD2" is +# generally no longer considered to be a secure hash algorithm. This section +# describes the mechanism for disabling algorithms based on algorithm name +# and/or key length. This includes algorithms used in certificates, as well +# as revocation information such as CRLs and signed OCSP Responses. +# The syntax of the disabled algorithm string is described as follows: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] { '&' Constraint } | IncludeProperty +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint | CAConstraint | DenyAfterConstraint | +# UsageConstraint +# +# KeySizeConstraint: +# keySize Operator KeyLength +# +# Operator: +# <= | < | == | != | >= | > +# +# KeyLength: +# Integer value of the algorithm's key length in bits +# +# CAConstraint: +# jdkCA +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# +# UsageConstraint: +# usage [TLSServer] [TLSClient] [SignedJAR] +# +# IncludeProperty: +# include +# +# The "AlgorithmName" is the standard algorithm name of the disabled +# algorithm. See "Java Cryptography Architecture Standard Algorithm Name +# Documentation" for information about Standard Algorithm Names. Matching +# is performed using a case-insensitive sub-element matching rule. (For +# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and +# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a +# sub-element of the certificate algorithm name, the algorithm will be +# rejected during certification path building and validation. For example, +# the assertion algorithm name "DSA" will disable all certificate algorithms +# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion +# will not disable algorithms related to "ECDSA". +# +# The "IncludeProperty" allows a implementation-defined security property that +# can be included in the disabledAlgorithms properties. These properties are +# to help manage common actions easier across multiple disabledAlgorithm +# properties. +# There is one defined security property: jdk.disabled.NamedCurves +# See the property for more specific details. +# +# +# A "Constraint" defines restrictions on the keys and/or certificates for +# a specified AlgorithmName: +# +# KeySizeConstraint: +# keySize Operator KeyLength +# The constraint requires a key of a valid size range if the +# "AlgorithmName" is of a key algorithm. The "KeyLength" indicates +# the key size specified in number of bits. For example, +# "RSA keySize <= 1024" indicates that any RSA key with key size less +# than or equal to 1024 bits should be disabled, and +# "RSA keySize < 1024, RSA keySize > 2048" indicates that any RSA key +# with key size less than 1024 or greater than 2048 should be disabled. +# This constraint is only used on algorithms that have a key size. +# +# CAConstraint: +# jdkCA +# This constraint prohibits the specified algorithm only if the +# algorithm is used in a certificate chain that terminates at a marked +# trust anchor in the lib/security/cacerts keystore. If the jdkCA +# constraint is not set, then all chains using the specified algorithm +# are restricted. jdkCA may only be used once in a DisabledAlgorithm +# expression. +# Example: To apply this constraint to SHA-1 certificates, include +# the following: "SHA1 jdkCA" +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# This constraint prohibits a certificate with the specified algorithm +# from being used after the date regardless of the certificate's +# validity. JAR files that are signed and timestamped before the +# constraint date with certificates containing the disabled algorithm +# will not be restricted. The date is processed in the UTC timezone. +# This constraint can only be used once in a DisabledAlgorithm +# expression. +# Example: To deny usage of RSA 2048 bit certificates after Feb 3 2020, +# use the following: "RSA keySize == 2048 & denyAfter 2020-02-03" +# +# UsageConstraint: +# usage [TLSServer] [TLSClient] [SignedJAR] +# This constraint prohibits the specified algorithm for +# a specified usage. This should be used when disabling an algorithm +# for all usages is not practical. 'TLSServer' restricts the algorithm +# in TLS server certificate chains when server authentication is +# performed. 'TLSClient' restricts the algorithm in TLS client +# certificate chains when client authentication is performed. +# 'SignedJAR' constrains use of certificates in signed jar files. +# The usage type follows the keyword and more than one usage type can +# be specified with a whitespace delimiter. +# Example: "SHA1 usage TLSServer TLSClient" +# +# When an algorithm must satisfy more than one constraint, it must be +# delimited by an ampersand '&'. For example, to restrict certificates in a +# chain that terminate at a distribution provided trust anchor and contain +# RSA keys that are less than or equal to 1024 bits, add the following +# constraint: "RSA keySize <= 1024 & jdkCA". +# +# All DisabledAlgorithms expressions are processed in the order defined in the +# property. This requires lower keysize constraints to be specified +# before larger keysize constraints of the same algorithm. For example: +# "RSA keySize < 1024 & jdkCA, RSA keySize < 2048". +# +# Note: The algorithm restrictions do not apply to trust anchors or +# self-signed certificates. +# +# Note: This property is currently used by Oracle's PKIX implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048 +# +# +jdk.certpath.disabledAlgorithms=MD2, MD5, SHA1 jdkCA & usage TLSServer, \ + RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224, \ + include jdk.disabled.namedCurves + +# +# Legacy algorithms for certification path (CertPath) processing and +# signed JAR files. +# +# In some environments, a certain algorithm or key length may be undesirable +# but is not yet disabled. +# +# Tools such as keytool and jarsigner may emit warnings when these legacy +# algorithms are used. See the man pages for those tools for more information. +# +# The syntax is the same as the "jdk.certpath.disabledAlgorithms" and +# "jdk.jar.disabledAlgorithms" security properties. +# +# Note: This property is currently used by the JDK Reference +# implementation. It is not guaranteed to be examined and used by other +# implementations. + +jdk.security.legacyAlgorithms=SHA1, \ + RSA keySize < 2048, DSA keySize < 2048 + +# +# Algorithm restrictions for signed JAR files +# +# In some environments, certain algorithms or key lengths may be undesirable +# for signed JAR validation. For example, "MD2" is generally no longer +# considered to be a secure hash algorithm. This section describes the +# mechanism for disabling algorithms based on algorithm name and/or key length. +# JARs signed with any of the disabled algorithms or key sizes will be treated +# as unsigned. +# +# The syntax of the disabled algorithm string is described as follows: +# DisabledAlgorithms: +# " DisabledAlgorithm { , DisabledAlgorithm } " +# +# DisabledAlgorithm: +# AlgorithmName [Constraint] { '&' Constraint } +# +# AlgorithmName: +# (see below) +# +# Constraint: +# KeySizeConstraint | DenyAfterConstraint +# +# KeySizeConstraint: +# keySize Operator KeyLength +# +# DenyAfterConstraint: +# denyAfter YYYY-MM-DD +# +# Operator: +# <= | < | == | != | >= | > +# +# KeyLength: +# Integer value of the algorithm's key length in bits +# +# Note: This property is currently used by the JDK Reference +# implementation. It is not guaranteed to be examined and used by other +# implementations. +# +# See "jdk.certpath.disabledAlgorithms" for syntax descriptions. +# +jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, \ + DSA keySize < 1024, include jdk.disabled.namedCurves + +# +# Algorithm restrictions for Secure Socket Layer/Transport Layer Security +# (SSL/TLS) processing +# +# In some environments, certain algorithms or key lengths may be undesirable +# when using SSL/TLS. This section describes the mechanism for disabling +# algorithms during SSL/TLS security parameters negotiation, including +# protocol version negotiation, cipher suites selection, peer authentication +# and key exchange mechanisms. +# +# Disabled algorithms will not be negotiated for SSL/TLS connections, even +# if they are enabled explicitly in an application. +# +# For PKI-based peer authentication and key exchange mechanisms, this list +# of disabled algorithms will also be checked during certification path +# building and validation, including algorithms used in certificates, as +# well as revocation information such as CRLs and signed OCSP Responses. +# This is in addition to the jdk.certpath.disabledAlgorithms property above. +# +# See the specification of "jdk.certpath.disabledAlgorithms" for the +# syntax of the disabled algorithm string. +# +# Note: The algorithm restrictions do not apply to trust anchors or +# self-signed certificates. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048 +jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \ + DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \ + include jdk.disabled.namedCurves + +# Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS) +# processing in JSSE implementation. +# +# In some environments, a certain algorithm may be undesirable but it +# cannot be disabled because of its use in legacy applications. Legacy +# algorithms may still be supported, but applications should not use them +# as the security strength of legacy algorithms are usually not strong enough +# in practice. +# +# During SSL/TLS security parameters negotiation, legacy algorithms will +# not be negotiated unless there are no other candidates. +# +# The syntax of the legacy algorithms string is described as this Java +# BNF-style: +# LegacyAlgorithms: +# " LegacyAlgorithm { , LegacyAlgorithm } " +# +# LegacyAlgorithm: +# AlgorithmName (standard JSSE algorithm name) +# +# See the specification of security property "jdk.certpath.disabledAlgorithms" +# for the syntax and description of the "AlgorithmName" notation. +# +# Per SSL/TLS specifications, cipher suites have the form: +# SSL_KeyExchangeAlg_WITH_CipherAlg_MacAlg +# or +# TLS_KeyExchangeAlg_WITH_CipherAlg_MacAlg +# +# For example, the cipher suite TLS_RSA_WITH_AES_128_CBC_SHA uses RSA as the +# key exchange algorithm, AES_128_CBC (128 bits AES cipher algorithm in CBC +# mode) as the cipher (encryption) algorithm, and SHA-1 as the message digest +# algorithm for HMAC. +# +# The LegacyAlgorithm can be one of the following standard algorithm names: +# 1. JSSE cipher suite name, e.g., TLS_RSA_WITH_AES_128_CBC_SHA +# 2. JSSE key exchange algorithm name, e.g., RSA +# 3. JSSE cipher (encryption) algorithm name, e.g., AES_128_CBC +# 4. JSSE message digest algorithm name, e.g., SHA +# +# See SSL/TLS specifications and "Java Cryptography Architecture Standard +# Algorithm Name Documentation" for information about the algorithm names. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# There is no guarantee the property will continue to exist or be of the +# same syntax in future releases. +# +# Example: +# jdk.tls.legacyAlgorithms=DH_anon, DES_CBC, SSL_RSA_WITH_RC4_128_MD5 +# +jdk.tls.legacyAlgorithms= \ + K_NULL, C_NULL, M_NULL, \ + DH_anon, ECDH_anon, \ + RC4_128, RC4_40, DES_CBC, DES40_CBC, \ + 3DES_EDE_CBC + +# The pre-defined default finite field Diffie-Hellman ephemeral (DHE) +# parameters for Transport Layer Security (SSL/TLS/DTLS) processing. +# +# In traditional SSL/TLS/DTLS connections where finite field DHE parameters +# negotiation mechanism is not used, the server offers the client group +# parameters, base generator g and prime modulus p, for DHE key exchange. +# It is recommended to use dynamic group parameters. This property defines +# a mechanism that allows you to specify custom group parameters. +# +# The syntax of this property string is described as this Java BNF-style: +# DefaultDHEParameters: +# DefinedDHEParameters { , DefinedDHEParameters } +# +# DefinedDHEParameters: +# "{" DHEPrimeModulus , DHEBaseGenerator "}" +# +# DHEPrimeModulus: +# HexadecimalDigits +# +# DHEBaseGenerator: +# HexadecimalDigits +# +# HexadecimalDigits: +# HexadecimalDigit { HexadecimalDigit } +# +# HexadecimalDigit: one of +# 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f +# +# Whitespace characters are ignored. +# +# The "DefinedDHEParameters" defines the custom group parameters, prime +# modulus p and base generator g, for a particular size of prime modulus p. +# The "DHEPrimeModulus" defines the hexadecimal prime modulus p, and the +# "DHEBaseGenerator" defines the hexadecimal base generator g of a group +# parameter. It is recommended to use safe primes for the custom group +# parameters. +# +# If this property is not defined or the value is empty, the underlying JSSE +# provider's default group parameter is used for each connection. +# +# If the property value does not follow the grammar, or a particular group +# parameter is not valid, the connection will fall back and use the +# underlying JSSE provider's default group parameter. +# +# Note: This property is currently used by OpenJDK's JSSE implementation. It +# is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.tls.server.defaultDHEParameters= +# { \ +# FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \ +# 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \ +# EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \ +# E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED \ +# EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 \ +# FFFFFFFF FFFFFFFF, 2} + +# +# TLS key limits on symmetric cryptographic algorithms +# +# This security property sets limits on algorithms key usage in TLS 1.3. +# When the amount of data encrypted exceeds the algorithm value listed below, +# a KeyUpdate message will trigger a key change. This is for symmetric ciphers +# with TLS 1.3 only. +# +# The syntax for the property is described below: +# KeyLimits: +# " KeyLimit { , KeyLimit } " +# +# WeakKeyLimit: +# AlgorithmName Action Length +# +# AlgorithmName: +# A full algorithm transformation. +# +# Action: +# KeyUpdate +# +# Length: +# The amount of encrypted data in a session before the Action occurs +# This value may be an integer value in bytes, or as a power of two, 2^29. +# +# KeyUpdate: +# The TLS 1.3 KeyUpdate handshake process begins when the Length amount +# is fulfilled. +# +# Note: This property is currently used by OpenJDK's JSSE implementation. It +# is not guaranteed to be examined and used by other implementations. +# +jdk.tls.keyLimits=AES/GCM/NoPadding KeyUpdate 2^37 + +# Cryptographic Jurisdiction Policy defaults +# +# Import and export control rules on cryptographic software vary from +# country to country. By default, the JDK provides two different sets of +# cryptographic policy files: +# +# unlimited: These policy files contain no restrictions on cryptographic +# strengths or algorithms. +# +# limited: These policy files contain more restricted cryptographic +# strengths, and are still available if your country or +# usage requires the traditional restrictive policy. +# +# The JDK JCE framework uses the unlimited policy files by default. +# However the user may explicitly choose a set either by defining the +# "crypto.policy" Security property or by installing valid JCE policy +# jar files into the traditional JDK installation location. To better +# support older JDK Update releases, the "crypto.policy" property is not +# defined by default. See below for more information. +# +# The following logic determines which policy files are used: +# +# refers to the directory where the JRE was +# installed and may be determined using the "java.home" +# System property. +# +# 1. If the Security property "crypto.policy" has been defined, +# then the following mechanism is used: +# +# The policy files are stored as jar files in subdirectories of +# /lib/security/policy. Each directory contains a complete +# set of policy files. +# +# The "crypto.policy" Security property controls the directory +# selection, and thus the effective cryptographic policy. +# +# The default set of directories is: +# +# limited | unlimited +# +# 2. If the "crypto.policy" property is not set and the traditional +# US_export_policy.jar and local_policy.jar files +# (e.g. limited/unlimited) are found in the legacy +# /lib/security directory, then the rules embedded within +# those jar files will be used. This helps preserve compatibility +# for users upgrading from an older installation. +# +# 3. If the jar files are not present in the legacy location +# and the "crypto.policy" Security property is not defined, +# then the JDK will use the unlimited settings (equivalent to +# crypto.policy=unlimited) +# +# Please see the JCA documentation for additional information on these +# files and formats. +# +# YOU ARE ADVISED TO CONSULT YOUR EXPORT/IMPORT CONTROL COUNSEL OR ATTORNEY +# TO DETERMINE THE EXACT REQUIREMENTS. +# +# Please note that the JCE for Java SE, including the JCE framework, +# cryptographic policy files, and standard JCE providers provided with +# the Java SE, have been reviewed and approved for export as mass market +# encryption item by the US Bureau of Industry and Security. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +#crypto.policy=unlimited + +# +# The policy for the XML Signature secure validation mode. The mode is +# enabled by setting the property "org.jcp.xml.dsig.secureValidation" to +# true with the javax.xml.crypto.XMLCryptoContext.setProperty() method, +# or by running the code with a SecurityManager. +# +# Policy: +# Constraint {"," Constraint } +# Constraint: +# AlgConstraint | MaxTransformsConstraint | MaxReferencesConstraint | +# ReferenceUriSchemeConstraint | KeySizeConstraint | OtherConstraint +# AlgConstraint +# "disallowAlg" Uri +# MaxTransformsConstraint: +# "maxTransforms" Integer +# MaxReferencesConstraint: +# "maxReferences" Integer +# ReferenceUriSchemeConstraint: +# "disallowReferenceUriSchemes" String { String } +# KeySizeConstraint: +# "minKeySize" KeyAlg Integer +# OtherConstraint: +# "noDuplicateIds" | "noRetrievalMethodLoops" +# +# For AlgConstraint, Uri is the algorithm URI String that is not allowed. +# See the XML Signature Recommendation for more information on algorithm +# URI Identifiers. For KeySizeConstraint, KeyAlg is the standard algorithm +# name of the key type (ex: "RSA"). If the MaxTransformsConstraint, +# MaxReferencesConstraint or KeySizeConstraint (for the same key type) is +# specified more than once, only the last entry is enforced. +# +# Note: This property is currently used by the JDK Reference implementation. It +# is not guaranteed to be examined and used by other implementations. +# +jdk.xml.dsig.secureValidationPolicy=\ + disallowAlg http://www.w3.org/TR/1999/REC-xslt-19991116,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#rsa-md5,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#hmac-md5,\ + disallowAlg http://www.w3.org/2001/04/xmldsig-more#md5,\ + maxTransforms 5,\ + maxReferences 30,\ + disallowReferenceUriSchemes file http https,\ + minKeySize RSA 1024,\ + minKeySize DSA 1024,\ + minKeySize EC 224,\ + noDuplicateIds,\ + noRetrievalMethodLoops + +# +# Serialization process-wide filter +# +# A filter, if configured, is used by java.io.ObjectInputStream during +# deserialization to check the contents of the stream. +# A filter is configured as a sequence of patterns, each pattern is either +# matched against the name of a class in the stream or defines a limit. +# Patterns are separated by ";" (semicolon). +# Whitespace is significant and is considered part of the pattern. +# +# If the system property jdk.serialFilter is also specified on the command +# line, it supersedes the security property value defined here. +# +# If a pattern includes a "=", it sets a limit. +# If a limit appears more than once the last value is used. +# Limits are checked before classes regardless of the order in the sequence of patterns. +# If any of the limits are exceeded, the filter status is REJECTED. +# +# maxdepth=value - the maximum depth of a graph +# maxrefs=value - the maximum number of internal references +# maxbytes=value - the maximum number of bytes in the input stream +# maxarray=value - the maximum array length allowed +# +# Other patterns, from left to right, match the class or package name as +# returned from Class.getName. +# If the class is an array type, the class or package to be matched is the element type. +# Arrays of any number of dimensions are treated the same as the element type. +# For example, a pattern of "!example.Foo", rejects creation of any instance or +# array of example.Foo. +# +# If the pattern starts with "!", the status is REJECTED if the remaining pattern +# is matched; otherwise the status is ALLOWED if the pattern matches. +# If the pattern ends with ".**" it matches any class in the package and all subpackages. +# If the pattern ends with ".*" it matches any class in the package. +# If the pattern ends with "*", it matches any class with the pattern as a prefix. +# If the pattern is equal to the class name, it matches. +# Otherwise, the status is UNDECIDED. +# +#jdk.serialFilter=pattern;pattern + +# +# RMI Registry Serial Filter +# +# The filter pattern uses the same format as jdk.serialFilter. +# This filter can override the builtin filter if additional types need to be +# allowed or rejected from the RMI Registry or to decrease limits but not +# to increase limits. +# If the limits (maxdepth, maxrefs, or maxbytes) are exceeded, the object is rejected. +# +# Each non-array type is allowed or rejected if it matches one of the patterns, +# evaluated from left to right, and is otherwise allowed. Arrays of any +# component type, including subarrays and arrays of primitives, are allowed. +# +# Array construction of any component type, including subarrays and arrays of +# primitives, are allowed unless the length is greater than the maxarray limit. +# The filter is applied to each array element. +# +# The built-in filter allows subclasses of allowed classes and +# can approximately be represented as the pattern: +# +#sun.rmi.registry.registryFilter=\ +# maxarray=1000000;\ +# maxdepth=20;\ +# java.lang.String;\ +# java.lang.Number;\ +# java.lang.reflect.Proxy;\ +# java.rmi.Remote;\ +# sun.rmi.server.UnicastRef;\ +# sun.rmi.server.RMIClientSocketFactory;\ +# sun.rmi.server.RMIServerSocketFactory;\ +# java.rmi.activation.ActivationID;\ +# java.rmi.server.UID +# +# RMI Distributed Garbage Collector (DGC) Serial Filter +# +# The filter pattern uses the same format as jdk.serialFilter. +# This filter can override the builtin filter if additional types need to be +# allowed or rejected from the RMI DGC. +# +# The builtin DGC filter can approximately be represented as the filter pattern: +# +#sun.rmi.transport.dgcFilter=\ +# java.rmi.server.ObjID;\ +# java.rmi.server.UID;\ +# java.rmi.dgc.VMID;\ +# java.rmi.dgc.Lease;\ +# maxdepth=5;maxarray=10000 + +# CORBA ORBIorTypeCheckRegistryFilter +# Type check enhancement for ORB::string_to_object processing +# +# An IOR type check filter, if configured, is used by an ORB during +# an ORB::string_to_object invocation to check the veracity of the type encoded +# in the ior string. +# +# The filter pattern consists of a semi-colon separated list of class names. +# The configured list contains the binary class names of the IDL interface types +# corresponding to the IDL stub class to be instantiated. +# As such, a filter specifies a list of IDL stub classes that will be +# allowed by an ORB when an ORB::string_to_object is invoked. +# It is used to specify a white list configuration of acceptable +# IDL stub types which may be contained in a stringified IOR +# parameter passed as input to an ORB::string_to_object method. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +#com.sun.CORBA.ORBIorTypeCheckRegistryFilter=binary_class_name;binary_class_name + +# +# JCEKS Encrypted Key Serial Filter +# +# This filter, if configured, is used by the JCEKS KeyStore during the +# deserialization of the encrypted Key object stored inside a key entry. +# If not configured or the filter result is UNDECIDED (i.e. none of the patterns +# matches), the filter configured by jdk.serialFilter will be consulted. +# +# If the system property jceks.key.serialFilter is also specified, it supersedes +# the security property value defined here. +# +# The filter pattern uses the same format as jdk.serialFilter. The default +# pattern allows java.lang.Enum, java.security.KeyRep, java.security.KeyRep$Type, +# and javax.crypto.spec.SecretKeySpec and rejects all the others. +jceks.key.serialFilter = java.lang.Enum;java.security.KeyRep;\ + java.security.KeyRep$Type;javax.crypto.spec.SecretKeySpec;!* + +# The iteration count used for password-based encryption (PBE) in JCEKS +# keystores. Values in the range 10000 to 5000000 are considered valid. +# If the value is out of this range, or is not a number, or is unspecified; +# a default of 200000 is used. +# +# If the system property jdk.jceks.iterationCount is also specified, it +# supersedes the security property value defined here. +# +#jdk.jceks.iterationCount = 200000 + +# +# Disabled mechanisms for the Simple Authentication and Security Layer (SASL) +# +# Disabled mechanisms will not be negotiated by both SASL clients and servers. +# These mechanisms will be ignored if they are specified in the "mechanisms" +# argument of "Sasl.createSaslClient" or the "mechanism" argument of +# "Sasl.createSaslServer". +# +# The value of this property is a comma-separated list of SASL mechanisms. +# The mechanisms are case-sensitive. Whitespaces around the commas are ignored. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# Example: +# jdk.sasl.disabledMechanisms=PLAIN, CRAM-MD5, DIGEST-MD5 +jdk.sasl.disabledMechanisms= + +# +# Policies for distrusting Certificate Authorities (CAs). +# +# This is a comma separated value of one or more case-sensitive strings, each +# of which represents a policy for determining if a CA should be distrusted. +# The supported values are: +# +# +# SYMANTEC_TLS : Distrust TLS Server certificates anchored by a Symantec +# root CA and issued after April 16, 2019 unless issued by one of the +# following subordinate CAs which have a later distrust date: +# 1. Apple IST CA 2 - G1, SHA-256 fingerprint: +# AC2B922ECFD5E01711772FEA8ED372DE9D1E2245FCE3F57A9CDBEC77296A424B +# Distrust after December 31, 2019. +# 2. Apple IST CA 8 - G1, SHA-256 fingerprint: +# A4FE7C7F15155F3F0AEF7AAA83CF6E06DEB97CA3F909DF920AC1490882D488ED +# Distrust after December 31, 2019. +# Leading and trailing whitespace surrounding each value are ignored. +# Unknown values are ignored. If the property is commented out or set to the +# empty String, no policies are enforced. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be supported by other SE implementations. Also, this +# property does not override other security properties which can restrict +# certificates such as jdk.tls.disabledAlgorithms or +# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even +# if this property is not enabled. +# +jdk.security.caDistrustPolicies=SYMANTEC_TLS + +# +# Policies for the proxy_impersonator Kerberos ccache configuration entry +# +# The proxy_impersonator ccache configuration entry indicates that the ccache +# is a synthetic delegated credential for use with S4U2Proxy by an intermediate +# server. The ccache file should also contain the TGT of this server and +# an evidence ticket from the default principal of the ccache to this server. +# +# This security property determines how Java uses this configuration entry. +# There are 3 possible values: +# +# no-impersonate - Ignore this configuration entry, and always act as +# the owner of the TGT (if it exists). +# +# try-impersonate - Try impersonation when this configuration entry exists. +# If no matching TGT or evidence ticket is found, +# fallback to no-impersonate. +# +# always-impersonate - Always impersonate when this configuration entry exists. +# If no matching TGT or evidence ticket is found, +# no initial credential is read from the ccache. +# +# The default value is "always-impersonate". +# +# If a system property of the same name is also specified, it supersedes the +# security property value defined here. +# +#jdk.security.krb5.default.initiate.credential=always-impersonate + +# +# Trust Anchor Certificates - CA Basic Constraint check +# +# X.509 v3 certificates used as Trust Anchors (to validate signed code or TLS +# connections) must have the cA Basic Constraint field set to 'true'. Also, if +# they include a Key Usage extension, the keyCertSign bit must be set. These +# checks, enabled by default, can be disabled for backward-compatibility +# purposes with the jdk.security.allowNonCaAnchor System and Security +# properties. In the case that both properties are simultaneously set, the +# System value prevails. The default value of the property is "false". +# +#jdk.security.allowNonCaAnchor=true + +# +# The default Character set name (java.nio.charset.Charset.forName()) +# for converting TLS ALPN values between byte arrays and Strings. +# Prior versions of the JDK may use UTF-8 as the default charset. If +# you experience interoperability issues, setting this property to UTF-8 +# may help. +# +# jdk.tls.alpnCharset=UTF-8 +jdk.tls.alpnCharset=ISO_8859_1 + +# +# JNDI Object Factories Filter +# +# This filter is used by the JNDI runtime to control the set of object factory classes +# which will be allowed to instantiate objects from object references returned by +# naming/directory systems. The factory class named by the reference instance will be +# matched against this filter. The filter property supports pattern-based filter syntax +# with the same format as jdk.serialFilter. +# +# Each pattern is matched against the factory class name to allow or disallow it's +# instantiation. The access to a factory class is allowed unless the filter returns +# REJECTED. +# +# Note: This property is currently used by the JDK Reference implementation. +# It is not guaranteed to be examined and used by other implementations. +# +# If the system property jdk.jndi.object.factoriesFilter is also specified, it supersedes +# the security property value defined here. The default value of the property is "*". +# +# The default pattern value allows any object factory class specified by the reference +# instance to recreate the referenced object. +#jdk.jndi.object.factoriesFilter=* \ No newline at end of file diff --git a/runtime/jre/lib/security/policy/limited/US_export_policy.jar b/runtime/jre/lib/security/policy/limited/US_export_policy.jar new file mode 100644 index 0000000..e1db61d Binary files /dev/null and b/runtime/jre/lib/security/policy/limited/US_export_policy.jar differ diff --git a/runtime/jre/lib/security/policy/limited/local_policy.jar b/runtime/jre/lib/security/policy/limited/local_policy.jar new file mode 100644 index 0000000..eee2d4d Binary files /dev/null and b/runtime/jre/lib/security/policy/limited/local_policy.jar differ diff --git a/runtime/jre/lib/security/policy/unlimited/US_export_policy.jar b/runtime/jre/lib/security/policy/unlimited/US_export_policy.jar new file mode 100644 index 0000000..e1db61d Binary files /dev/null and b/runtime/jre/lib/security/policy/unlimited/US_export_policy.jar differ diff --git a/runtime/jre/lib/security/policy/unlimited/local_policy.jar b/runtime/jre/lib/security/policy/unlimited/local_policy.jar new file mode 100644 index 0000000..e81ce80 Binary files /dev/null and b/runtime/jre/lib/security/policy/unlimited/local_policy.jar differ diff --git a/runtime/jre/lib/sound.properties b/runtime/jre/lib/sound.properties new file mode 100644 index 0000000..68309d1 --- /dev/null +++ b/runtime/jre/lib/sound.properties @@ -0,0 +1,39 @@ +############################################################ +# Sound Configuration File +############################################################ +# +# This properties file is used to specify default service +# providers for javax.sound.midi.MidiSystem and +# javax.sound.sampled.AudioSystem. +# +# The following keys are recognized by MidiSystem methods: +# +# javax.sound.midi.Receiver +# javax.sound.midi.Sequencer +# javax.sound.midi.Synthesizer +# javax.sound.midi.Transmitter +# +# The following keys are recognized by AudioSystem methods: +# +# javax.sound.sampled.Clip +# javax.sound.sampled.Port +# javax.sound.sampled.SourceDataLine +# javax.sound.sampled.TargetDataLine +# +# The values specify the full class name of the service +# provider, or the device name. +# +# See the class descriptions for details. +# +# Example 1: +# Use MyDeviceProvider as default for SourceDataLines: +# javax.sound.sampled.SourceDataLine=com.xyz.MyDeviceProvider +# +# Example 2: +# Specify the default Synthesizer by its name "InternalSynth". +# javax.sound.midi.Synthesizer=#InternalSynth +# +# Example 3: +# Specify the default Receiver by provider and name: +# javax.sound.midi.Receiver=com.sun.media.sound.MidiProvider#SunMIDI1 +# diff --git a/runtime/jre/lib/tzdb.dat b/runtime/jre/lib/tzdb.dat new file mode 100644 index 0000000..066ec24 Binary files /dev/null and b/runtime/jre/lib/tzdb.dat differ diff --git a/runtime/jre/lib/tzmappings b/runtime/jre/lib/tzmappings new file mode 100644 index 0000000..28917ae --- /dev/null +++ b/runtime/jre/lib/tzmappings @@ -0,0 +1,226 @@ +# +# This file describes mapping information between Windows and Java +# time zones. +# Format: Each line should include a colon separated fields of Windows +# time zone registry key, time zone mapID, locale (which is most +# likely used in the time zone), and Java time zone ID. Blank lines +# and lines that start with '#' are ignored. Data lines must be sorted +# by mapID (ASCII order). +# +# NOTE +# This table format is not a public interface of any Java +# platforms. No applications should depend on this file in any form. +# +# This table has been generated by a program and should not be edited +# manually. +# +Romance:-1,64::Europe/Paris: +Romance Standard Time:-1,64::Europe/Paris: +Warsaw:-1,65::Europe/Warsaw: +Central Europe:-1,66::Europe/Prague: +Central Europe Standard Time:-1,66::Europe/Prague: +Prague Bratislava:-1,66::Europe/Prague: +W. Central Africa Standard Time:-1,66:AO:Africa/Luanda: +FLE:-1,67:FI:Europe/Helsinki: +FLE Standard Time:-1,67:FI:Europe/Helsinki: +GFT:-1,67::Europe/Athens: +GFT Standard Time:-1,67::Europe/Athens: +GTB:-1,67::Europe/Athens: +GTB Standard Time:-1,67::Europe/Athens: +Israel:-1,70::Asia/Jerusalem: +Israel Standard Time:-1,70::Asia/Jerusalem: +Arab:-1,71::Asia/Riyadh: +Arab Standard Time:-1,71::Asia/Riyadh: +Arabic Standard Time:-1,71:IQ:Asia/Baghdad: +E. Africa:-1,71:KE:Africa/Nairobi: +E. Africa Standard Time:-1,71:KE:Africa/Nairobi: +Saudi Arabia:-1,71::Asia/Riyadh: +Saudi Arabia Standard Time:-1,71::Asia/Riyadh: +Iran:-1,72::Asia/Tehran: +Iran Standard Time:-1,72::Asia/Tehran: +Afghanistan:-1,73::Asia/Kabul: +Afghanistan Standard Time:-1,73::Asia/Kabul: +India:-1,74::Asia/Calcutta: +India Standard Time:-1,74::Asia/Calcutta: +Myanmar Standard Time:-1,74::Asia/Rangoon: +Nepal Standard Time:-1,74::Asia/Katmandu: +Sri Lanka:-1,74:LK:Asia/Colombo: +Sri Lanka Standard Time:-1,74:LK:Asia/Colombo: +Beijing:-1,75::Asia/Shanghai: +China:-1,75::Asia/Shanghai: +China Standard Time:-1,75::Asia/Shanghai: +AUS Central:-1,76::Australia/Darwin: +AUS Central Standard Time:-1,76::Australia/Darwin: +Cen. Australia:-1,76::Australia/Adelaide: +Cen. Australia Standard Time:-1,76::Australia/Adelaide: +Vladivostok:-1,77::Asia/Vladivostok: +Vladivostok Standard Time:-1,77::Asia/Vladivostok: +West Pacific:-1,77:GU:Pacific/Guam: +West Pacific Standard Time:-1,77:GU:Pacific/Guam: +E. South America:-1,80::America/Sao_Paulo: +E. South America Standard Time:-1,80::America/Sao_Paulo: +Greenland Standard Time:-1,80:GL:America/Godthab: +Newfoundland:-1,81::America/St_Johns: +Newfoundland Standard Time:-1,81::America/St_Johns: +Pacific SA:-1,82::America/Santiago: +Pacific SA Standard Time:-1,82::America/Santiago: +SA Western:-1,82:BO:America/La_Paz: +SA Western Standard Time:-1,82:BO:America/La_Paz: +SA Pacific:-1,83::America/Bogota: +SA Pacific Standard Time:-1,83::America/Bogota: +US Eastern:-1,84::America/Indianapolis: +US Eastern Standard Time:-1,84::America/Indianapolis: +Central America Standard Time:-1,85::America/Regina: +Mexico:-1,85::America/Mexico_City: +Mexico Standard Time:-1,85::America/Mexico_City: +Canada Central:-1,86::America/Regina: +Canada Central Standard Time:-1,86::America/Regina: +US Mountain:-1,87::America/Phoenix: +US Mountain Standard Time:-1,87::America/Phoenix: +GMT:0,1::Europe/London: +GMT Standard Time:0,1::Europe/London: +Ekaterinburg:10,11::Asia/Yekaterinburg: +Ekaterinburg Standard Time:10,11::Asia/Yekaterinburg: +West Asia:10,11:UZ:Asia/Tashkent: +West Asia Standard Time:10,11:UZ:Asia/Tashkent: +Central Asia:12,13::Asia/Almaty: +Central Asia Standard Time:12,13::Asia/Almaty: +N. Central Asia Standard Time:12,13::Asia/Novosibirsk: +Bangkok:14,15::Asia/Bangkok: +Bangkok Standard Time:14,15::Asia/Bangkok: +North Asia Standard Time:14,15::Asia/Krasnoyarsk: +SE Asia:14,15::Asia/Bangkok: +SE Asia Standard Time:14,15::Asia/Bangkok: +North Asia East Standard Time:16,17:RU:Asia/Irkutsk: +Singapore:16,17:SG:Asia/Singapore: +Singapore Standard Time:16,17:SG:Asia/Singapore: +Taipei:16,17::Asia/Taipei: +Taipei Standard Time:16,17::Asia/Taipei: +W. Australia:16,17:AU:Australia/Perth: +W. Australia Standard Time:16,17:AU:Australia/Perth: +Korea:18,19:KR:Asia/Seoul: +Korea Standard Time:18,19:KR:Asia/Seoul: +Tokyo:18,19::Asia/Tokyo: +Tokyo Standard Time:18,19::Asia/Tokyo: +Yakutsk:18,19:RU:Asia/Yakutsk: +Yakutsk Standard Time:18,19:RU:Asia/Yakutsk: +Central European:2,3:CS:Europe/Belgrade: +Central European Standard Time:2,3:CS:Europe/Belgrade: +W. Europe:2,3::Europe/Berlin: +W. Europe Standard Time:2,3::Europe/Berlin: +Tasmania:20,-1::Australia/Hobart: +Tasmania Standard Time:20,-1::Australia/Hobart: +AUS Eastern:20,21::Australia/Sydney: +AUS Eastern Standard Time:20,21::Australia/Sydney: +E. Australia:20,21::Australia/Brisbane: +E. Australia Standard Time:20,21::Australia/Brisbane: +Sydney Standard Time:20,21::Australia/Sydney: +Tasmania Standard Time:20,65::Australia/Hobart: +Central Pacific:22,23::Pacific/Guadalcanal: +Central Pacific Standard Time:22,23::Pacific/Guadalcanal: +Dateline:24,25::GMT-1200: +Dateline Standard Time:24,25::GMT-1200: +Fiji:24,25::Pacific/Fiji: +Fiji Standard Time:24,25::Pacific/Fiji: +Samoa:26,27::Pacific/Apia: +Samoa Standard Time:26,27::Pacific/Apia: +Hawaiian:28,29::Pacific/Honolulu: +Hawaiian Standard Time:28,29::Pacific/Honolulu: +Alaskan:30,31::America/Anchorage: +Alaskan Standard Time:30,31::America/Anchorage: +Pacific:32,33::America/Los_Angeles: +Pacific Standard Time:32,33::America/Los_Angeles: +Mexico Standard Time 2:34,35:MX:America/Chihuahua: +Mountain:34,35::America/Denver: +Mountain Standard Time:34,35::America/Denver: +Central:36,37::America/Chicago: +Central Standard Time:36,37::America/Chicago: +Eastern:38,39::America/New_York: +Eastern Standard Time:38,39::America/New_York: +E. Europe:4,5::EET: +E. Europe Standard Time:4,5::EET: +Egypt:4,68::Africa/Cairo: +Egypt Standard Time:4,68::Africa/Cairo: +South Africa:4,69::Africa/Harare: +South Africa Standard Time:4,69::Africa/Harare: +Atlantic:40,41::America/Halifax: +Atlantic Standard Time:40,41::America/Halifax: +SA Eastern:42,43:GF:America/Cayenne: +SA Eastern Standard Time:42,43:GF:America/Cayenne: +Mid-Atlantic:44,45::Atlantic/South_Georgia: +Mid-Atlantic Standard Time:44,45::Atlantic/South_Georgia: +Azores:46,47::Atlantic/Azores: +Azores Standard Time:46,47::Atlantic/Azores: +Cape Verde Standard Time:46,47::Atlantic/Cape_Verde: +Russian:6,7::Europe/Moscow: +Russian Standard Time:6,7::Europe/Moscow: +New Zealand:78,79::Pacific/Auckland: +New Zealand Standard Time:78,79::Pacific/Auckland: +Tonga Standard Time:78,79::Pacific/Tongatapu: +Arabian:8,9::Asia/Muscat: +Arabian Standard Time:8,9::Asia/Muscat: +Caucasus:8,9:AM:Asia/Yerevan: +Caucasus Standard Time:8,9:AM:Asia/Yerevan: +GMT Standard Time:88,89::GMT: +Greenwich:88,89::GMT: +Greenwich Standard Time:88,89::GMT: +Aleutian Standard Time:900,900:US:America/Adak: +Altai Standard Time:901,901::Asia/Barnaul: +Argentina Standard Time:902,902::America/Buenos_Aires: +Armenian Standard Time:903,903:AM:Asia/Yerevan: +Astrakhan Standard Time:904,904::Europe/Astrakhan: +Aus Central W. Standard Time:905,905::Australia/Eucla: +Azerbaijan Standard Time:906,906:AZ:Asia/Baku: +Bahia Standard Time:907,907::America/Bahia: +Bangladesh Standard Time:908,908::Asia/Dhaka: +Belarus Standard Time:909,909:BY:Europe/Minsk: +Bougainville Standard Time:910,910::Pacific/Bougainville: +Central Brazilian Standard Time:911,911:BR:America/Cuiaba: +Central Standard Time (Mexico):912,912::America/Mexico_City: +Chatham Islands Standard Time:913,913::Pacific/Chatham: +Cuba Standard Time:914,914:CU:America/Havana: +Easter Island Standard Time:915,915:CL:Pacific/Easter: +Eastern Standard Time (Mexico):916,916::America/Cancun: +Georgian Standard Time:917,917:GE:Asia/Tbilisi: +Haiti Standard Time:918,918:HT:America/Port-au-Prince: +Jordan Standard Time:919,919:JO:Asia/Amman: +Kaliningrad Standard Time:920,920:RU:Europe/Kaliningrad: +Kamchatka Standard Time:921,921:RU:Asia/Kamchatka: +Libya Standard Time:922,922:LY:Africa/Tripoli: +Line Islands Standard Time:923,923::Pacific/Kiritimati: +Lord Howe Standard Time:924,924::Australia/Lord_Howe: +Magadan Standard Time:925,925::Asia/Magadan: +Marquesas Standard Time:926,926::Pacific/Marquesas: +Mauritius Standard Time:927,927:MU:Indian/Mauritius: +Middle East Standard Time:928,928:LB:Asia/Beirut: +Montevideo Standard Time:929,929:UY:America/Montevideo: +Morocco Standard Time:930,930:MA:Africa/Casablanca: +Mountain Standard Time (Mexico):931,931:MX:America/Chihuahua: +Namibia Standard Time:932,932:NA:Africa/Windhoek: +Norfolk Standard Time:933,933::Pacific/Norfolk: +North Korea Standard Time:934,934:KP:Asia/Pyongyang: +Pacific Standard Time (Mexico):935,935:MX:America/Tijuana: +Pakistan Standard Time:936,936::Asia/Karachi: +Paraguay Standard Time:937,937:PY:America/Asuncion: +Russia Time Zone 10:938,938::Asia/Srednekolymsk: +Russia Time Zone 11:939,939::Asia/Anadyr: +Russia Time Zone 3:940,940::Europe/Samara: +Saint Pierre Standard Time:941,941:PM:America/Miquelon: +Sakhalin Standard Time:942,942::Asia/Sakhalin: +Syria Standard Time:943,943:SY:Asia/Damascus: +Tocantins Standard Time:944,944::America/Araguaina: +Tomsk Standard Time:945,945::Asia/Tomsk: +Transbaikal Standard Time:946,946::Asia/Chita: +Turkey Standard Time:947,947::Asia/Istanbul: +Turks And Caicos Standard Time:948,948:TC:America/Grand_Turk: +UTC+12:949,949::GMT+1200: +UTC-02:950,950::GMT-0200: +UTC-08:951,951::GMT-0800: +UTC-09:952,952::GMT-0900: +UTC-11:953,953::GMT-1100: +UTC:954,954::UTC: +Ulaanbaatar Standard Time:955,955::Asia/Ulaanbaatar: +Venezuela Standard Time:956,956::America/Caracas: +W. Mongolia Standard Time:957,957::Asia/Hovd: +West Bank Standard Time:958,958::Asia/Gaza: +Western Brazilian Standard Time:959,959:BR:America/Rio_Branco: diff --git a/runtime/lib/ct.sym b/runtime/lib/ct.sym new file mode 100644 index 0000000..74dced8 Binary files /dev/null and b/runtime/lib/ct.sym differ diff --git a/runtime/lib/dt.jar b/runtime/lib/dt.jar new file mode 100644 index 0000000..282bbf4 Binary files /dev/null and b/runtime/lib/dt.jar differ diff --git a/runtime/lib/ir.idl b/runtime/lib/ir.idl new file mode 100644 index 0000000..921a7cf --- /dev/null +++ b/runtime/lib/ir.idl @@ -0,0 +1,778 @@ +/* + * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * This file contains OMG IDL from CORBA V2.0, July 1995. + * It also contains the TypeCode creation APIs in CORBA::ORB + **/ + +#pragma prefix "omg.org" + +module CORBA { + typedef string Identifier; + typedef string ScopedName; + typedef string RepositoryId; + + enum DefinitionKind { + dk_none, dk_all, + dk_Attribute, dk_Constant, dk_Exception, dk_Interface, + dk_Module, dk_Operation, dk_Typedef, + dk_Alias, dk_Struct, dk_Union, dk_Enum, + dk_Primitive, dk_String, dk_Sequence, dk_Array, + dk_Repository, + dk_Wstring, dk_Fixed, + dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value + dk_Native + }; + + + interface IRObject + /** + An IRObject IDL interface represents the most generic interface + from which all other Interface Repository interfaces are derived, + even the Repository itself. + */ + { + // read interface + readonly attribute DefinitionKind def_kind; + + // write interface + void destroy (); + }; + + + + typedef string VersionSpec; + + interface Contained; + interface Repository; + interface Container; + + interface Contained : IRObject + /** + The Contained Interface is inherited by all Interface Repository + interfaces that are contained by other objects. + */ + { + // read/write interface + + attribute RepositoryId id; + attribute Identifier name; + attribute VersionSpec version; + + // read interface + + readonly attribute Container defined_in; + readonly attribute ScopedName absolute_name; + readonly attribute Repository containing_repository; + + struct Description { + DefinitionKind kind; + any value; + }; + + Description describe (); + + // write interface + + void move ( + in Container new_container, + in Identifier new_name, + in VersionSpec new_version + ); + }; + + + interface ModuleDef; + interface ConstantDef; + interface IDLType; + interface StructDef; + interface UnionDef; + interface EnumDef; + interface AliasDef; + interface InterfaceDef; + interface ExceptionDef; + interface ValueDef; // orbos 98-01-18: Objects By Value + interface ValueMemberDef; // orbos 98-01-18: Objects By Value + interface ValueBoxDef; // orbos 98-01-18: Objects By Value + interface NativeDef; + + + typedef sequence InterfaceDefSeq; + + + typedef sequence ContainedSeq; + + struct StructMember { + Identifier name; + TypeCode type; + IDLType type_def; + }; + typedef sequence StructMemberSeq; + + struct UnionMember { + Identifier name; + any label; + TypeCode type; + IDLType type_def; + }; + typedef sequence UnionMemberSeq; + + + typedef sequence EnumMemberSeq; + + // orbos 98-01-18: Objects By Value -- begin + typedef short Visibility; + const Visibility PRIVATE_MEMBER = 0; + const Visibility PUBLIC_MEMBER = 1; + + struct ValueMember { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + IDLType type_def; + Visibility access; + }; + typedef sequence ValueMemberSeq; + + struct Initializer { + StructMemberSeq members; + }; + typedef sequence InitializerSeq; + + typedef sequence ValueDefSeq; + + // orbos 98-01-18: Objects By Value -- end + + + interface Container : IRObject + /** + The Container interface is used to form a containment hierarchy + in the Interface Repository. A Container can contain any number + of objects derived from the Contained interface. + */ + { + // read interface + + Contained lookup ( in ScopedName search_name); + + ContainedSeq contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + ContainedSeq lookup_name ( + in Identifier search_name, + in long levels_to_search, + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + struct Description { + Contained contained_object; + DefinitionKind kind; + any value; + }; + + typedef sequence DescriptionSeq; + + DescriptionSeq describe_contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited, + in long max_returned_objs + ); + + // write interface + + ModuleDef create_module ( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + + ConstantDef create_constant ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in any value + ); + + StructDef create_struct ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + UnionDef create_union ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType discriminator_type, + in UnionMemberSeq members + ); + + EnumDef create_enum ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in EnumMemberSeq members + ); + + AliasDef create_alias ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type + ); + + ExceptionDef create_exception ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + + InterfaceDef create_interface ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in boolean is_abstract, + in InterfaceDefSeq base_interfaces + ); + + // orbos 98-01-18: Objects By Value + ValueDef create_value( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in boolean is_custom, + in boolean is_abstract, + in octet flags, // must be 0 + in ValueDef base_value, + in boolean has_safe_base, + in ValueDefSeq abstract_base_values, + in InterfaceDefSeq supported_interfaces, + in InitializerSeq initializers + ); + + // orbos 98-01-18: Objects By Value + ValueBoxDef create_value_box( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type_def + ); + + NativeDef create_native( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + + }; + + + + interface IDLType : IRObject + /** + The IDLType interface is an abstract interface inherited by all + IR objects that represent the OMG IDL types. It provides access + to the TypeCode describing the type, and is used in defining the + other interfaces wherever definitions of IDLType must be referenced. + */ + { + readonly attribute TypeCode type; + }; + + + + interface PrimitiveDef; + interface StringDef; + interface SequenceDef; + interface ArrayDef; + + enum PrimitiveKind { + pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, + pk_float, pk_double, pk_boolean, pk_char, pk_octet, + pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref + }; + + interface Repository : Container + /** + Repository is an interface that provides global access to the + Interface Repository. Repository objects can contain constants, + typedefs, exceptions, interfaces, and modules. + */ + { + // read interface + + Contained lookup_id (in RepositoryId search_id); + + PrimitiveDef get_primitive (in PrimitiveKind kind); + + // write interface + + StringDef create_string (in unsigned long bound); + + SequenceDef create_sequence ( + in unsigned long bound, + in IDLType element_type + ); + + ArrayDef create_array ( + in unsigned long length, + in IDLType element_type + ); + }; + + + interface ModuleDef : Container, Contained + /** + A ModuleDef can contain constants, typedefs, exceptions, interfaces, + and other module objects. + */ + { + }; + + struct ModuleDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + }; + + + interface ConstantDef : Contained + /** + A ConstantDef object defines a named constant. + */ + { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute any value; + }; + + struct ConstantDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + any value; + }; + + + interface TypedefDef : Contained, IDLType + /** + TypedefDef is an abstract interface used as a base interface for + all named non-object types(structures, unions, enumerations, + aliases). The TypedefDef interface is not inherited by the definition + objects for the primitive or anonymous types. + */ + { + }; + + struct TypeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + + interface StructDef : TypedefDef, Container + /** + A StructDef represents an OMG IDL structure definition. + */ + { + attribute StructMemberSeq members; + }; + + + interface UnionDef : TypedefDef, Container + /** + A UnionDef represents an OMG IDL union definition. + */ + { + readonly attribute TypeCode discriminator_type; + attribute IDLType discriminator_type_def; + attribute UnionMemberSeq members; + }; + + + interface EnumDef : TypedefDef + /** + A EnumDef represents an OMG IDL enum definition. + */ + { + attribute EnumMemberSeq members; + }; + + + interface AliasDef : TypedefDef + /** + An AliasDef represents an OMG IDL typedef that aliases other + definition. + */ + { + attribute IDLType original_type_def; + }; + + + interface PrimitiveDef: IDLType + /** + A PrimitiveDef represents one of the IDL primitive types. As + primitive types are unnamed, this interface is not derived from + TypedefDef or Contained. + */ + { + readonly attribute PrimitiveKind kind; + }; + + + interface StringDef : IDLType + /** + A StringDef represents an OMG IDL string type. As string + types are anonymous, this interface is not derived from TypedefDef + or Contained. + */ + { + attribute unsigned long bound; + }; + + + interface SequenceDef : IDLType + /** + A SequenceDef represents an OMG IDL sequence type. As sequence + types are anonymous, this interface is not derived from TypedefDef + or Contained. + */ + { + attribute unsigned long bound; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ArrayDef : IDLType + /** + An ArrayDef represents an OMG IDL array type. As array + types are anonymous, this interface is not derived from TypedefDef + or Contained. + */ + { + attribute unsigned long length; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + + interface ExceptionDef : Contained, Container + /** + An ExceptionDef represents an exception definition. + */ + { + readonly attribute TypeCode type; + attribute StructMemberSeq members; + }; + struct ExceptionDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + + + enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; + + interface AttributeDef : Contained + /** + An AttributeDef represents the information that defines an + attribute of an interface. + */ + { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute AttributeMode mode; + }; + + struct AttributeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + AttributeMode mode; + }; + + + + enum OperationMode {OP_NORMAL, OP_ONEWAY}; + + enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; + struct ParameterDescription { + Identifier name; + TypeCode type; + IDLType type_def; + ParameterMode mode; + }; + typedef sequence ParDescriptionSeq; + + typedef Identifier ContextIdentifier; + typedef sequence ContextIdSeq; + + typedef sequence ExceptionDefSeq; + typedef sequence ExcDescriptionSeq; + + interface OperationDef : Contained + /** + An OperationDef represents the information that defines an + operation of an interface. + */ + { + readonly attribute TypeCode result; + attribute IDLType result_def; + attribute ParDescriptionSeq params; + attribute OperationMode mode; + attribute ContextIdSeq contexts; + attribute ExceptionDefSeq exceptions; + }; + + struct OperationDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode result; + OperationMode mode; + ContextIdSeq contexts; + ParDescriptionSeq parameters; + ExcDescriptionSeq exceptions; + }; + + + + typedef sequence RepositoryIdSeq; + typedef sequence OpDescriptionSeq; + typedef sequence AttrDescriptionSeq; + + interface InterfaceDef : Container, Contained, IDLType + /** + An InterfaceDef object represents an interface definition. It can + contains constants, typedefs, exceptions, operations, and + attributes. + */ + { + // read/write interface + + attribute InterfaceDefSeq base_interfaces; + attribute boolean is_abstract; + + // read interface + + boolean is_a (in RepositoryId interface_id); + + struct FullInterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + boolean is_abstract; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + RepositoryIdSeq base_interfaces; + TypeCode type; + }; + + FullInterfaceDescription describe_interface(); + + // write interface + + AttributeDef create_attribute ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct InterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq base_interfaces; + }; + + + // orbos 98-01-18: Objects By Value -- begin + + interface ValueMemberDef : Contained + + /** A ValueMemberDef object represents the public + and private data member definition of a Value type + */ + + { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute Visibility access; + }; + + interface ValueDef : Container, Contained, IDLType + /** + A ValueDef object represents the definition of the + Value object used to pass the object state + between hosts + */ + + { + // read/write interface + attribute InterfaceDefSeq supported_interfaces; + attribute InitializerSeq initializers; + attribute ValueDef base_value; + attribute ValueDefSeq abstract_base_values; + attribute boolean is_abstract; + attribute boolean is_custom; + attribute octet flags; // always 0 + attribute boolean has_safe_base; + + // read interface + boolean is_a(in RepositoryId value_id); + + struct FullValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + octet flags; // always 0 + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + ValueMemberSeq members; + InitializerSeq initializers; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean has_safe_base; + RepositoryId base_value; + TypeCode type; + }; + + FullValueDescription describe_value(); + + // write interface + + ValueMemberDef create_value_member( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type_def, + in Visibility access + ); + + AttributeDef create_attribute( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + struct ValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + octet flags; // always 0 + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean has_safe_base; + RepositoryId base_value; + }; + + interface ValueBoxDef : IDLType + + /** ValueBoxDef is an interface that reresents a value type with + a single data member inside its state section and no + inheritance or methods. For example, when transmitting a + string or sequence as an actual parameter on an interface + operation or as a data member of a value type that is an + actual parameter, it may be important to preserve any sharing + of the string or sequence within the object graph being + transmitted. Because current IDL data types do not preserve + referential integrity in this way, this requirement is + conveniently handled by using a value type. Value types also + support the transmission of nulls (as a distinguished value), + whereas IDL data types such as string and sequence (which are + mapped to empty strings and sequences) do not. The Java to IDL + mapping requires both preservation of referential integrity + and transmission of nulls. Because it would be cumbersome to + require the full IDL syntax for a value type for this specific + usage, this shorthand notation is introduced to cover this use + of value types for simple containment of a single data member. + */ + +{ + attribute IDLType original_type_def; + }; + + // orbos 98-01-18: Objects By Value -- end + + interface NativeDef : TypedefDef { + }; +}; diff --git a/runtime/lib/jawt.lib b/runtime/lib/jawt.lib new file mode 100644 index 0000000..07be649 Binary files /dev/null and b/runtime/lib/jawt.lib differ diff --git a/runtime/lib/jconsole.jar b/runtime/lib/jconsole.jar new file mode 100644 index 0000000..ea3654d Binary files /dev/null and b/runtime/lib/jconsole.jar differ diff --git a/runtime/lib/jvm.lib b/runtime/lib/jvm.lib new file mode 100644 index 0000000..9c6de4e Binary files /dev/null and b/runtime/lib/jvm.lib differ diff --git a/runtime/lib/orb.idl b/runtime/lib/orb.idl new file mode 100644 index 0000000..81ed1af --- /dev/null +++ b/runtime/lib/orb.idl @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// IDL not generated by rmic, do not edit +// These are all in IDL module CORBA +// The Java classes are in the package org.omg.CORBA +// See ValueType Semantics:Standard Value Box Definitions (5.3) in CORBA 2.3 spec + +#ifndef __org_omg_CORBA__ +#define __org_omg_CORBA__ + +#pragma prefix "omg.org" + +module CORBA{ + + valuetype StringValue string; + valuetype WStringValue wstring; + +}; + +#include "ir.idl" + +#pragma prefix "" + +#endif diff --git a/runtime/lib/sa-jdi.jar b/runtime/lib/sa-jdi.jar new file mode 100644 index 0000000..80a7a53 Binary files /dev/null and b/runtime/lib/sa-jdi.jar differ diff --git a/runtime/lib/tools.jar b/runtime/lib/tools.jar new file mode 100644 index 0000000..7e279c0 Binary files /dev/null and b/runtime/lib/tools.jar differ diff --git a/runtime/release b/runtime/release new file mode 100644 index 0000000..2f045ce --- /dev/null +++ b/runtime/release @@ -0,0 +1,15 @@ +JAVA_VERSION="1.8.0_322" +OS_NAME="Windows" +OS_VERSION="5.2" +OS_ARCH="amd64" +SOURCE=" .:OpenJDK: 20c7bb7a16:" +IMPLEMENTOR="Eclipse Adoptium" +BUILD_SOURCE="git:7bc9c9a9" +BUILD_SOURCE_REPO="https://github.com/adoptium/temurin-build.git" +SOURCE_REPO="https://github.com/adoptium/jdk8u.git" +FULL_VERSION="1.8.0_322-b06" +SEMANTIC_VERSION="8.0.322+6" +BUILD_INFO="OS: Windows Server 2012 R2 Version: 6.3" +JVM_VARIANT="Hotspot" +JVM_VERSION="25.322-b06" +IMAGE_TYPE="JDK" diff --git a/runtime/sample/README b/runtime/sample/README new file mode 100644 index 0000000..ae56b64 --- /dev/null +++ b/runtime/sample/README @@ -0,0 +1,6 @@ +The source code provided with samples and demos for the JDK is meant +to illustrate the usage of a given feature or technique and has been +deliberately simplified. Additional steps required for a +production-quality application, such as security checks, input +validation, and proper error handling, might not be present in the +sample code. diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Device.java b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Device.java new file mode 100644 index 0000000..f4fd2c5 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Device.java @@ -0,0 +1,66 @@ +package checker; + +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import java.util.Collections; +import java.util.EnumMap; +import java.util.Map; + +/** + * Represents the device configuration. The values are loaded from an XML file by JAXB. + */ +@XmlRootElement +public class Device { + + @XmlElement() + private Map supportedModules = new EnumMap<>(Module.class); + + /** + * Returns map of supported modules. The map key is module. The map value is version. + * + * @return map of supported modules. + */ + public Map getSupportedModules() { + return Collections.unmodifiableMap(supportedModules); + } +} diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml new file mode 100644 index 0000000..23de438 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Kettle.xml @@ -0,0 +1,57 @@ + + + + + + + DISPLAY + 2 + + + THERMOMETER + 1 + + + CLOCK + 4 + + + \ No newline at end of file diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Module.java b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Module.java new file mode 100644 index 0000000..2b97b4e --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Module.java @@ -0,0 +1,49 @@ +package checker; + +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +/** + * Represents available modules. + */ +public enum Module { + + DISPLAY, CLOCK, THERMOMETER, HEATER, SPEAKER, GSM, LED; +} diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java new file mode 100644 index 0000000..6db5bae --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/PluginChecker.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +package checker; + +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.tools.Diagnostic; +import javax.xml.bind.JAXBContext; +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.xml.bind.JAXBException; + +/** + * Reads the device configuration from the XML file specified by -Adevice=device.xml. + * For each class in a project, checks required modules. If the device doesn't have + * the required module, then a compilation error will be shown. + */ +@SupportedAnnotationTypes("checker.RequireContainer") +@SupportedSourceVersion(SourceVersion.RELEASE_8) +public class PluginChecker extends javax.annotation.processing.AbstractProcessor { + + /** + * Name of the option to get the path to the xml with device configuration. + */ + public static final String DEVICE_OPTION = "device"; + private Device device; + + /** + * Only the device option is supported. + * + * {@inheritDoc} + */ + @Override + public Set getSupportedOptions() { + return new HashSet<>(Arrays.asList(DEVICE_OPTION)); + } + + /** + * Initializes the processor by loading the device configuration. + * + * {@inheritDoc} + */ + @Override + public synchronized void init(ProcessingEnvironment processingEnv) { + super.init(processingEnv); + try { + String deviceOption = processingEnv.getOptions().get(DEVICE_OPTION); + device = (Device) JAXBContext.newInstance(Device.class) + .createUnmarshaller().unmarshal(new File(deviceOption)); + } catch (JAXBException e) { + throw new RuntimeException( + "Please specify device by -Adevice=device.xml\n" + + e.toString(), e); + } + } + + /** + * Processes @Require annotations and checks that Device meets requirements. + * + * {@inheritDoc} + */ + @Override + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + for (Element el : roundEnv.getElementsAnnotatedWith(RequireContainer.class)) { + for (Require req : el.getAnnotationsByType(Require.class)) { + //for every Require annotation checks if device has module of required version. + Integer version = device.getSupportedModules().get(req.value()); + + if (version == null + || version < req.minVersion() + || version > req.maxVersion()) { + //if module is optional then show only warning not error + if (req.optional()) { + processingEnv.getMessager() + .printMessage(Diagnostic.Kind.WARNING, + "Plugin [" + el + "] requires " + req + + "\n but device " + (version == null + ? "doesn't have such module." + + " This module is optional." + + " So plugin will work but miss" + + " some functionality" + : "has " + version + + " version of that module")); + } else { + processingEnv.getMessager() + .printMessage(Diagnostic.Kind.ERROR, + "Plugin [" + el + "] requires " + req + + "\n but device " + + (version == null + ? "doesn't have such module" + : "has " + version + + " version of that module")); + } + } + } + return true; + } + return false; + } +} diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Require.java b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Require.java new file mode 100644 index 0000000..6681c28 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/Require.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +package checker; + +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Indicates that a plug-in depends on a module. + */ +@Retention(RetentionPolicy.CLASS) +@Repeatable(RequireContainer.class) +public @interface Require { + + /** + * Returns the required module. + * + * @return required module. + */ + Module value(); + + /** + * Returns the minimum supported version of a module. + * + * @return minimum supported version of a module. + */ + int minVersion() default 1; + + /** + * Returns the maximum supported version of a module. + * + * @return maximum supported version of a module. + */ + int maxVersion() default Integer.MAX_VALUE; + + /** + * Returns true if a module is optional. A module is optional if a system + * works without that module but is missing some functionality. Returns false if a system + * won't work without the specified module. + * + * @return true if module is optional. False otherwise. + */ + boolean optional() default false; +} diff --git a/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java new file mode 100644 index 0000000..d18e0d5 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/PluginChecker/src/checker/RequireContainer.java @@ -0,0 +1,51 @@ +package checker; + +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * A container for the repeatable @Require annotation. + */ +@Retention(RetentionPolicy.CLASS) +public @interface RequireContainer { + + Require[] value(); +} diff --git a/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java new file mode 100644 index 0000000..3a9d842 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/BoilerPlugin.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +package plugins; + +import checker.Module; +import checker.Require; + +/** + * BoilerPlugin provides support for boiling water and keeping water warm. + */ +@Require(value = Module.CLOCK, maxVersion = 3) +@Require(value = Module.THERMOMETER) +@Require(value = Module.HEATER) +@Require(value = Module.LED, optional = true) //will use if present +public class BoilerPlugin { + + /** + * Heats water up to 100 degrees Celsius. + */ + public void boil() { + boil(100); + } + + /** + * Heats water up to temperature. + * + * @param temperature - desired temperature of the water in the boiler + */ + public void boil(int temperature) { + /* + * Turn on heater and wait while temperature reaches desired temperature + * in Celsius. Finally, turn off heater. + * If present, the LED light changes color according to the temperature. + */ + } + + /** + * Keeps desired temperature. + * + * @param temperature - desired temperature of the water in the boiler + * @param seconds - period of time for checking temperature in seconds + */ + public void keepWarm(int temperature, int seconds) { + //Every n seconds check temperature and warm up, if necessary. + } + +} diff --git a/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java new file mode 100644 index 0000000..b7be610 --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/ExtendedBoilerPlugin.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +package plugins; + +import checker.Module; +import checker.Require; +import java.util.Calendar; + +/** + * Introduces new features for BoilerPlugin. Features are boiling water by an + * SMS and boiling water by date with notification by a phone call. + */ +@Require(value = Module.SPEAKER) +@Require(value = Module.GSM, minVersion = 3) +@Require(value = Module.DISPLAY) +public class ExtendedBoilerPlugin extends BoilerPlugin { + + /** + * Boils water at the appointed time and wakes you up by a ring and phone + * call. Shows "Good morning" and a quote of the day from the Internet on the + * display. + * + * @param calendar - date and time when water should be boiled + * @param phoneNumber - phone number to call + */ + public void boilAndWakeUp(Calendar calendar, int phoneNumber) { + //implementation + } + + /** + * Boils water at the appointed time by getting an SMS of fixed format. + * Sends an SMS on finish. + * + * @param sms - text of SMS + */ + public void boilBySMS(String sms) { + //implementation + } +} diff --git a/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java new file mode 100644 index 0000000..678785c --- /dev/null +++ b/runtime/sample/annotations/DependencyChecker/Plugins/src/plugins/TimerPlugin.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +package plugins; + +import checker.Module; +import checker.Require; + +/** + * Timer plug-in is used to support an alarm and a timer. It depends on Display and + * Clock modules. + */ +@Require(Module.DISPLAY) +@Require(value = Module.CLOCK, maxVersion = 3) +public class TimerPlugin { + + /** + * Sets timer. + * + * @param time - the remaining time. + */ + public void timer(long time) { + //start timer + //show the remaining time on display + } + + /** + * Sets alarm. + * + * @param time - the alarm time. + */ + public void alarm(long time) { + //start alarm + //show current time and alarm time on display + } +} diff --git a/runtime/sample/annotations/Validator/src/PositiveIntegerSupplier.java b/runtime/sample/annotations/Validator/src/PositiveIntegerSupplier.java new file mode 100644 index 0000000..0a14913 --- /dev/null +++ b/runtime/sample/annotations/Validator/src/PositiveIntegerSupplier.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +import java.util.function.Supplier; + +/** + * Supplies a positive number. + */ +@Validate(value = Validator.INTEGER_NUMBER, + description = "It's not an Integer ") +@Validate(value = Validator.POSITIVE_NUMBER, + description = "It's not a positive Number") +public class PositiveIntegerSupplier implements Supplier { + + /** + * Returns a string representation of a positive integer. + * + * @return string representation of a positive integer. + */ + @Override + public String get() { + return "20005"; //random number + } +} diff --git a/runtime/sample/annotations/Validator/src/SupplierValidator.java b/runtime/sample/annotations/Validator/src/SupplierValidator.java new file mode 100644 index 0000000..479ac86 --- /dev/null +++ b/runtime/sample/annotations/Validator/src/SupplierValidator.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +import javax.xml.bind.ValidationException; +import java.util.function.Supplier; + +/** + * Validates the supplier. + */ +public class SupplierValidator { + + /** + * Validates the supplier. + * + * @param supplier - Supplier that needs to be validated. + * @return true if supplier has passed validation check. False otherwise. + */ + public static boolean validate(Supplier supplier) { + for (Validate annotation + : supplier.getClass().getAnnotationsByType(Validate.class)) { + try { + annotation.value().validate(supplier); + } catch (ValidationException e) { + System.out.println(annotation.description()); + e.printStackTrace(); + return false; + } + } + return true; + } +} diff --git a/runtime/sample/annotations/Validator/src/Validate.java b/runtime/sample/annotations/Validator/src/Validate.java new file mode 100644 index 0000000..e0404ea --- /dev/null +++ b/runtime/sample/annotations/Validator/src/Validate.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Indicates that the class should be validated by the specified validator. + */ +@Retention(RetentionPolicy.RUNTIME) +@Repeatable(ValidateContainer.class) +public @interface Validate { + + /** + * Returns the validator that should validate the annotated class. + * + * @return Validator that should validate annotated class. + */ + Validator value(); + + /** + * Returns text to describe the failure of the validation check. + * + * @return text to describe the failure of the validation check. + */ + String description() default ""; +} + +/** + * A container for the repeatable @Validate annotation. + * + * @author Andrey Nazarov + */ +@Retention(RetentionPolicy.RUNTIME) +@interface ValidateContainer { + + Validate[] value(); +} diff --git a/runtime/sample/annotations/Validator/src/Validator.java b/runtime/sample/annotations/Validator/src/Validator.java new file mode 100644 index 0000000..9e074f5 --- /dev/null +++ b/runtime/sample/annotations/Validator/src/Validator.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ +import javax.xml.bind.ValidationException; +import java.util.function.Supplier; + +/** + * Enum of Validator implementations. + */ +public enum Validator { + + /** + * This validator checks that the string represents an integer. + */ + INTEGER_NUMBER { + /** + * Checks that the string represents an integer. + * + * @param string - a string supplier + * @throws ValidationException if the validation check fails + */ + @Override + void validate(Supplier string) throws ValidationException { + try { + Integer.parseInt((String) string.get()); + } catch (NumberFormatException ex) { + throw new ValidationException("Error while validating " + + string.get()); + } + } + }, + /** + * This validator checks that the string represents a positive number. + */ + POSITIVE_NUMBER { + /** + * Checks that the string represents a positive number. + * + * @param string - an string supplier + * @throws ValidationException if the validation check fails + */ + @Override + void validate(Supplier string) throws ValidationException { + try { + if (Double.compare(0.0, Double.parseDouble( + (String) string.get())) > 0) { + throw new Exception(); + } + } catch (Exception ex) { + throw new ValidationException("Error while validating " + + string.get()); + } + } + }; + + /** + * Checks that the supplier is valid. + * + * @param string - a string supplier + * @throws ValidationException if validation check fails + */ + abstract void validate(Supplier string) throws ValidationException; + +} diff --git a/runtime/sample/annotations/index.html b/runtime/sample/annotations/index.html new file mode 100644 index 0000000..a311c7f --- /dev/null +++ b/runtime/sample/annotations/index.html @@ -0,0 +1,67 @@ + + + + Repeating Annotations Demo + + +

Repeating Annotations Demo

+ +

+ This demo shows how to use repeating annotations at runtime and at compile time. +

+ +
    +
  • Dependency checker.

    + +

    + Shows how to define repeating annotations and process them at compile time. + The problem domain is some code that performs useful operations on hardware devices. + The code relies on "modules" to be present on the devices. Applicability of the code to a particular + device is checked while compiling the code for a particular device. + A set of modules provided by a device is listed in an xml file that turns red during the compilation + phase and is compared with the required module set specified by annotations. + For instance, there is kettle with hardware modules: thermometer, display, and clock. + There is also a boiler plug-in that requires clock, thermometer, heater, and optionally an LED light. + + Build the PluginChecker annotation processor first. + Then, run javac with the annotation processor against plug-in sources using the following command:

    + + javac -cp "PluginChecker.jar" -processor checker.PluginChecker -Adevice=Kettle.xml -proc:only <source + files> + +

    + where PluginChecker.jar - path to jar file that contains PluginChecker annotation processor + class.
    + Kettle.xml - path to device descriptor Kettle.xml
    + <source files> - source files in Plugins/src +

    + For more information, see the source files. +

    + + +
  • Validator.

    + +

    + Shows how to define repeating annotations and process them at runtime. + A problem domain is code that needs to validate provided Suppliers for conformance to some criteria. + The criteria are implemented by the Validator class which is applied by using annotations that are placed in + the code whenever validation is needed. For more information, see the + source files. +

    + +

    +

    +

    + Sources: Validator/src/ +
+ + \ No newline at end of file diff --git a/runtime/sample/forkjoin/mergesort/MergeDemo.java b/runtime/sample/forkjoin/mergesort/MergeDemo.java new file mode 100644 index 0000000..528f383 --- /dev/null +++ b/runtime/sample/forkjoin/mergesort/MergeDemo.java @@ -0,0 +1,296 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.util.Arrays; +import java.util.Random; + +import static java.lang.Integer.parseInt; + +/** + * MergeExample is a class that runs a demo benchmark of the {@code ForkJoin} framework + * by benchmarking a {@link MergeSort} algorithm that is implemented using + * {@link java.util.concurrent.RecursiveAction}. + * The {@code ForkJoin} framework is setup with different parallelism levels + * and the sort is executed with arrays of different sizes to see the + * trade offs by using multiple threads for different sizes of the array. + */ +public class MergeDemo { + // Use a fixed seed to always get the same random values back + private final Random random = new Random(759123751834L); + private static final int ITERATIONS = 10; + + /** + * Represents the formula {@code f(n) = start + (step * n)} for n = 0 & n < iterations + */ + private static class Range { + private final int start; + private final int step; + private final int iterations; + + private Range(int start, int step, int iterations) { + this.start = start; + this.step = step; + this.iterations = iterations; + } + + /** + * Parses start, step and iterations from args + * @param args the string array containing the arguments + * @param start which element to start the start argument from + * @return the constructed range + */ + public static Range parse(String[] args, int start) { + if (args.length < start + 3) { + throw new IllegalArgumentException("Too few elements in array"); + } + return new Range(parseInt(args[start]), parseInt(args[start + 1]), parseInt(args[start + 2])); + } + + public int get(int iteration) { + return start + (step * iteration); + } + + public int getIterations() { + return iterations; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append(start).append(" ").append(step).append(" ").append(iterations); + return builder.toString(); + } + } + + /** + * Wraps the different parameters that is used when running the MergeExample. + * {@code sizes} represents the different array sizes + * {@code parallelism} represents the different parallelism levels + */ + private static class Configuration { + private final Range sizes; + private final Range parallelism; + + private final static Configuration defaultConfig = new Configuration(new Range(20000, 20000, 10), + new Range(2, 2, 10)); + + private Configuration(Range sizes, Range parallelism) { + this.sizes = sizes; + this.parallelism = parallelism; + } + + /** + * Parses the arguments and attempts to create a configuration containing the + * parameters for creating the array sizes and parallelism sizes + * @param args the input arguments + * @return the configuration + */ + public static Configuration parse(String[] args) { + if (args.length == 0) { + return defaultConfig; + } else { + try { + if (args.length == 6) { + return new Configuration(Range.parse(args, 0), Range.parse(args, 3)); + } + } catch (NumberFormatException e) { + System.err.println("MergeExample: error: Argument was not a number."); + } + System.err.println("MergeExample " + + " "); + System.err.println("example: MergeExample 20000 10000 3 1 1 4"); + System.err.println("example: will run with arrays of sizes 20000, 30000, 40000" + + " and parallelism: 1, 2, 3, 4"); + return null; + } + } + + /** + * Creates an array for reporting the test result time in + * @return an array containing {@code sizes.iterations * parallelism.iterations} elements + */ + private long[][] createTimesArray() { + return new long[sizes.getIterations()][parallelism.getIterations()]; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(""); + if (this == defaultConfig) { + builder.append("Default configuration. "); + } + builder.append("Running with parameters: "); + builder.append(sizes); + builder.append(" "); + builder.append(parallelism); + return builder.toString(); + } + } + + /** + * Generates an array of {@code elements} random elements + * @param elements the number of elements requested in the array + * @return an array of {@code elements} random elements + */ + private int[] generateArray(int elements) { + int[] array = new int[elements]; + for (int i = 0; i < elements; ++i) { + array[i] = random.nextInt(); + } + return array; + } + + /** + * Runs the test + * @param config contains the settings for the test + */ + private void run(Configuration config) { + Range sizes = config.sizes; + Range parallelism = config.parallelism; + + // Run a couple of sorts to make the JIT compile / optimize the code + // which should produce somewhat more fair times + warmup(); + + long[][] times = config.createTimesArray(); + + for (int size = 0; size < sizes.getIterations(); size++) { + runForSize(parallelism, sizes.get(size), times, size); + } + + printResults(sizes, parallelism, times); + } + + /** + * Prints the results as a table + * @param sizes the different sizes of the arrays + * @param parallelism the different parallelism levels used + * @param times the median times for the different sizes / parallelism + */ + private void printResults(Range sizes, Range parallelism, long[][] times) { + System.out.println("Time in milliseconds. Y-axis: number of elements. X-axis parallelism used."); + long[] sums = new long[times[0].length]; + System.out.format("%8s ", ""); + for (int i = 0; i < times[0].length; i++) { + System.out.format("%4d ", parallelism.get(i)); + } + System.out.println(""); + for (int size = 0; size < sizes.getIterations(); size++) { + System.out.format("%8d: ", sizes.get(size)); + for (int i = 0; i < times[size].length; i++) { + sums[i] += times[size][i]; + System.out.format("%4d ", times[size][i]); + } + System.out.println(""); + } + System.out.format("%8s: ", "Total"); + for (long sum : sums) { + System.out.format("%4d ", sum); + } + System.out.println(""); + } + + private void runForSize(Range parallelism, int elements, long[][] times, int size) { + for (int step = 0; step < parallelism.getIterations(); step++) { + long time = runForParallelism(ITERATIONS, elements, parallelism.get(step)); + times[size][step] = time; + } + } + + /** + * Runs iterations number of test sorts of a random array of element length + * @param iterations number of iterations + * @param elements number of elements in the random array + * @param parallelism parallelism for the ForkJoin framework + * @return the median time of runs + */ + private long runForParallelism(int iterations, int elements, int parallelism) { + MergeSort mergeSort = new MergeSort(parallelism); + long[] times = new long[iterations]; + + for (int i = 0; i < iterations; i++) { + // Suggest the VM to run a garbage collection to reduce the risk of getting one + // while running the test run + System.gc(); + long start = System.currentTimeMillis(); + mergeSort.sort(generateArray(elements)); + times[i] = System.currentTimeMillis() - start; + } + + return medianValue(times); + } + + /** + * Calculates the median value of the array + * @param times array of times + * @return the median value + */ + private long medianValue(long[] times) { + if (times.length == 0) { + throw new IllegalArgumentException("Empty array"); + } + // Make a copy of times to avoid having side effects on the parameter value + Arrays.sort(times.clone()); + long median = times[times.length / 2]; + if (times.length > 1 && times.length % 2 != 0) { + median = (median + times[times.length / 2 + 1]) / 2; + } + return median; + } + + /** + * Generates 1000 arrays of 1000 elements and sorts them as a warmup + */ + private void warmup() { + MergeSort mergeSort = new MergeSort(Runtime.getRuntime().availableProcessors()); + for (int i = 0; i < 1000; i++) { + mergeSort.sort(generateArray(1000)); + } + } + + public static void main(String[] args) { + Configuration configuration = Configuration.parse(args); + if (configuration == null) { + System.exit(1); + } + System.out.println(configuration); + new MergeDemo().run(configuration); + } +} diff --git a/runtime/sample/forkjoin/mergesort/MergeSort.java b/runtime/sample/forkjoin/mergesort/MergeSort.java new file mode 100644 index 0000000..0ae48dc --- /dev/null +++ b/runtime/sample/forkjoin/mergesort/MergeSort.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.util.Arrays; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.ForkJoinTask; +import java.util.concurrent.RecursiveAction; + +/** + * A class for sorting an array of {@code ints} in parallel. + * A {@code ForkJoinPool} is used for the parallelism, using the merge sort + * algorithm the array is split into halves and a new sub task is created + * for each part. Each sub task is dispatched to the {@code ForkJoinPool} + * which will schedule the task to a {@code Thread}. + * This happens until the size of the array is at most 2 + * elements long. At this point the array is sorted using a simple compare + * and possibly a swap. The tasks then finish by using insert sort to + * merge the two just sorted arrays. + * + * The idea of this class is to demonstrate the usage of RecursiveAction not + * to implement the best possible parallel merge sort. This version creates + * a small array for each merge (creating a lot of objects), this could + * be avoided by keeping a single array. + */ +public class MergeSort { + private final ForkJoinPool pool; + + private static class MergeSortTask extends RecursiveAction { + private final int[] array; + private final int low; + private final int high; + private static final int THRESHOLD = 8; + + /** + * Creates a {@code MergeSortTask} containing the array and the bounds of the array + * + * @param array the array to sort + * @param low the lower element to start sorting at + * @param high the non-inclusive high element to sort to + */ + protected MergeSortTask(int[] array, int low, int high) { + this.array = array; + this.low = low; + this.high = high; + } + + @Override + protected void compute() { + if (high - low <= THRESHOLD) { + Arrays.sort(array, low, high); + } else { + int middle = low + ((high - low) >> 1); + // Execute the sub tasks and wait for them to finish + invokeAll(new MergeSortTask(array, low, middle), new MergeSortTask(array, middle, high)); + // Then merge the results + merge(middle); + } + } + + /** + * Merges the two sorted arrays this.low, middle - 1 and middle, this.high - 1 + * @param middle the index in the array where the second sorted list begins + */ + private void merge(int middle) { + if (array[middle - 1] < array[middle]) { + return; // the arrays are already correctly sorted, so we can skip the merge + } + int[] copy = new int[high - low]; + System.arraycopy(array, low, copy, 0, copy.length); + int copyLow = 0; + int copyHigh = high - low; + int copyMiddle = middle - low; + + for (int i = low, p = copyLow, q = copyMiddle; i < high; i++) { + if (q >= copyHigh || (p < copyMiddle && copy[p] < copy[q]) ) { + array[i] = copy[p++]; + } else { + array[i] = copy[q++]; + } + } + } + } + + /** + * Creates a {@code MergeSort} containing a ForkJoinPool with the indicated parallelism level + * @param parallelism the parallelism level used + */ + public MergeSort(int parallelism) { + pool = new ForkJoinPool(parallelism); + } + + /** + * Sorts all the elements of the given array using the ForkJoin framework + * @param array the array to sort + */ + public void sort(int[] array) { + ForkJoinTask job = pool.submit(new MergeSortTask(array, 0, array.length)); + job.join(); + } +} diff --git a/runtime/sample/jmx/jmx-scandir/build.properties b/runtime/sample/jmx/jmx-scandir/build.properties new file mode 100644 index 0000000..cad4a6a --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/build.properties @@ -0,0 +1,58 @@ +# IMPORTANT NOTE +# +# If you made a private copy of this project you may have to update the +# nbjdk.home variable at the end of this file. +# +# To be able to run the test-suite, you will also have to set the +# variable: +# +# libs.junit.classpath= +# + +main.dir=. + +src.dir=${main.dir}/src +test.src.dir=${main.dir}/test + +build.dir=build +classes.dir=${build.dir}/classes + +dist.dir=dist +jar=${dist.dir}/jmx-scandir.jar +javadoc.dir=${dist.dir}/javadoc + +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results + +build.sysclasspath=ignore +# E.g.: cp=lib/x.jar:lib/y.jar +cp= +extra.run.cp= + +# To be able to run the test-suite, set the following property: +# libs.junit.classpath=... + +javac.test.classpath=\ + ${classes.dir}:\ + ${libs.junit.classpath} + +main.agent.class=com.sun.jmx.examples.scandir.ScanDirAgent +main.client.class=com.sun.jmx.examples.scandir.ScanDirClient +main.class=${main.client.class} + +run.jvmargs=-Djava.util.logging.config.file=logging.properties +common.jvmargs=${run.jvmargs} -Djavax.net.ssl.keyStore=keystore -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=trustword +client.jvmargs=${common.jvmargs} +agent.jvmargs=${common.jvmargs} -Dcom.sun.management.config.file=src/etc/management.properties -Dscandir.config.file=src/etc/testconfig.xml + +client.args=localhost 4545 + +run.cp=${cp}:${classes.dir}:${extra.run.cp} +run.test.classpath=${run.cp}:${build.test.classes.dir} + +debug=true +deprecation=false + +# Update this variable if need be to point to the JDK 6 location. +# +nbjdk.home=${basedir}/../../.. diff --git a/runtime/sample/jmx/jmx-scandir/build.xml b/runtime/sample/jmx/jmx-scandir/build.xml new file mode 100644 index 0000000..e54fcec --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/build.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set property 'main.client.class' (e.g. in build.properties) + + + + + + + + + Must set property 'main.agent.class' (e.g. in build.properties) + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set libs.junit.classpath variable to the JUnit classpath in the build.properties file. + + + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + Must select some files in the IDE or set test.includes + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-ant-run.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-ant-run.jpg new file mode 100644 index 0000000..6a58f0e Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-ant-run.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-java-jar.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-java-jar.jpg new file mode 100644 index 0000000..86add09 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local-java-jar.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/connect-local.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local.jpg new file mode 100644 index 0000000..0259e96 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/connect-local.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection-failed.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection-failed.jpg new file mode 100644 index 0000000..001b0fa Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection-failed.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection.jpg new file mode 100644 index 0000000..90d07a0 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/remote-connection.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/scandir-config.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-config.jpg new file mode 100644 index 0000000..9e0a10c Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-config.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/scandir-result.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-result.jpg new file mode 100644 index 0000000..75e7baf Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-result.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/docfiles/scandir-start.jpg b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-start.jpg new file mode 100644 index 0000000..5bceae5 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/docfiles/scandir-start.jpg differ diff --git a/runtime/sample/jmx/jmx-scandir/index.html b/runtime/sample/jmx/jmx-scandir/index.html new file mode 100644 index 0000000..4fd2ae6 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/index.html @@ -0,0 +1,2217 @@ + + + + + + + JMX(TM) "scandir" Example + + + +

JavaTM Management Extensions (JMXTM) scandir Example

+ +

Introduction

+ +

Generating the Java Documentation

+ +
    +

    Before reading further, you will need to generate the + Java Documentation for the example's sources.

    +

    In the example root directory (where the build.xml + file is located) run the following command: +

    ant javadoc
    +

    +

    Alternatively you can open the jmx-scandir project with the + NetBeans IDE and generate the Javadoc from its Build + menu. +

    +

    If building the documentation fails, please make sure to read the + note at the beginning of this document.

    +
+ +

Overview of the scandir Example

+ +
    +

    The JMX scandir example is built around the + following MBeans:

    +
      +
    • The first MBean we will present here is the + DirectoryScannerMXBean.
      A + DirectoryScannerMXBean is an MBean that scans a + file system starting at a given root directory, and then looks + for files that match the given criteria. When such a file is + found, the DirectoryScannerMXBean takes the + action for which it was configured: emit a notification, + and/or log a record for this file, + and/or delete that file. The code that would actually + delete the file is commented out - so that nothing valuable is + lost if the example is run by mistake on the wrong set of + directories.
      DirectoryScannerMXBeans are + created by the ScanManagerMXBean - see next item on the list, from its + configuration. +
    • +
    • + The ScanManagerMXBean is the actual entry point of the + application. It reads the application's + configuration, and from that configuration, + will create a ResultLogManager and some DirectoryScannerMXBeans. +
      The ScanManagerMXBean lets you start, stop, and + schedule directory scans. The + ScanManagerMXBean is a singleton + MBean: there can be at most one instance of such + an MBean registered in a given MBeanServer. +
    • +
    • The ScanDirConfigMXBean is an MBean which is able to + load/save the configuration to/from an XML file. It + will also let you modify that configuration - by e.g. + creating new directory scanners in there. + The corresponding MBeans will be created later, only + when you later + ask the ScanManagerMXBean to apply the + configuration again.
      + The ScanDirConfigMXBean is created by the + ScanManagerMXBean, when the + ScanManagerMXBean is registered. + It is also possible to create an alternate + ScanDirConfigMXBean, and to switch the + ScanDirConfigMXBean to use one or the other + configuration. +
      An example of XML configuration file is given + here. Although you could edit such a file by + hand, it is easier to do it programmatically (or + with JConsole) through + the ScanDirConfigMXBean interface. +
    • +
    • The ResultLogManagerMXBean is in charge of managing result logs. +
      Directory Scanners can be configured to log a + ResultRecord whenever they take action upon a file that + matches their criteria. The ResultLogManagerMXBean is + responsible for logging these result records. + The ResultLogManagerMXBean can be configured to log + such records to a flat file, or into a log held in memory, or + both. Both logs (file and memory) can be configured with a + maximum capacity. +
      When the maximum capacity of the memory + log is reached, its first entry (i.e. its oldest entry) is + removed to make place for the latest one. +
      When the maximum + capacity of the file log is reached, the file is + renamed by appending a tilde '~' to its name and a + new result log is created. +
      The ResultLogManagerMXBean + will let you interactively clear these result logs, change their + capacity, and decide where (memory or file) to log. + The memory log is useful in that its content can be interactively + returned by the ResultLogManagerMXBean, while + the file log doesn't have this facility.
      + The result logs are intended to be used by e.g. an offline + program that would take some actions on the files that + matched the scan criteria: +
      The scandir application + could be configured to only produce logs (i.e. takes no + action but logging the matching files), and the real + action could be performed by another program or module (e.g. mail the result log to the engineer who + maintains the lab, or parse that log and delete all the + files listed there, or parse the log and prepare and send + a single mail to each owner of matching files, containing + the list of files they should consider deleting).
      + The ResultLogManagerMXBean is a singleton + MBean created by the ScanManagerMXBean + which reads and writes its configuration from the + ScanDirConfigMXBean. +
    • +
    +

    An application main() method is + provided in the ScanDirAgent class. The main() simply registers + a ScanManagerMXBean in the platform MBeanServer, and + then waits for someone to call close() on the + ScanManagerMXBean. +

    +

    When the ScanManagerMXBean is registered, it + will create a default ScanDirConfigMXBean bound + to a default XML config file. +

    +

    The application's default XML config file is determined as + follows: +

      +
    1. If the property scandir.config.file is + defined, the default application file will be the + file pointed to by this property. If that file + doesn't exist, it will be created when + ScanDirConfigMXBean.save() is + invoked. +
    2. +
    3. Otherwise the application config file is + assumed to be a file called jmx-scandir.xml, + located in the user's directory (as defined by + the System property user.home). + If that file doesn't exists, it will be created when + ScanDirConfigMXBean.save() is + invoked. +
    4. +
    +

    It is worth noting that this project is defined to + run with the following properties: +

    -Djava.util.logging.config.file=logging.properties
    +
    -Dscandir.config.file=src/etc/testconfig.xml
    + With ScanDirAgent defined as the project's + main class. Hence when you invoke from the NetBeans IDE + Run Project on the jmx-scandir project, + or Run file on the ScanDirAgent, the + application starts with the test configuration provided in + src/etc/testconfig.xml +

    +
+

API Documentation and Sources

+
    +

    Once generated, the Javadoc of example classes can + be found starting from dist/javadoc/index.html.

    +

    You can view the sources in the src subdirectory.

    +
+

Patterns, Best Practices, and Common Pitfalls

+
    +

    This section discusses some common patterns and + design choices that this example demonstrates, and some pitfalls that + it avoids. +

+

MBeans or MXBeans?

+
    +

    What is an MXBean? MXBeans made their appearance in + J2SE 5.0 (Tiger), with the Management and Monitoring + API of the JVM. However, Java SE 6 is the first + Java SE release that contains a standard framework which + makes it possible to create and register your own MXBeans. +

    +

    MXBeans are a special kind of MBean, which once registered + in the MBeanServer, get automatically transformed into + OpenMBeans. From a developer point of view, nothing changes: + A Wombat MBean can become an MXBean simply by renaming + its WombatMBean interface into WombatMXBean.

    +

    Using MXBeans rather than plain Standard MBean brings its + own advantages:

    +
      +
    • + Generic tools, like JConsole, will be able to + display and interact with your MXBeans nicely, even + if your MXBean interfaces reference custom types + - e.g. custom Java enums. This is because all the types + exposed by your MXBeans are converted to Open Types. + Just look at the ScanDirConfigMXBean with JConsole and you will + understand the benefits. +
    • +
    • + When writing a programmatic client, you can obtain + a proxy that implements the original MXBean interface, + and forget about the Open Type conversion. + The JUnit unit tests that come with this example + use this feature very widely. Have a look at them. +
    • +
    • + The MXBean framework also lets you nicely navigate + from one MXBean to another: your MXBeans can + have attributes and parameters which are proxies + to other MXBeans! We demonstrate this in the + ScanManagerMXBean which exposes a list + of DirectoryScannerMXBean and points + towards a ScanDirConfigMXBean. +
    • +
    +

    In short, MXBeans are so much easier to use that + this example doesn't even have a single regular + Standard MBean. +

    +

    See also What is an MXBean? + and Inter-MXBean References. +

    +
    Hint: In order to simplify the task of coding a + JMX programmatic client, we recommend that getters, setters, and + operations defined in MBean and MXBean interfaces throw + IOException. Proxy objects will then be able + to rethrow directly any IOException received from + their underlying MBean Server connection, without wrapping + them into UndeclaredThrowableExceptions.
    + Since the life cycle of the proxy object is not directly tied to + the life cycle of the MBean it proxies, you may also want to + have all methods in the MBean or MXBean interface throw + InstanceNotFoundException or more generally + JMException. +
    +
+

MBean Names - aka ObjectNames

+
    +

    As you must know if you've been studying JMX, MBeans are + named objects. The names of MBeans are represented by + instances of ObjectName. An ObjectName is + composed of a domain, followed by a colon ':', + followed by a comma-separated list of key=value + pairs.
    + The ordering of the key=value pairs is not + important, but ObjectNames are case sensitive + (both keys and values are case sensitive) and white space + is not ignored.
    + A common pitfall for JMX beginners is to inadvertently + insert white space after commas into an ObjectName, + and expect that two ObjectNames which differ only by such white + space will be considered identical. This is not the + case.
    + As an example, the ObjectName 'D:k1=v1, k2=v2, k3=v3' has + three keys, which are 'k1', ' k2', + and ' k3': beware + of the space in the name of the second and third + keys!
    + It is therefore a different ObjectName from + 'D:k1=v1,k2=v2,k3=v3' (the keys are now + 'k1', 'k2', and + 'k3'), but the same ObjectName as + 'D: k2=v2, k3=v3,k1=v1', and yet different + from 'D:k2=v2, k3=v3, k1=v1'! +

    In this example, we are following the rules + for ObjectName suggested in the JMX Best Practices:

    +
      +
    • ObjectNames should be predictable +
    • +
    • The domain part of our ObjectNames starts with a Java + package name +
    • +
    • Our ObjectNames contain a type= + key property. This property is different for every + object type in our domain. +
    • +
    • For every ObjectName with a given type, we have the same set of key + properties with the same syntax and semantics for their values - in + fact we only use an additional name= key. +
    • +
    • When there can only be one instance of a given type + there aren't any other key properties than type=. + The ObjectNames of the ScanManagerMXBean and ResultLogManagerMXBean, which are both singleton MBeans, are + composed in this way. +
    • +
    • When there can be several instances of a given type, + we differentiate them by further key properties. + To achieve this, we are using the most usual key property + in addition to type=: the name= key. + In this example, a key property list of the form + type=X,name=Y is always enough to uniquely name + an MBean. Tools like jconsole are usually aware + of the semantics of the type= key and + name= key, and are therefore able to + display this form of name in a way that + is easier to read than other name forms. +
    • +
    +

    The rules listed above are implemented by a couple + of static helper functions in the ScanManager class. See the code of the + makeSingletonName and + makeMBeanName methods. +

    +
+

Inter MBean Navigation

+
    +

    One of the most common problems that needs to be solved + when designing a management interface with JMX is to + choose a representation for inter-MBean relationships.
    + Prior to Java 6, there were basically three possible + choices:

    +
      +
    • Make the relation appear in the ObjectName. + For instance, if MBean B was contained in + MBean A, you could choose to name MBean B so + that its parent relationship with MBean A + appeared in its name.
      + The obvious limitation of this solution is that + it only allows to model one such relation (an + MBean has only one name) and the relation must + be fixed - it cannot change during the life of + the MBean since the name of an MBean cannot + change.
      + This scheme is therefore mostly used when + the application MBeans are modeling objects + which are conceptually contained within + each other in a tree-like structure. +
      For instance, most MBean names defined by + J2EE Management (JSR 77) follow + this scheme. +
    • +
    • Design getters and setters (or operations) which + return ObjectName or + ObjectName[] values. The ObjectNames + point to the MBeans which are related to that + object. For instance , GlassFish + defines MBeans which also use this pattern. +
    • +
    • Use the JMX RelationService. The JMX RelationService + is quite powerful, but simple relationships often + do not justify that overhead. +
    • +
    +

    In Java 6, these three possibilities still remain, but + the new MXBean framework brings up an interesting + alternative. Instead of returning an ObjectName or + an ObjectName array, an MXBean can return a proxy + to its related MXBeans. This is how we have chosen to + implement our inter MBean relationships in this + example: +
    For instance the + ScanManagerMXBean/DirectoryScannerMXBean + relationship and the + ScanManagerMXBean/ScanDirConfigMXBean + relationships are implemented in this way. +

    + The additional benefit, as compared to returning ObjectNames or + using the RelationService is that interface type of the MBeans + which are pointed to by the relationship becomes directly + apparent. The method: +

    +            public Map<String,DirectoryScannerMXBean> getDirectoryScanners();
    +        
    + makes it immediately obvious that the MBeans to which we point are + DirectoryScannerMXBeans. It would have been much less obvious in prior + versions of Java SE, were the returned type would have had to be + Map<String,ObjectName>, or + even worse just Map. +

    +

    However, it must be clear that the behaviour will be + quite different when an MXBean is returned as compared + to when a simple bean is returned. +

    +

    When an MXBean is returned, the remote client sees either + an ObjectName, if it is a generic client like jconsole, or + a proxy to a remote MXBean, if the client is working with the + MXBean interface. Invoking an operation on one of the + proxy returned by a method such as + getDirectoryScanners will cause the + MBean to be invoked on the remote server side. +

    +

    If getDirectoryScanners were + defined as: +

    +            public Map<String,DirectoryScannerConfig> getDirectoryScanners();
    +        
    + then invoking a method on one of the returned objects + would have absolutely no effect on the remote + server side - because the returned objects in this + case would simply be a bunch of serialized data objects. +

    +

    It is worth noting that although an MXBean interface + can have getters and operations which return an MXBean + interface, a regular standard MBean shouldn't have + any getters or methods which return MBean interfaces or + MXBean interfaces. +

    +

    For more information see also Inter-MXBean References. +

    +
+

The MBeanRegistration interface, or how an MBean can + know or provide its own name

+
    +

    + Sometimes, an MBean needs to have a reference to the + MBeanServer in which it is registered, or needs to know + with which ObjectName it has been registered. +

    +

    + Sometimes also, an MBean may need to perform some + checks before being registered, or will need + to carry out some actions right after it has been + successfully registered in the MBeanServer. +

    +

    + Sometimes again, an MBean may need to perform some + checks, or some cleaning actions, just before, or + just after, it is unregistered. +

    +

    + When an MBean has such needs, the easiest solution + for it is to implement the MBeanRegistration + interface. +

    +

    The MBeanRegistration interface is a callback + interface which defines pre and post registration and + unregistration callbacks. +

    +

    + When an MBean implementing this interface is created + (with createMBean) or registered + (with registerMBean) in an MBeanServer, + the MBeanServer will call the preRegister + and postRegister method implemented by + the MBean. The preRegister method + has an MBeanServer and ObjectName + parameter, which are passed by the MBeanServer to the + MBean. The MBean can store the reference it is being passed + in a private instance variable for later use. +

    +

    + Most of the MXBeans we have defined in this example + implement the MBeanRegistration interface. The table + below show how our MBeans use this interface to control + their own names, make sanity checks, perform + initialization steps or cleanup actions. +

    +


    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    MBean Requirementcallbackuse case example
    get a reference to the MBeanServerpreRegisterThe ScanManagerMXBean needs a reference + to the MBeanServer in order to create and + register other MBeans, such as the + ResultLogManagerMXBean, and the + DirectoryScannerMXBeans. +
    reject registration if conditions are + not met. + preRegisterThe ScanManagerMXBean will throw + an IllegalArgumentException in preRegister + if the ObjectName it is being passed is + illegal. Throwing an exception in + preRegister makes the registration fail. +
    get my client-assigned MBean namepreRegisterThe ScanDirConfigMXBean propagates the + value of the name= property of + the ObjectName it is given into its + ScanManagerConfig bean. +
    provide my own default ObjectName if none + was given to the MBeanServer + preRegisterThe name that is returned by preRegister + is the ObjectName with which the MBean will be + eventually registered. + The ScanDirConfigMXBean is able to suggest + a value for its own ObjectName if none was + provided. Similarly, the ScanManagerMXBean + always returns its singleton ObjectName + defined by ScanManagerMXBean.SCAN_MANAGER_NAME. +
    perform initialization stepspreRegisterThe ScanDirConfigMXBean uses preRegister + to initialize its internal ScanManagerConfig bean. +
    perform initialization steps, once it is + known that the registration was successful. + postRegisterThe postRegister method + can be used to implement + initialization steps that need to be done once it + is known that the registration was successful, or to + undo any action performed by preRegister once it + is known that registration was not successful. + The postRegister method has a Boolean parameter + which tells the MBean whether it was or wasn't + successfully registered in the MBeanServer. + The ScanManagerMXBean uses postRegister to create + and register other MBeans, such as the + ResultLogManagerMXBean and the default + ScanDirConfigMXBean. + Note that postRegister is not expected to throw any + exception. If an exception needs to be thrown, it should + be thrown in preRegister. +
    check whether the MBean can be deregisteredpreDeregisterThe ScanManagerMXBean uses this method to verify + that its state allows it to be deregistered. + In particular, it will refuse to be deregistered + if it is in the RUNNING or SCHEDULED state. + If preDeregister throws an exception, the unregisterMBean + call will fail and the MBean will remain registered in + the MBeanServer. + Take particular care when implementing business logic + in this method: if the logic you implement has an + unfortunate bug which makes it always throw an + exception, you will never be able to unregister + that MBean. +
    clean up resources, refusing to be deregistered if + it fails + preDeregisterThe ScanManagerMXBean uses this method to unregister + all the other MBeans it has created and registered in the + MBeanServer. This includes the ResultLogManagerMXBean, the + ScanDirConfigMXBeans it has created, and the + DirectoryScannerMXBeans it has created when + applying its configuration. +
    clean up resources which need to be released in + a best-effort way, when it is known that the MBean is no + longer registered. + postDeregisterpostDeregister is only called if the MBean was succesfully + unregistered. + The ScanManagerMXBean uses this method to cancel + its internal java.util.Timer. +
    +

    +
+

The Singleton MBean Pattern

+
    +

    + A singleton MBean is an MBean which can only have one + instance registered in a given MBeanServer.
    + A singleton MBean usually has a well-known name, + which can be defined as a constant. In that case, + clients no longer need to call new ObjectName(...) + and catch the declared MalformedObjectNameException. +

    +

    There are already quite a few examples of singleton + MBeans in the java.lang.management API. The + ThreadingMXBean, ClassLoadingMXBean, RuntimeMXBean, etc. + are all singleton MBeans. +

    +

    In this example, we have two singleton MBeans: + The ScanManagerMXBean and the + ResultLogManagerMXBean. But in fact, + the only real singleton MBean is the + ScanManagerMXBean. The + ResultLogManagerMXBean just happens to + be a singleton MBean because it has a 1-1 relationship + with the ScanManagerMXBean. +

    +

    The ScanManagerMXBean implements the + singleton MBean pattern in this way: +

    +
      +
    • The ScanManagerMXBean name has a single + key property: type=ScanManagerMXBean.
    • +
    • Its name is defined by an ObjectName constant called + SCAN_MANAGER_NAME in the ScanManager class
    • +
    • The ScanManagerMXBean enforces its status of + singleton MBean. It will refuse to be registered + with a name other than + the SCAN_MANAGER_NAME. You can therefore depend on + the fact that the ScanManagerMXBean will always + be registered with its singleton SCAN_MANAGER_NAME + (see preRegister) +
    • +
    • You are not obliged to provide a name when you + register the ScanManagerMXBean: if you pass null, + then the ScanManager will be registered with + its singleton SCAN_MANAGER_NAME + (see preRegister). +
    • +
    • The ScanManager class has a no-arg static + register method that will register + the singleton instance in the Platform MBeanServer. + This static register method returns + a proxy to the registered singleton. +
    • +
    • The ScanManager class has also a static + register method that will create + a singleton instance in a (possibly remote) + MBeanServerConnection - using + createMBean. + This static register method + also returns a proxy to the registered singleton. +
    • +
    • Only the MBeanServer has a reference to the + singleton instance. The singleton instance is + not returned to the caller, and not kept + in any other static data structure. +
    • +
    +

    + On the other hand, the ResultLogManagerMXBean + has a much more relaxed implementation of the pattern: +
    It simply provides its own singleton name if it is + registered with a null ObjectName, but will not enforce + the use of that name. +

    +

    Note that all singleton MBean names in this example + are created using the ScanManager.makeSingletonName + method, which implements the pattern for ObjectNames suggested + in the JMX Best Practices. +

    +
+

Managing the Life Cycle of dependent MBeans

+
    +

    A common task that many JMX applications have + is to manage the life cycle of MBeans registered + in the MBeanServer.

    +

    In this example, we have decided to follow a simple + pattern:

    +
      +
    • The application is initialized simply + by registering the singleton + ScanManagerMXBean in + the MBeanServer. +
    • +
    • The ScanManagerMXBean will then + in turn register any other MBean that the + application might need: +
        +
      • It creates and registers the singleton + ResultLogManagerMXBean +
      • +
      • It creates and registers the default + ScanDirConfigMXBean + which loads the initial configuration +
      • +
      • It creates as many + DirectoryScannerMXBeans as + needed when the configuration is applied +
      • +
      • It lets you create alternate + ScanDirConfigMXBean, to + which you can later switch in order + to apply a new alternate configuration. +
      • +
      +
    • +
    • When a new configuration is applied (or if the + current configuration is reapplied), the + ScanManagerMXBean will unregister + any DirectoryScannerMXBeans it has + previously registered, and will re-create + brand new DirectoryScannerMXBeans + from the applied configuration. +
    • +
    • When you unregister the ScanManagerMXBean, + it does all the cleanup for you, by unregistering + all the MBeans that it has created during the + course of the application. +
    • +
    +

    The ScanManagerMXBean makes use of its + MBeanRegistration interface in order + to register the other MBeans it needs (see the + ScanManager.postRegister method) and to unregister + every MBean it has created (see the ScanManager.preDeregister + method). +

    +

    You will note that the ScanManagerMXBean + will only allow itself to be deregistered if it can be + closed - that is if there's no other action in + progress. + This is to make sure that the deregistration of + dependent MBeans will work smoothly. +
    + The deregistration of related MBeans will happen + in the ScanManager.preDeregister + method. +
    + If one of these MBeans could not be deregistered, + then the ScanManagerMXBean will throw + an exception, refusing to be deregistered. +
    This leaves you a chance to try to deregister it + again later. Since the ScanManagerMXBean + has switched its state to CLOSED before starting + to unregister its dependent MBeans, it will refuse + any further actions, ensuring that e.g. nobody + can try to start it or schedule it while it + is in that partially-deregistered state. +

    +

    Handling the LifeCycle of all the application's + MBeans in a single MBean is usually a good design + pattern, especially if the application is a + module which is intended to share a JVM - or + an MBeanServer - with other modules. +

    +

    This is specially useful if the application needs to + be loaded and unloaded on demand: in that + case, simply registering or unregistering the top level + MBean (in our example the ScanManagerMXBean) does + the trick. +

    +
+

Emitting Notifications

+
    +

    In order to emit notifications, an MBean must be + an instance of NotificationEmitter. + The NotificationEmitter interface defines methods + that the MBeanServer will call on the MBean in order + to register NotificationListeners with the MBean. +

    +

    It is worth noting that the MBean may not be + invoked each time a JMX client wants to register + a listener. For instance, the RMIConnectorServer + registers only once a single listener with each MBean + which is a NotificationEmitter. + In that specific case, the listener may even be registered + with the MBean before any client has actually subscribed + for notifications from that particular MBean. +

    +

    An MBean can therefore make no assumption about + which client or how many clients have registered for + notifications. +

    +

    It is also worth noting that the logic of the + methods defined in NotificationEmitter would not + be trivial to implement from scratch. Fortunately + the JMX API defines a helper class, called + NotificationBroadcasterSupport, which + provides an implementation for these methods. +

    +

    There are actually three ways for an MBean to + implement NotificationEmitter, of which only two + are recommended. +

    +
+ +

Extending NotificationBroadcasterSupport

+
    +

    This is the simplest way of coding an MBean which + is a NotificationEmitter: +

    +

    Simply extend NotificationBroadcasterSupport, + then override its getNotificationInfo method + which returns the MBeanNotificationInfo[] array + that should be included in your MBean's MBeanInfo + and that's it. +
    You just need to call the sendNotification method + inherited from NotificationBroadcasterSupport whenever + your MBean needs to send a notification. +

    +

    In our example, both the ScanDirConfigMXBean and ResultLogManagerMXBean extend + NotificationBroadcasterSupport in order + to send notifications. +

    +
+

The Delegation Pattern: delegating to a + NotificationBroadcasterSupport delegate

+
    +

    There may be cases however where delegating to a + wrapped NotificationBroadcasterSupport + object may be preferred to extending + NotificationBroadcasterSupport. +

    +

    For instance, if your MBeans already derive from + some base class, extending NotificationBroadcasterSupport + might not be an option. +

    +

    Similarly, if you do not want to have the inherited + public void sendNotification(Notification notification) + method appear in the Javadoc of the concrete class of your + MBean, you may want to consider using the delegation + pattern instead of extending + NotificationBroadcasterSupport +

    +

    In our example both the ScanManagerMXBean and the DirectoryScannerMXBean use the delegation + pattern rather than extending + NotificationBroadcasterSupport. + In the end, choosing between one or the other method + is more a question of taste, although the delegation + pattern could be considered more flexible since it + doesn't require extending any given superclass. +

    +

    It may be also worth noting that some tools like + the JMX Module of NetBeans IDE, will be able to + generate for you all the code that delegates to a + wrapped NotificationBroadcasterSupport. +

    +
+ +

Implementing NotificationEmitter from scratch

+
    +

    This is the last possibility for an MBean that + needs to send notifications: simply implement + NotificationEmitter from scratch. This is highly + discouraged since that logic is not trivial, and + already provided by + NotificationBroadcasterSupport anyway. +

    +
+ +

Beware of Synchronization Locks

+
    + +

    One thing you must keep in mind when sending + notifications is not to send them from within + a synchronized block, or while holding a lock on + some resource.

    +

    Indeed, what happens when you send a notification + may vary greatly depending on whether the client + which has registered for notifications has done + so through a JMXConnector (like the + JMXRMIConnector) + or through a direct reference to the MBeanServer + (by calling + MBeanServer.addNotificationListener). +

    +

    In this latter case, the listener will be invoked + synchronously in the same thread that your MBean is + using to send its notification. If by misfortune, the + code of that listener now re-enters your MBean through a + call that flows through a JMXConnector, a deadlock + could occur. It is therefore very important to release + any lock you may have before calling + sendNotification.

    +

    An easy way to do that is demonstrated in the + ScanManager class. The ScanManager + has an internal private queue of pending notifications. + When a notification needs to be sent (e.g. because the + ScanManager state is being switched), the notification + is simply prepared and put into the pending notification + queue. + The notification queue is then processed later on, + at the end of the method, when the processing is finally + completed and all the locks have been released. +
    At this point the notification queue might already + have been emptied by another thread - in which case + the pending notifications will have already been + removed from the queue. Which thread actually gets + to send the notifications is of no importance. The + important point is that all the locks detained by + your MBean code in that thread were released before + the notification was sent. +

    +

    In our example the ScanManager class + ensures this by: +

      +
    • Only calling sendNotification + in its private sendQueuedNotifications + method. +
    • +
    • Only calling sendQueuedNotifications + when all locks have been released. +
    • +
    • Never calling a method that calls + sendQueuedNotifications from within + a synchronized block.
    • +
    +

    +
+ + + +

Don't subclass Notification

+
    +

    Another common best practice when you want + to improve interoperability is to use directly + the Notification base classes provided in the + JMXTM API. Do not create your own + subclasses of these standard classes. +

    +

    Indeed, if you code your own subclass, a generic + client, like jconsole, will not be able to receive + that notification unless it has that custom + subclass in its classpath. +

    +

    + If you want your application to be interoperable, it is + therefore preferable not to subclass any of the standard + Notification classes. You can define your own + Notification type string, and if you need to send + additional data, you can put a CompositeData, or a + HashMap of serializable standard types in the + Notification's user data fields. +

    +

    In this example, we are using directly the + standard notification classes: +

      +
    • The ScanManagerMXBean and the DirectoryScannerMXBean both use directly + AttributeChangeNotification to notify + changes in their State attribute. +
    • +
    • The DirectoryScannerMXBean + also uses the base Notification + class directly in order to notify whenever + it finds a matching file. +
      In that case, we simply use the base + Notification + class with a new + com.sun.jmx.examples.scandir.filematch + type. +
    • +
    • The ScanDirConfigMXBean and ResultLogManagerMXBean also both use the base + Notification class. +
    • +
    +

    Careful readers will have noted that the ScanManagerMXBean and the DirectoryScannerMXBean both use the + AttributeChangeNotification class + to notify about their state change, whereas the + ScanDirConfigMXBean uses the base + Notification class. +

    +

    In fact, this is because the semantics of these + notifications is not exactly the same - although + both denote a state change: +

      +

      In the case of ScanManagerMXBean + and DirectoryScannerMXBean, the + notification which is emitted is more about a + state transition, from one state to another. + For instance, going from RUNNING + to STOPPED, or from + SCHEDULED to STOPPED. +
      In that case, the + AttributeChangeNotification was + more appropriate because it made it possible + to send the previous and the new value of the + state attribute, thus reflecting the whole + state transition. +

      +

      In the case of the ScanDirConfigMXBean + however, what is of interest is the state in + which the MBean has arrived. Using the base + Notification class with three different + notification type strings - + com.sun.jmx.examples.scandir.config.loaded, + com.sun.jmx.examples.scandir.config.modified, + and + com.sun.jmx.examples.scandir.config.saved - + was therefore closer to what we wanted to model. +

      +
    +

    +
+ +

Configuration MBeans

+
    +

    A common practice when designing a management application is + to have an MBean, or a set of MBeans, dedicated to configuration. + Separating configuration from control and monitoring allows + more appropriate logic, and often simplifies the design and + implementation of the management interface. +

    +

    + In our example, the ScanDirConfigMXBean is dedicated to the application configuration. +

    +

    The ScanDirConfigMXBean will let you interactively + modify, save, or load the application configuration. The modifications + will not be taken into account until it is applied, by invoking + applyConfiguration on the ScanManagerMXBean. + It is also possible to create many configurations, by creating as + many ScanDirConfigMXBeans, and then to choose and apply + one of these configurations by calling + ScanManagerMXBean.setConfigurationMBean and then + ScanManagerMXBean.applyConfiguration. +

    +

    In this way, all configurations aspects are gathered and concentrated + inside the ScanDirConfigMXBean instead of being scattered + throughout all the MBeans that compose the application. +

    +

    In order to save and store the application configuration data, the + ScanDirConfigMXBean uses a set of XML serializable Java beans + defined in the com.sun.jmx.examples.scandir.config package. These beans are very + simple Java beans which have been lightly annotated for XML binding. +

    +

    It is worth noting that these same beans can also be handled by the + MXBean framework (our beans don't contain recursive data structures) and can + therefore be used directly as attributes and parameters of MXBeans, without + needing to be Java-serializable (the MXBean framework transform them in + CompositeData objects - which are serializable). +

    +

    The same ScanManagerConfig bean that we use to read from and write to the + XML configuration file is thus also used as attribute of the ScanDirConfigMXBean. It is transformed into a CompositeData + by the MXBean framework, and can be easily introspected with + jconsole. +

    +
+

MBeans Must Be Thread-Safe

+
    +

    A question often asked by newcomers to JMX technology + is whether the MBeanServer is thread-safe. Well, the MBeanServer is + thread safe, but it doesn't put any locks on the MBeans it contains. The + MBeans can be concurrently accessed by multiple threads, and must therefore + take care of their own thread safety. +

    +

    In this example, we have been using two methods to ensure thread + safety for our MBeans: synchronized blocks, and semaphores. +

    +

    Using synchronized blocks is probably the most common and easiest way + to implement thread safety in Java. When dealing with MBeans though, here + are a couple of rules to keep in mind: +

      +
    • Don't send notifications from within a synchronized block: there's + no way to tell whether the listener's code will be executed in the + same thread or a different thread, and holding a lock in these + conditions is therefore dangerous, as it could lead to deadlocks.
    • +
    • Also avoid invoking another MBean from a synchronized block + unless you are completely in control of both MBeans, and you can + ascertain that it won't lead to any deadlock. Indeed, if you invoke an + MBean exposed by another application, it can be sometime hard to + know with certainty whether holding a lock while invoking that + MBean will have any side effect. Maybe that MBean will make + further calls to other MBeans which will in turn try to call + your MBean, or maybe it will emit a + notification, and we'll be back to the considerations just + above.
    • +
    +

    +

    Another means of implementing thread-safe code is to use semaphores. + The ScanManagerMXBean uses a semaphore called + sequencer to ensure + that critical code sections are not executed concurrently. In this + MBean, we use Semaphore.tryAcquire to lock the sequencer + semaphore before entering the critical section. If the + Semaphore.tryAcquire returns true then we enter the critical + section. If it returns false, we throw an IllegalStateException, stating + that we couldn't acquire the lock. The code looks like this: +

    +        if (!sequencer.tryAcquire())
    +            throw new IllegalStateException("resource locked");
    +        try {
    +            // critical code here ...
    +        } finally {
    +            // Always use try/finally to ensure that the semaphore
    +            // will be released, even if exceptions or errors are raised!
    +            sequencer.release();
    +        }
    +    
    +

    +

    Using Semaphore.tryAcquire and throwing an exception if + the semaphore is already locked makes it safer to call other MBeans + from within the critical section: in potential deadlock situations + the calling code will get the IllegalStateException + instead of being blocked on the deadlocked lock. +

    +

    It is worth noting that each of these techniques has its own + advantages and disadvantages - which can make one of them more or less + appropriate depending on the inner logic of the MBean you're implementing. +

    +

    Careful readers will also have noted that we used + IllegalStateException directly, instead of defining + our own subclass of RuntimeException, which could have had a more + precise semantics. If you define a new exception for your JMX application, + you must keep in mind that your client will need to have the class + of your exception in its classpath to get that exception. + Otherwise your client will get a completely different exception, indicating a + deserialization issue. +

    +
+ +

Waiting for Notifications

+
    +

    Implementing code that needs to wait for notifications is sometimes + difficult. Because notifications are asynchronous, doing something + like: +

    +          // register a notification listener
    +          ...
    +          // start a management action
    +          ...
    +          // wait for a notification
    +          ...
    +          // do something based on whether the expected notification
    +          // is received
    +          ...
    +        
    + is not always trivial. However, there's a very easy way to do that: use + a blocking queue of notifications. +
    +       final BlockingQueue<Notification> notifQueue = 
    +                new LinkedBlockingQueue<Notification>();
    +                
    +       final NotificationListener listener = new NotificationListener() {
    +            public void handleNotification(Notification notification,
    +                                           Object handback) {
    +                try {
    +                    // Just put the received notification in the queue.
    +                    // It will be consumed later on.
    +                    //
    +                    notifQueue.put(notification);
    +                } catch (InterruptedException ex) {
    +                    // OK
    +                }
    +            }
    +          };
    +
    +       // register the listener - possibly also as a JMXConnectionNotification
    +       // listener to get Notification Lost notification
    +       ...
    +       // start management action
    +       ...
    +       // wait for notification
    +       while (expected notif not received and delay not expired) {
    +            Notification n = notifQueue.poll(3,TimeUnit.SECONDS);
    +            // if expected notif, do something
    +            ...
    +       }
    +       // if expected notification not received do something else.
    +       ....
    +       
    +

    +

    You will note that this is a technique we've been using in the ScanDirAgent class and in the example unit tests. +

    +
+ +

Holding hard references to other MBeans: proxy or direct reference?

+
    +

    We have seen that MXBeans will let you return proxy references to other + MXBeans. But should that MXBean hold a direct reference to the MXBeans it + relates to, or would it be better for it to hold only a proxy? +

    +

    + As a general rule it is better when an MBean reference is + only held by the MBeanServer. It is a better design + to hold a reference to a proxy, rather than to hold + a hard reference to an MBean. However there are two cases + when holding a hard reference might be preferred: +

      +
    1. When MBean A needs to call a method of method B which + is not part of its MBean interface
    2. +
    3. When the overhead of going through the MBeanServer + plus the MXBean framework is too great (frequently-called + method, with creation of OpenType)
    4. +
    + However - holding a hard reference is only advisable + when both MBeans are created by the same piece of code, + and the application can ensure that the life cycle + of each MBean is consistent with regard to the other. +

    +

    In our example, the ScanManagerMXBean holds only proxy references to the ScanDirConfigMXBean and the DirectoryScannerMXBeans.
    + However it holds a direct reference to the ResultLogManager. This makes it possible to pass a direct + reference to the DirectoryScannerMXBeans, + which can then log their results + more efficiently, and would also make it possible to remove + the log method from the ResultLogManagerMXBean interface - leaving it in the + ResultLogManager class (possibly as a package method) + should we wish to do so. +

    + +
+ +

Agent Class

+
    +

    The ScanDirAgent is the Agent class for the scandir application. + This class contains the main method to start a standalone + scandir application. +

    +

    The main method simply registers a ScanManagerMXBean in the platform MBeanServer, and then waits + for someone to call ScanManagerMXBean.close. +

    +

    + When the ScanManagerMXBean state is switched to + ScanManagerMXBean.ScanState.CLOSED, the + ScanManagerMXBean is unregistered, and the application + terminates (i.e. the main thread completes). +

    +

    Standalone JMX applications usually have an Agent class that contain + their main method, which performs all the MBean + registration steps. + However, it is usually not a bad idea if that class can + be easily turned into an MBean. Indeed, this will make your + application easier to integrate in an environment where it would + no longer be standalone and would no longer control the implementation + of main. In our example the Agent + class could be easily turned into an MBean, exposing its three + init, waitForClose and cleanup + method. However we didn't go as far as turning it into an MBean since + the application can be already easily started by registering an instance + of ScanManagerMXBean. +

    +
+

Secure Client Class

+
    +

    The ScanDirClient is an example class that shows how a + programmatic client can connect to a secured scandir application. + This class contains a main method which creates and + configures a JMXConnector client to connect with + a secured scandir daemon. This class will not work with + the default unsecured agent since it requires mutual authentication. +

    +

    How to secure a JMX scandir application and run + the secure ScanDirClient is discussed later in this document. +

    +

    The ScanDirClient is not really part of the + application - and is given here only for the sake of + the example. +

    +
+ +

Testing the scandir Example

+
    +

    Make sure that you have access to junit.jar (either 3.8.1 or 3.8.2). + Make sure also that you have junit.jar in your + CLASSPATH.
    + Then in the example root directory (where the build.xml + file is located) run the following command: +

    ant test -Dlibs.junit.classpath=path to junit jar (either 3.8.1 or 3.8.2)
    +

    +

    Alternatively you can open the jmx-scandir project with the + NetBeans IDE and test the jmx-scandir project from the + Run menu. +

    + +
+ +

Running the scandir Example

+
    +

    In the example root directory (where the build.xml + file is located) run the following commands: +

    ant jar
    +ant run-single -Drun.class=com.sun.jmx.examples.scandir.ScanDirAgent -Djavac.includes=src
    + or simply
    ant run
    +

    + +

    This will run the example using the configuration + file provided in the src/etc directory. +

    +

    Alternatively you can open the jmx-scandir project with the + NetBeans IDE. You can run the example by + selecting the ScanDirAgent file + and run it with Run File in the + Run menu or simply + set the jmx-scandir project as main project and + select Run Main Project from the + main menu. Both targets will use the configuration + file provided in the src/etc directory. +

    +

    When the application is started, you can connect to + it with jconsole. +

    +
    + Note: You can also run the scandir + application directly from the java + command line. Make sure to build the project jar + first. +
    On Unix systems: +
    ant jar
    +java -Djava.util.logging.config.file=logging.properties \
    +     -Dscandir.config.file=src/etc/testconfig.xml \
    +     -jar dist/jmx-scandir.jar
    +
    On Windows systems: +

    ant jar
    +java  -Djava.util.logging.config.file=logging.properties +  -Dscandir.config.file=src\etc\testconfig.xml +  -jar dist\jmx-scandir.jar

    +
    +
+ +

Playing with JConsole

+
    +

    Run the example as explained in the previous section, so + that it uses the provided src/etc/testconfig.xml + configuration file. Then start + jconsole. In the connection window choose the process that runs + com.sun.jmx.examples.scandir.ScanDirAgent or + jmx-scandir.jar. +

    +

    + + +
    + jconsole connection window - connect to local process + + jconsole connection window - connect to local process +
    +
    +

    +

    Open the MBeans tab, and look for the + ScanDirConfigMXBean. + Click on its Attributes node and double click on its + Configuration attribute, to look at + the loaded configuration - values in bold can + be expanded by a double-click. +

    +

    jconsole MBean tab: ScanDirConfigMXBean
    +

    +

    Now go to the ScanManagerMXBean, click on + its Notifications node, and subscribe + for notifications. Then click on the + Operations node and invoke the + start() operation: +

    +

    jconsole MBean tab: ScanDirConfigMXBean
    +

    +

    You can see that the notifications counter was + incremented by three: you have just scheduled, + run, and completed a batch of directory scans. +

    +

    Now go to the ResultLogManagerMXBean, + click on its Attributes node, and + expand its MemoryLog attribute: +

    +

    jconsole MBean tab: ScanDirConfigMXBean
    +

    +

    You can see that the directory scan results have + been logged.

    +

    To make the application terminate go back to the + ScanManagerMXBean and invoke + close(). The ScanDirAgent + will receive the notification, step out of + the application main thread, and the application + will terminate. +

    +

    This is of course a very limited scenario. Feel free + to improvise with all the features of the example, creating + a new configuration - + ScanManagerMXBean.createOtherConfigurationMBean - + adding multiple directory scanners to that configuration - + ScanDirConfigMXBean.addDirectoryScanner - + then switching the ScanManagerMXBean current + configuration by changing the value of the ConfigurationMBean + attribute - ScanManagerMXBean.setConfigurationMBean + - then applying the new configuration - + ScanManagerMXBean.applyConfiguration(true) - + then scheduling repeated directory scans every 10 seconds - + ScanManagerMXBean.schedule(0,10000) - + subscribing for notifications, etc... +

    +
+ + +

Turning the example into a Secure JMX Application

+ +

Configuring the JVM Agent for Secure Remote Connection

+
    +

    The easiest way to configure the + JVM Agent for Secure Remote + Connection is to use your own management.properties file. + In this example, we have copied the default + $JRE/lib/management/management.properties + file to the example's src/etc directory and + modified it in this way: +

      +
    • We have set the RMI port to 4545 - this is just a + random port number we have picked up. Feel free to use your + own value suited to your environment. +
      # For setting the JMX RMI agent port use the following line
      +com.sun.management.jmxremote.port=4545
      +
    • +
    • We have switched on SSL mutual authentication +
      # For RMI monitoring with SSL client authentication use the following line
      +com.sun.management.jmxremote.ssl.need.client.auth=true
      +
    • +
    • We have also secured the RMI Registry with SSL +
      # For using an SSL/TLS protected RMI Registry use the following line
      +com.sun.management.jmxremote.registry.ssl=true
      +
    • +
    • We have provided our own password file +
      # For a non-default password file location use the following line
      +com.sun.management.jmxremote.password.file=src/etc/password.properties
      +
    • +
    • We have provided our own access file +
      # For a non-default password file location use the following line
      +com.sun.management.jmxremote.access.file=src/etc/access.properties
      +
    • +
    +

    You will note that we haven't provided any value + for the other security properties, like + com.sun.management.jmxremote.authenticate=true, + because these properties already default to a value + which enables security by default. + Note however that protecting the RMI Registry with SSL + improves the application security, but only as long as + mutual authentication is also switched on. Otherwise, just + anybody would be able to connect to the registry and + get the RMIServer stub. +

    +

    We do recommend that you use the most secure configuration + when you deploy a JMX agent - which means switching on + SSL protection for the RMI registry and requiring + mutual authentication, as we show in this example. +

    +

    We will use the com.sun.management.config.file + system property to pass our management.properties + file to the ScanDirAgent. +

    +
+ +

Creating a password and access file

+
    +

    As explained above, we have created our own + password file + and access file + for access control and authorization. +

    +

    In the password file, we have defined two logins: + guest and admin. The password for + guest is guestpasswd and the password + for admin is adminpasswd. +

    +

    In the access file, we have mapped these two logins + to access rights: the admin login has read-write + access, while the guest login only has read-only. +

    +

    Before starting the ScanDirAgent, you will + need to restrict access permission to the password file, + in such a way that nobody but you can read it. Otherwise, the + JVM Agent will refuse to start the JMXConnectorServer, as it will + fear that security can be compromised if other parties can + have read access to the password file. How to restrict + read access to the password file is explained in detail + here. +

    +

    As we have seen above, the location + of our access and password files is configured in our own management.properties + file. +

    +
+

Keystore and Truststore

+
    +

    Using SSL with mutual authentication means that both + client and server will need a keystore and a truststore + to store their own certificates, and the certificates of + the parties they trust. Usually, client and server will + have their own keystore and truststore. +

    +

    For the sake of simplicity - and to get you started + without the tedious necessity of creating your own keystore + and truststore, we are providing a dummy keystore and + truststore, containing a certificate self-signed by duke. + The password for our keystore is password, and the + password for our truststore is trustword. + We suggest that you first get the example running with the + keystore and truststore we are providing before attempting + to use your own keystore and truststore. +

    +

    A secure application will obviously need to use its own + keystore and truststore, and should not rely on the keystore + and truststore we are providing here! +

    +

    How to create your own keystore and truststore, is explained + in here. + As shown later, + we will need to use system properties to pass our truststore + and keystore to the ScanDirAgent. +

    +
+

Starting a Secure scandir agent

+
    +

    To start a secure scandir agent, go to the + scandir example root directory and type the + following command:

    +

    On Unix Systems: +

    ant jar
    +java \
    +    -Djava.util.logging.config.file=logging.properties \
    +    -Djavax.net.ssl.keyStore=keystore \
    +    -Djavax.net.ssl.keyStorePassword=password \
    +    -Djavax.net.ssl.trustStore=truststore \
    +    -Djavax.net.ssl.trustStorePassword=trustword \
    +    -Dcom.sun.management.config.file=src/etc/management.properties \
    +    -Dscandir.config.file=src/etc/testconfig.xml \
    +    -jar dist/jmx-scandir.jar
    +

    +

    On Windows Systems: +

    ant jar
    +java +  -Djava.util.logging.config.file=logging.properties +  -Djavax.net.ssl.keyStore=keystore +  -Djavax.net.ssl.keyStorePassword=password +  -Djavax.net.ssl.trustStore=truststore +  -Djavax.net.ssl.trustStorePassword=trustword +  -Dcom.sun.management.config.file=src\etc\management.properties +  -Dscandir.config.file=src\etc\testconfig.xml +  -jar dist\jmx-scandir.jar

    +

    +

    If you start jconsole now, you will see that you + are still able to connect to the agent using the + local connection. However, if you try to connect + through the remote connector, using + localhost:4545, + the connection will fail, even if you provide a correct login/password + pair. Indeed, since the JMXConnectorServer is now protected with SSL, + jconsole must also be configured with the appropriate SSL parameters + so that it can authenticate the server and get authenticated by the + server too as the SSL configuration of the server requires mutual + authentication. +

    +

    The next section will discuss how to connect to the + secure agent. +

    +
+ +

Connecting to the Secure JMX Application

+
    +

    We will now see how to connect to the secure agent, + using jconsole, and using a programmatic client. +

    +
+ +

Using jconsole to connect to the secure agent

+
    +

    The only special thing you need to do in order to + be able to connect to your secure agent with + jconsole, is to give it a keystore (containing + its client certificate) and a truststore (containing + the certificates of the servers it can trust). + In our example, we use the same keystore/truststore + pair on the client and server side - but this is + not what a real application would do. + Indeed a real application would have different + certificates for the client and the server, and + thus use different keystores (and probably truststores). + More information on SSL authentication can be obtained from the JavaTM Secure Socket Extension (JSSE) Reference Guide. +

    +

    To start jconsole with our provided keystore and + truststore, go to the scandir example root directory and + type in the following command: +

    jconsole +  -J-Djava.util.logging.config.file=logging.properties +  -J-Djavax.net.ssl.keyStore=keystore +  -J-Djavax.net.ssl.keyStorePassword=password +  -J-Djavax.net.ssl.trustStore=truststore +  -J-Djavax.net.ssl.trustStorePassword=trustword

    +

    +

    The -J-Djava.util.logging.config.file=logging.properties + flag is not mandatory, but passing a logging.properties + may help you debug connection problems if anything goes wrong. +

    +

    In jconsole connection window, choose to connect to a + remote process, using the address localhost:4545 + and the guest login: +

    +

    jconsole connection window
    +

    +

    You will see that the agent will let view all the + MBeans and their attributes, but will reject any + attribute modification or remote method invocation. +

    +
    +

    Note: if jconsole fails to connect and show + you this screen + you have probably misspelled some of the properties on jconsole + command line, or you didn't start jconsole from the + scandir example root directory where our truststore + and keystore files are located. This article - Troubleshooting connection problems in JConsole - may help + you figure out what is going wrong. +

    +
    +
+ +

Writing a programmatic client to connect to the secure agent

+
    +

    + In this section we will show the steps involved in writing + a programmatic client that will connect to our secure agent. +

    +

    The ScanDirClient is an example class that shows how a + programmatic client can connect to a secured scandir application. + This class contains a main method which creates and + configures a JMXConnector client to connect with + the secured scandir agent. +

    +

    The secure client differs only from a non secure client in + so far as it needs to use SSL RMI Factories and credentials to + connect to the secure agent. The steps required mainly involve: +

      +
    • Creating an empty environment map: +
                  
      +            // Create an environment map to hold connection properties
      +            // like credentials etc... We will later pass this map
      +            // to the JMX Connector.
      +            //
      +            System.out.println("\nInitialize the environment map");
      +            final Map<String,Object> env = new HashMap<String,Object>();
      +           
      +
    • +
    • Putting the client's credentials in that map: + (here the client will log in as guest) +
                  
      +            // Provide the credentials required by the server
      +            // to successfully perform user authentication
      +            //
      +            final String[] credentials = new String[] { "guest" , "guestpasswd" };
      +            env.put("jmx.remote.credentials", credentials);
      +           
      +
    • +
    • Providing an SslRMIClientSocketFactory to interact + with the secure RMI Registry: +
                  
      +            // Provide the SSL/TLS-based RMI Client Socket Factory required
      +            // by the JNDI/RMI Registry Service Provider to communicate with
      +            // the SSL/TLS-protected RMI Registry
      +            //
      +            env.put("com.sun.jndi.rmi.factory.socket",
      +                    new SslRMIClientSocketFactory());
      +           
      +
    • +
    • Creating a JMXConnector and connecting with the + secure server: +
      +            // Create the RMI connector client and
      +            // connect it to the secure RMI connector server.
      +            // args[0] is the server's host - localhost
      +            // args[1] is the secure server port - 4545
      +            //
      +            System.out.println("\nCreate the RMI connector client and " +
      +                    "connect it to the RMI connector server");
      +            final JMXServiceURL url = new JMXServiceURL(
      +                    "service:jmx:rmi:///jndi/rmi://"+args[0]+":"+args[1]+ 
      +                    "/jmxrmi");
      +            final JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      +           
      +
    • +
    +

    For this to work, we also need to start the ScanDirClient + with the appropriate system properties that will point to our + keystore and truststore. To start the secure + client, go to the scandir example root directory and type + the following command: +

    ant jar
    +java +  -Djava.util.logging.config.file=logging.properties +  -Djavax.net.ssl.keyStore=keystore +  -Djavax.net.ssl.keyStorePassword=password +  -Djavax.net.ssl.trustStore=truststore +  -Djavax.net.ssl.trustStorePassword=trustword +  -classpath dist/jmx-scandir.jar +  com.sun.jmx.examples.scandir.ScanDirClient localhost 4545 +

    +

    +

    You should be seeing this trace: +

    +
    +
    +Initialize the environment map
    +
    +Create the RMI connector client and connect it to the RMI connector server
    +Connecting to: service:jmx:rmi:///jndi/rmi://localhost:4545/jmxrmi
    +
    +Get the MBeanServerConnection
    +
    +Get ScanDirConfigMXBean from ScanManagerMXBean
    +
    +Get 'Configuration' attribute on ScanDirConfigMXBean
    +
    +Configuration:
    +
    +<ScanManager xmlns="jmx:com.sun.jmx.examples.scandir.config" name="testconfig">
    +    <InitialResultLogConfig>
    +        <LogFileMaxRecords>2048</LogFileMaxRecords>
    +        <LogFileName>build/scandir.log</LogFileName>
    +        <MemoryMaxRecords>128</MemoryMaxRecords>
    +    </InitialResultLogConfig>
    +    <DirectoryScannerList>
    +        <DirectoryScanner name="scan-build">
    +            <Actions>NOTIFY LOGRESULT</Actions>
    +            <ExcludeFiles/>
    +            <IncludeFiles>
    +                <FileFilter>
    +                    <FilePattern>.*\.class</FilePattern>
    +                    <SizeExceedsMaxBytes>4096</SizeExceedsMaxBytes>
    +                </FileFilter>
    +            </IncludeFiles>
    +            <RootDirectory>build</RootDirectory>
    +        </DirectoryScanner>
    +    </DirectoryScannerList>
    +</ScanManager>
    +
    +Invoke 'close' on ScanManagerMXBean
    +
    +Got expected security exception: java.lang.SecurityException: Access denied! 
    +Invalid access level for requested MBeanServer operation.
    +
    +Close the connection to the server
    +
    +Bye! Bye!
    +
    +
    +

    If the ScanDirClient fails to connect with + the secure agent, then this article - Troubleshooting connection problems in JConsole - may help + you figure out what is going wrong. Indeed the connection steps + performed by the ScanDirClient are very similar to + those performed by jconsole, and the problems you + could encounter are identical. Just remember that + jconsole needs the extra -J flag to pass + system properties to the VM, which is not needed with regular + java launcher invocations. +

    +
+ +

Conclusion

+
    +

    + In this document, we have presented an advanced + JMX example, and shown how to run a secure + JMX agent in a production environment. + We have also shown how to connect to such a + secure agent with both jconsole and a programmatic + client. We have also discuss various JMX + design-patterns and best practices. + Readers who would wish to learn more about JMX, and + Monitoring and Management of the JVM, are invited + to follow the links given in reference below. +

    +
+

References

+
    +
  1. JMX Best Practices: This document describes best practices that + have been identified for modeling using the JMX API.
  2. +
  3. Monitoring and Management Using JMX: How to enable, configure, and + connect to the JVM JMX agent.
  4. +
  5. Using JConsole: JConsole is a JMX-Compliant monitoring tool which allows + you to interact graphically with your own MBeans. +
  6. +
  7. Monitoring and Management for the Java Platform: The Java Platform + Standard Edition (Java SE) 6 provides comprehensive monitoring and + management support for the Java platform.
  8. +
  9. List of JMX-related Blogs: This page provides links to the + different web logs written by members of the Sun team working on the + JMX API.
  10. +
  11. JavaTM Secure Socket Extension (JSSE) Reference Guide: + comprehensive documentation about the JavaTM Secure Socket + Extension (JSSE) +
  12. +
  13. Java SE 6 Documentation Index: This document covers the + JavaTM Platform, Standard Edition 6 JDK.
  14. +
+

+


+

+ + diff --git a/runtime/sample/jmx/jmx-scandir/keystore b/runtime/sample/jmx/jmx-scandir/keystore new file mode 100644 index 0000000..05f5356 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/keystore differ diff --git a/runtime/sample/jmx/jmx-scandir/logging.properties b/runtime/sample/jmx/jmx-scandir/logging.properties new file mode 100644 index 0000000..1714bee --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/logging.properties @@ -0,0 +1,17 @@ +handlers= java.util.logging.ConsoleHandler + +.level=INFO + + +java.util.logging.FileHandler.pattern = %h/java%u.log +java.util.logging.FileHandler.limit = 50000 +java.util.logging.FileHandler.count = 1 +java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter + +java.util.logging.ConsoleHandler.level = FINEST +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +javax.management.level=INFO +com.sun.jmx.level=INFO +com.sun.jmx.examples.level=FINE + diff --git a/runtime/sample/jmx/jmx-scandir/manifest.mf b/runtime/sample/jmx/jmx-scandir/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/runtime/sample/jmx/jmx-scandir/nbproject/file-targets.xml b/runtime/sample/jmx/jmx-scandir/nbproject/file-targets.xml new file mode 100644 index 0000000..42da880 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/nbproject/file-targets.xml @@ -0,0 +1,46 @@ + + + + + + + + + + Must set property 'includes' + + + + + + + diff --git a/runtime/sample/jmx/jmx-scandir/nbproject/jdk.xml b/runtime/sample/jmx/jmx-scandir/nbproject/jdk.xml new file mode 100644 index 0000000..2b85b77 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/nbproject/jdk.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtime/sample/jmx/jmx-scandir/nbproject/netbeans-targets.xml b/runtime/sample/jmx/jmx-scandir/nbproject/netbeans-targets.xml new file mode 100644 index 0000000..facdb4e --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/nbproject/netbeans-targets.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtime/sample/jmx/jmx-scandir/nbproject/project.xml b/runtime/sample/jmx/jmx-scandir/nbproject/project.xml new file mode 100644 index 0000000..a988de6 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/nbproject/project.xml @@ -0,0 +1,210 @@ + + + + + + org.netbeans.modules.ant.freeform + + + jmx-scandir + + user.build.properties + build.properties + ${nbjdk.home}/jre/lib/rt.jar + + + + + ${main.dir} + + + + java + ${src.dir} + + + + java + test + + + + + jar + + + clean + + + clean + jar + + + run + + + + show-info + + + + show-javadoc + + + + debug + + + + compile-selected + + includes + ${src.dir} + \.java$ + relative-path + + , + + + + + run + + main.class + ${src.dir} + \.java$ + java-name + + + + + + + + debug + + main.class + ${src.dir} + \.java$ + java-name + + + + + + + + debug-fix + + class + ${src.dir} + \.java$ + relative-path-noext + + + + + + + test + + + + folder + ${classes.dir} + jar + + + jar + ${jar} + jar + + + folder + ${build.test.classes.dir} + jar + + + + + + ${src.dir} + + + + test + + + ${main.dir}/index.html + + + + + + + + + + + + + + run-agent + + + + run-client + + + + + + + + ${src.dir} + ${cp} + ${run.cp} + ${nbjdk.bootclasspath} + ${classes.dir} + ${jar} + ${javadoc.dir} + 1.5 + + + test + + ${build.test.classes.dir} + 1.5 + + + + diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScanner.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScanner.java new file mode 100644 index 0000000..0ff58a2 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScanner.java @@ -0,0 +1,591 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import static com.sun.jmx.examples.scandir.ScanManager.getNextSeqNumber; +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import static com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState.*; +import static com.sun.jmx.examples.scandir.config.DirectoryScannerConfig.Action.*; +import com.sun.jmx.examples.scandir.config.XmlConfigUtils; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig.Action; +import com.sun.jmx.examples.scandir.config.ResultRecord; +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.management.AttributeChangeNotification; +import javax.management.InstanceNotFoundException; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanNotificationInfo; +import javax.management.Notification; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; + +/** + * A DirectoryScanner is an MBean that + * scans a file system starting at a given root directory, + * and then looks for files that match a given criteria. + *

+ * When such a file is found, the DirectoryScanner takes + * the action for which it was configured: emit a notification, + * and or log a {@link + * com.sun.jmx.examples.scandir.config.ResultRecord} for this file, + * and or delete that file. + *

+ *

+ * The code that would actually delete the file is commented out - so that + * nothing valuable is lost if this example is run by mistake on the wrong + * set of directories.
+ * Logged results are logged by sending them to the {@link ResultLogManager}. + *

+ *

+ * DirectoryScannerMXBeans are created, initialized, and + * registered by the {@link ScanManagerMXBean}. + * The {@link ScanManagerMXBean} will also schedule and run them in + * background by calling their {@link #scan} method. + *

+ *

Client code is not expected to create or register directly any such + * MBean. Instead, clients are expected to modify the configuration, using + * the {@link ScanDirConfigMXBean}, and then apply it, using the {@link + * ScanManagerMXBean}. Instances of DirectoryScannerMXBeans + * will then be created and registered (or unregistered and garbage collected) + * as a side effect of applying that configuration. + *

+ * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class DirectoryScanner implements + DirectoryScannerMXBean, NotificationEmitter { + + /** + * The type for com.sun.jmx.examples.scandir.filematch notifications. + * Notifications of this type will be emitted whenever a file that + * matches this {@code DirectoryScanner} criteria is found, but only if + * this {@code DirectoryScanner} was configured to {@link + * Action#NOTIFY notify} for matching files. + **/ + public static final String FILE_MATCHES_NOTIFICATION = + "com.sun.jmx.examples.scandir.filematch"; + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(DirectoryScanner.class.getName()); + + // Attribute : State + // + private volatile ScanState state = STOPPED; + + // The DirectoryScanner delegates the implementation of + // the NotificationEmitter interface to a wrapped instance + // of NotificationBroadcasterSupport. + // + private final NotificationBroadcasterSupport broadcaster; + + // The root directory at which this DirectoryScanner will start + // scanning. Constructed from config.getRootDirectory(). + // + private final File rootFile; + + // This DirectoryScanner config - this is a constant which is + // provided at construction time by the {@link ScanManager}. + // + private final DirectoryScannerConfig config; + + // The set of actions for which this DirectoryScanner is configured. + // Constructed from config.getActions() + // + final Set actions; + + // The ResultLogManager that this DirectoryScanner will use to log + // info. This is a hard reference to another MBean, provided + // at construction time by the ScanManager. + // The ScanManager makes sure that the life cycle of these two MBeans + // is consistent. + // + final ResultLogManager logManager; + + /** + * Constructs a new {@code DirectoryScanner}. + *

This constructor is + * package protected, and this MBean cannot be created by a remote + * client, because it needs a reference to the {@link ResultLogManager}, + * which cannot be provided from remote. + *

+ *

This is a conscious design choice: {@code DirectoryScanner} MBeans + * are expected to be completely managed (created, registered, unregistered) + * by the {@link ScanManager} which does provide this reference. + *

+ * + * @param config This {@code DirectoryScanner} configuration. + * @param logManager The info log manager with which to log the info + * records. + * @throws IllegalArgumentException if one of the parameter is null, or if + * the provided {@code config} doesn't have its {@code name} set, + * or if the {@link DirectoryScannerConfig#getRootDirectory + * root directory} provided in the {@code config} is not acceptable + * (not provided or not found or not readable, etc...). + **/ + public DirectoryScanner(DirectoryScannerConfig config, + ResultLogManager logManager) + throws IllegalArgumentException { + if (logManager == null) + throw new IllegalArgumentException("log=null"); + if (config == null) + throw new IllegalArgumentException("config=null"); + if (config.getName() == null) + throw new IllegalArgumentException("config.name=null"); + + broadcaster = new NotificationBroadcasterSupport(); + + // Clone the config: ensure data encapsulation. + // + this.config = XmlConfigUtils.xmlClone(config); + + // Checks that the provided root directory is valid. + // Throws IllegalArgumentException if it isn't. + // + rootFile = validateRoot(config.getRootDirectory()); + + // Initialize the Set for which this DirectoryScanner + // is configured. + // + if (config.getActions() == null) + actions = Collections.emptySet(); + else + actions = EnumSet.copyOf(Arrays.asList(config.getActions())); + this.logManager = logManager; + } + + // see DirectoryScannerMXBean + public void stop() { + // switch state to stop and send AttributeValueChangeNotification + setStateAndNotify(STOPPED); + } + + // see DirectoryScannerMXBean + public String getRootDirectory() { + return rootFile.getAbsolutePath(); + } + + + // see DirectoryScannerMXBean + public ScanState getState() { + return state; + } + + // see DirectoryScannerMXBean + public DirectoryScannerConfig getConfiguration() { + return config; + } + + // see DirectoryScannerMXBean + public String getCurrentScanInfo() { + final ScanTask currentOrLastTask = currentTask; + if (currentOrLastTask == null) return "Never Run"; + return currentOrLastTask.getScanInfo(); + } + + // This variable points to the current (or latest) scan. + // + private volatile ScanTask currentTask = null; + + // see DirectoryScannerMXBean + public void scan() { + final ScanTask task; + + synchronized (this) { + final LinkedList list; + switch (state) { + case RUNNING: + case SCHEDULED: + throw new IllegalStateException(state.toString()); + case STOPPED: + case COMPLETED: + // only accept to scan if state is STOPPED or COMPLETED. + list = new LinkedList(); + list.add(rootFile); + break; + default: + throw new IllegalStateException(String.valueOf(state)); + } + + // Create a new ScanTask object for our root directory file. + // + currentTask = task = new ScanTask(list,this); + + // transient state... will be switched to RUNNING when + // task.execute() is called. This code could in fact be modified + // to use java.util.concurent.Future and, to push the task to + // an executor. We would then need to wait for the task to + // complete before returning. However, this wouldn't buy us + // anything - since this method should wait for the task to + // finish anyway: so why would we do it? + // As it stands, we simply call task.execute() in the current + // thread - brave and fearless readers may want to attempt the + // modification ;-) + // + setStateAndNotify(SCHEDULED); + } + task.execute(); + } + + // This method is invoked to carry out the configured actions on a + // matching file. + // Do not call this method from within synchronized() { } as this + // method may send notifications! + // + void actOn(File file) { + + // Which action were actually taken + // + final Set taken = new HashSet(); + boolean logresult = false; + + // Check out which actions are configured and carry them out. + // + for (Action action : actions) { + switch (action) { + case DELETE: + if (deleteFile(file)) { + // Delete succeeded: add DELETE to the set of + // actions carried out. + taken.add(DELETE); + } + break; + case NOTIFY: + if (notifyMatch(file)) { + // Notify succeeded: add NOTIFY to the set of + // actions carried out. + taken.add(NOTIFY); + } + break; + case LOGRESULT: + // LOGRESULT was configured - log actions carried out. + // => we must execute this action as the last action. + // simply set logresult=true for now. We will do + // the logging later + logresult = true; + break; + default: + LOG.fine("Failed to execute action: " +action + + " - action not supported"); + break; + } + } + + // Now is time for logging: + if (logresult) { + taken.add(LOGRESULT); + if (!logResult(file,taken.toArray(new Action[taken.size()]))) + taken.remove(LOGRESULT); // just for the last trace below... + } + + LOG.finest("File processed: "+taken+" - "+file.getAbsolutePath()); + } + + // Deletes a matching file. + private boolean deleteFile(File file) { + try { + // file.delete() is commented so that we don't do anything + // bad if the example is mistakenly run on the wrong set of + // directories. + // + /* file.delete(); */ + System.out.println("DELETE not implemented for safety reasons."); + return true; + } catch (Exception x) { + LOG.fine("Failed to delete: "+file.getAbsolutePath()); + } + return false; + } + + // Notifies of a matching file. + private boolean notifyMatch(File file) { + try { + final Notification n = + new Notification(FILE_MATCHES_NOTIFICATION,this, + getNextSeqNumber(), + file.getAbsolutePath()); + + // This method *is not* called from any synchronized block, so + // we can happily call broadcaster.sendNotification() here. + // Note that verifying whether a method is called from within + // a synchronized block demends a thoroughful code reading, + // examining each of the 'parent' methods in turn. + // + broadcaster.sendNotification(n); + return true; + } catch (Exception x) { + LOG.fine("Failed to notify: "+file.getAbsolutePath()); + } + return false; + } + + // Logs a result with the ResultLogManager + private boolean logResult(File file,Action[] actions) { + try { + logManager.log(new ResultRecord(config, actions,file)); + return true; + } catch (Exception x) { + LOG.fine("Failed to log: "+file.getAbsolutePath()); + } + return false; + } + + + // Contextual object used to store info about current + // (or last) scan. + // + private static class ScanTask { + + // List of Files that remain to scan. + // When files are discovered they are added to the list. + // When they are being handled, they are removed from the list. + // When the list is empty, the scanning is finished. + // + private final LinkedList list; + private final DirectoryScanner scan; + + // Some statistics... + // + private volatile long scanned=0; + private volatile long matching=0; + + private volatile String info="Not started"; + + ScanTask(LinkedList list, DirectoryScanner scan) { + this.list = list; this.scan = scan; + } + + public void execute() { + scan(list); + } + + private void scan(LinkedList list) { + scan.scan(this,list); + } + + public String getScanInfo() { + return info+" - ["+scanned+" scanned, "+matching+" matching]"; + } + } + + // The actual scan logic. Switches state to RUNNING, + // and scan the list of given dirs. + // The list is a live object which is updated by this method. + // This would allow us to implement methods like "pause" and "resume", + // since all the info needed to resume would be in the list. + // + private void scan(ScanTask task, LinkedList list) { + setStateAndNotify(RUNNING); + task.info = "In Progress"; + try { + + // The FileFilter will tell us which files match and which don't. + // + final FileFilter filter = config.buildFileFilter(); + + // We have two condition to end the loop: either the list is + // empty, meaning there's nothing more to scan, or the state of + // the DirectoryScanner was asynchronously switched to STOPPED by + // another thread, e.g. because someone called "stop" on the + // ScanManagerMXBean + // + while (!list.isEmpty() && state == RUNNING) { + + // Get and remove the first element in the list. + // + final File current = list.poll(); + + // Increment number of file scanned. + task.scanned++; + + // If 'current' is a file, it's already been matched by our + // file filter (see below): act on it. + // Note that for the first iteration of this loop, there will + // be one single file in the list: the root directory for this + // scanner. + // + if (current.isFile()) { + task.matching++; + actOn(current); + } + + // If 'current' is a directory, then + // find files and directories that match the file filter + // in this directory + // + if (current.isDirectory()) { + + // Gets matching files and directories + final File[] content = current.listFiles(filter); + if (content == null) continue; + + // Adds all matching file to the list. + list.addAll(0,Arrays.asList(content)); + } + } + + // The loop terminated. If the list is empty, then we have + // completed our task. If not, then somebody must have called + // stop() on this directory scanner. + // + if (list.isEmpty()) { + task.info = "Successfully Completed"; + setStateAndNotify(COMPLETED); + } + } catch (Exception x) { + // We got an exception: stop the scan + // + task.info = "Failed: "+x; + if (LOG.isLoggable(Level.FINEST)) + LOG.log(Level.FINEST,"scan task failed: "+x,x); + else if (LOG.isLoggable(Level.FINE)) + LOG.log(Level.FINE,"scan task failed: "+x); + setStateAndNotify(STOPPED); + } catch (Error e) { + // We got an Error: + // Should not happen unless we ran out of memory or + // whatever - don't even try to notify, but + // stop the scan anyway! + // + state=STOPPED; + task.info = "Error: "+e; + + // rethrow error. + // + throw e; + } + } + + /** + * MBeanNotification support - delegates to broadcaster. + */ + public void addNotificationListener(NotificationListener listener, + NotificationFilter filter, Object handback) + throws IllegalArgumentException { + broadcaster.addNotificationListener(listener, filter, handback); + } + + // Switch this object state to the desired value an send + // a notification. Don't call this method from within a + // synchronized block! + // + private final void setStateAndNotify(ScanState desired) { + final ScanState old = state; + if (old == desired) return; + state = desired; + final AttributeChangeNotification n = + new AttributeChangeNotification(this, + getNextSeqNumber(),System.currentTimeMillis(), + "state change","State",ScanState.class.getName(), + String.valueOf(old),String.valueOf(desired)); + broadcaster.sendNotification(n); + } + + + /** + * The {@link DirectoryScannerMXBean} may send two types of + * notifications: filematch, and state attribute changed. + **/ + public MBeanNotificationInfo[] getNotificationInfo() { + return new MBeanNotificationInfo[] { + new MBeanNotificationInfo( + new String[] {FILE_MATCHES_NOTIFICATION}, + Notification.class.getName(), + "Emitted when a file that matches the scan criteria is found" + ), + new MBeanNotificationInfo( + new String[] {AttributeChangeNotification.ATTRIBUTE_CHANGE}, + AttributeChangeNotification.class.getName(), + "Emitted when the State attribute changes" + ) + }; + } + + /** + * MBeanNotification support - delegates to broadcaster. + */ + public void removeNotificationListener(NotificationListener listener) + throws ListenerNotFoundException { + broadcaster.removeNotificationListener(listener); + } + + /** + * MBeanNotification support - delegates to broadcaster. + */ + public void removeNotificationListener(NotificationListener listener, + NotificationFilter filter, Object handback) + throws ListenerNotFoundException { + broadcaster.removeNotificationListener(listener, filter, handback); + } + + // Validates the given root directory, returns a File object for + // that directory. + // Throws IllegalArgumentException if the given root is not + // acceptable. + // + private static File validateRoot(String root) { + if (root == null) + throw new IllegalArgumentException("no root specified"); + if (root.length() == 0) + throw new IllegalArgumentException("specified root \"\" is invalid"); + final File f = new File(root); + if (!f.canRead()) + throw new IllegalArgumentException("can't read "+root); + if (!f.isDirectory()) + throw new IllegalArgumentException("no such directory: "+root); + return f; + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScannerMXBean.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScannerMXBean.java new file mode 100644 index 0000000..2ca3548 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/DirectoryScannerMXBean.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import java.io.IOException; +import javax.management.InstanceNotFoundException; + +/** + * A DirectoryScannerMXBean is an MBean that + * scans a file system starting at a given root directory, + * and then looks for files that match a given criteria. + *

+ * When such a file is found, the DirectoryScannerMXBean takes + * the actions for which it was configured: see {@link #scan scan()}. + *

+ * DirectoryScannerMXBeans are created, initialized, and + * registered by the {@link ScanManagerMXBean}. + * The {@link ScanManagerMXBean} will also schedule and run them in + * background by calling their {@link #scan} method. + *

+ * @author Sun Microsystems, 2006 - All rights reserved. + */ +public interface DirectoryScannerMXBean { + /** + * Get The {@link DirectoryScanner} state. + * @return the current state of the DirectoryScanner. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public ScanState getState() + throws IOException, InstanceNotFoundException; + + /** + * Stops the current scan if {@link ScanState#RUNNING running}. + * After this method completes the state of the application will + * be {@link ScanState#STOPPED STOPPED}. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void stop() + throws IOException, InstanceNotFoundException; + + /** + * Scans the file system starting at the specified {@link #getRootDirectory + * root directory}. + *

If a file that matches this DirectoryScannerMXBean + * {@link #getConfiguration} criteria is found, + * the DirectoryScannerMXBean takes the {@link + * DirectoryScannerConfig#getActions() actions} for which + * it was {@link #getConfiguration configured}: emit a notification, + * and or log a {@link + * com.sun.jmx.examples.scandir.config.ResultRecord} for this file, + * and or delete that file. + *

+ *

+ * The code that would actually delete the file is commented out - so that + * nothing valuable is lost if this example is run by mistake on the wrong + * set of directories. + *

+ *

This method returns only when the directory scan is completed, or + * if it was {@link #stop stopped} by another thread. + *

+ * @throws IllegalStateException if already {@link ScanState#RUNNING} + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void scan() + throws IOException, InstanceNotFoundException; + + /** + * Gets the root directory at which this DirectoryScannerMXBean + * will start scanning the file system. + *

+ * This is a shortcut to {@link #getConfiguration + * getConfiguration()}.{@link + * DirectoryScannerConfig#getRootDirectory + * getRootDirectory()}. + *

+ * @return This DirectoryScannerMXBean root directory. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public String getRootDirectory() + throws IOException, InstanceNotFoundException; + + /** + * The configuration data from which this {@link DirectoryScanner} was + * created. + *

+ * You cannot change this configuration here. You can however + * {@link ScanDirConfigMXBean#setConfiguration modify} the + * {@link ScanDirConfigMXBean} configuration, and ask the + * {@link ScanManagerMXBean} to {@link ScanManagerMXBean#applyConfiguration + * apply} it. This will get all DirectoryScannerMXBean + * replaced by new MBeans created from the modified configuration. + *

+ * + * @return This DirectoryScannerMXBean configuration data. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public DirectoryScannerConfig getConfiguration() + throws IOException, InstanceNotFoundException; + + /** + * A short string describing what's happening in current/latest scan. + * @return a short info string. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public String getCurrentScanInfo() + throws IOException, InstanceNotFoundException; +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManager.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManager.java new file mode 100644 index 0000000..a0a4bb9 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManager.java @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import static com.sun.jmx.examples.scandir.ScanManager.getNextSeqNumber; +import com.sun.jmx.examples.scandir.config.ResultLogConfig; +import com.sun.jmx.examples.scandir.config.XmlConfigUtils; +import com.sun.jmx.examples.scandir.config.ResultRecord; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.logging.Logger; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.Notification; +import javax.management.NotificationBroadcasterSupport; +import javax.management.ObjectName; +import javax.xml.bind.JAXBException; + +/** + * The ResultLogManager is in charge of managing result logs. + * {@link DirectoryScanner DirectoryScanners} can be configured to log a + * {@link ResultRecord} whenever they take action upon a file that + * matches their set of matching criteria. + * The ResultLogManagerMXBean is responsible for storing these + * results in its result logs. + *

The ResultLogManagerMXBean can be configured to log + * these records to a flat file, or into a log held in memory, or both. + * Both logs (file and memory) can be configured with a maximum capacity. + *
When the maximum capacity of the memory log is reached - its first + * entry (i.e. its eldest entry) is removed to make place for the latest. + *
When the maximum capacity of the file log is reached, the file is + * renamed by appending a tilde '~' to its name and a new result log is created. + * + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class ResultLogManager extends NotificationBroadcasterSupport + implements ResultLogManagerMXBean, MBeanRegistration { + + /** + * The default singleton name of the {@link ResultLogManagerMXBean}. + **/ + public static final ObjectName RESULT_LOG_MANAGER_NAME = + ScanManager.makeSingletonName(ResultLogManagerMXBean.class); + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(ResultLogManager.class.getName()); + + // The memory log + // + private final List memoryLog; + + // Whether the memory log capacity was reached. In that case every + // new entry triggers the deletion of the eldest one. + // + private volatile boolean memCapacityReached = false; + + // The maximum number of record that the memory log can + // contain. + // + private volatile int memCapacity; + + // The maximum number of record that the ResultLogManager can + // log in the log file before creating a new file. + // + private volatile long fileCapacity; + + // The current log file. + // + private volatile File logFile; + + // The OutputStream of the current log file. + // + private volatile OutputStream logStream = null; + + // number of record that this object has logged in the log file + // since the log file was created. Creating a new file or clearing + // the log file reset this value to '0' + // + private volatile long logCount = 0; + + // The ResultLogManager config - modified whenever + // ScanManager.applyConfiguration is called. + // + private volatile ResultLogConfig config; + + /** + * Create a new ResultLogManagerMXBean. This constructor is package + * protected: only the {@link ScanManager} can create a + * ResultLogManager. + **/ + ResultLogManager() { + // Instantiate the memory log - override the add() method so that + // it removes the head of the list when the maximum capacity is + // reached. Note that add() is the only method we will be calling, + // otherwise we would have to override all the other flavors + // of adding methods. Note also that this implies that the memoryLog + // will *always* remain encapsulated in this object and is *never* + // handed over (otherwise we wouldn't be able to ensure that + // add() is the only method ever called to add a record). + // + memoryLog = + Collections.synchronizedList(new LinkedList() { + public synchronized boolean add(ResultRecord e) { + final int max = getMemoryLogCapacity(); + while (max > 0 && size() >= max) { + memCapacityReached = true; + removeFirst(); + } + return super.add(e); + } + }); + + // default memory capacity + memCapacity = 2048; + + // default file capacity: 0 means infinite ;-) + fileCapacity = 0; + + // by default logging to file is disabled. + logFile = null; + + // Until the ScanManager apply a new configuration, we're going to + // work with a default ResultLogConfig object. + config = new ResultLogConfig(); + config.setMemoryMaxRecords(memCapacity); + config.setLogFileName(getLogFileName(false)); + config.setLogFileMaxRecords(fileCapacity); + } + + + /** + * Allows the MBean to perform any operations it needs before being + * registered in the MBean server. + *

If the name of the MBean is not + * specified, the MBean can provide a name for its registration. If + * any exception is raised, the MBean will not be registered in the + * MBean server.

+ *

The {@code ResultLogManager} uses this method to supply its own + * default singleton ObjectName (if name parameter is null). + * @param server The MBean server in which the MBean will be registered. + * @param name The object name of the MBean. This name is null if the + * name parameter to one of the createMBean or registerMBean methods in + * the MBeanServer interface is null. In that case, this method must + * return a non-null ObjectName for the new MBean. + * @return The name under which the MBean is to be registered. This value + * must not be null. If the name parameter is not null, it will usually + * but not necessarily be the returned value. + * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public ObjectName preRegister(MBeanServer server, ObjectName name) + throws Exception { + if (name == null) + name = RESULT_LOG_MANAGER_NAME; + objectName = name; + mbeanServer = server; + return name; + } + + /** + * Allows the MBean to perform any operations needed after having + * been registered in the MBean server or after the registration has + * failed. + *

This implementation does nothing.

+ * @param registrationDone Indicates whether or not the MBean has been + * successfully registered in the MBean server. The value false means + * that the registration has failed. + */ + public void postRegister(Boolean registrationDone) { + // Don't need to do anything here. + } + + /** + * Allows the MBean to perform any operations it needs before being + * unregistered by the MBean server. + *

This implementation does nothing.

+ * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public void preDeregister() throws Exception { + // Don't need to do anything here. + } + + /** + * Allows the MBean to perform any operations needed after having been + * unregistered in the MBean server. + *

Closes the log file stream, if it is still open.

+ */ + public void postDeregister() { + try { + if (logStream != null) { + synchronized(this) { + logStream.flush(); + logStream.close(); + logFile = null; + logStream = null; + } + } + } catch (Exception x) { + LOG.finest("Failed to close log properly: "+x); + } + } + + /** + * Create a new empty log file from the given basename, renaming + * previously existing file by appending '~' to its name. + **/ + private File createNewLogFile(String basename) throws IOException { + return XmlConfigUtils.createNewXmlFile(basename); + } + + /** + * Check whether a new log file should be created. + * If a new file needs to be created, creates it, renaming + * previously existing file by appending '~' to its name. + * Also reset the log count and file capacity. + * Sends a notification indicating that the log file was changed. + * Returns the new log stream; + * Creation of a new file can be forced by passing force=true. + **/ + private OutputStream checkLogFile(String basename, long maxRecords, + boolean force) + throws IOException { + final OutputStream newStream; + synchronized(this) { + if ((force==false) && (logCount < maxRecords)) + return logStream; + final OutputStream oldStream = logStream; + + // First close the stream. On some platforms you cannot rename + // a file that has open streams... + // + if (oldStream != null) { + oldStream.flush(); + oldStream.close(); + } + final File newFile = (basename==null)?null:createNewLogFile(basename); + + newStream = (newFile==null)?null:new FileOutputStream(newFile,true); + logStream = newStream; + logFile = newFile; + fileCapacity = maxRecords; + logCount = 0; + } + sendNotification(new Notification(LOG_FILE_CHANGED,objectName, + getNextSeqNumber(), + basename)); + return newStream; + } + + // see ResultLogManagerMXBean + public void log(ResultRecord record) + throws IOException { + if (memCapacity > 0) logToMemory(record); + if (logFile != null) logToFile(record); + } + + // see ResultLogManagerMXBean + public ResultRecord[] getMemoryLog() { + return memoryLog.toArray(new ResultRecord[0]); + } + + // see ResultLogManagerMXBean + public int getMemoryLogCapacity() { + return memCapacity; + } + + // see ResultLogManagerMXBean + public void setMemoryLogCapacity(int maxRecords) { + synchronized(this) { + memCapacity = maxRecords; + if (memoryLog.size() < memCapacity) + memCapacityReached = false; + config.setMemoryMaxRecords(maxRecords); + } + } + + // see ResultLogManagerMXBean + public void setLogFileCapacity(long maxRecords) + throws IOException { + synchronized (this) { + fileCapacity = maxRecords; + config.setLogFileMaxRecords(maxRecords); + } + checkLogFile(getLogFileName(),fileCapacity,false); + } + + // see ResultLogManagerMXBean + public long getLogFileCapacity() { + return fileCapacity; + } + + // see ResultLogManagerMXBean + public long getLoggedCount() { + return logCount; + } + + // see ResultLogManagerMXBean + public void newLogFile(String logname, long maxRecord) + throws IOException { + checkLogFile(logname,maxRecord,true); + config.setLogFileName(getLogFileName(false)); + config.setLogFileMaxRecords(getLogFileCapacity()); + } + + // see ResultLogManagerMXBean + public String getLogFileName() { + return getLogFileName(true); + } + + // see ResultLogManagerMXBean + public void clearLogs() throws IOException { + clearMemoryLog(); + clearLogFile(); + } + + // Clear the memory log, sends a notification indicating that + // the memory log was cleared. + // + private void clearMemoryLog()throws IOException { + synchronized(this) { + memoryLog.clear(); + memCapacityReached = false; + } + sendNotification(new Notification(MEMORY_LOG_CLEARED, + objectName, + getNextSeqNumber(),"memory log cleared")); + } + + // Clears the log file. + // + private void clearLogFile() throws IOException { + // simply force the creation of a new log file. + checkLogFile(getLogFileName(),fileCapacity,true); + } + + // Log a record to the memory log. Send a notification if the + // maximum capacity of the memory log is reached. + // + private void logToMemory(ResultRecord record) { + + final boolean before = memCapacityReached; + final boolean after; + synchronized(this) { + memoryLog.add(record); + after = memCapacityReached; + } + if (before==false && after==true) + sendNotification(new Notification(MEMORY_LOG_MAX_CAPACITY, + objectName, + getNextSeqNumber(),"memory log capacity reached")); + } + + + // Log a record to the memory log. Send a notification if the + // maximum capacity of the memory log is reached. + // + private void logToFile(ResultRecord record) throws IOException { + final String basename; + final long maxRecords; + synchronized (this) { + if (logFile == null) return; + basename = getLogFileName(false); + maxRecords = fileCapacity; + } + + // Get the stream into which we should log. + final OutputStream stream = + checkLogFile(basename,maxRecords,false); + + // logging to file now disabled - too bad. + if (stream == null) return; + + synchronized (this) { + try { + XmlConfigUtils.write(record,stream,true); + stream.flush(); + // don't increment logCount if we were not logging in logStream. + if (stream == logStream) logCount++; + } catch (JAXBException x) { + final IllegalArgumentException iae = + new IllegalArgumentException("bad record",x); + LOG.finest("Failed to log record: "+x); + throw iae; + } + } + } + + /** + * The notification type which indicates that the log file was switched: + * com.sun.jmx.examples.scandir.log.file.switched. + * The message contains the name of the new file (or null if log to file + * is now disabled). + **/ + public final static String LOG_FILE_CHANGED = + "com.sun.jmx.examples.scandir.log.file.switched"; + + /** + * The notification type which indicates that the memory log capacity has + * been reached: + * com.sun.jmx.examples.scandir.log.memory.full. + **/ + public final static String MEMORY_LOG_MAX_CAPACITY = + "com.sun.jmx.examples.scandir.log.memory.full"; + + /** + * The notification type which indicates that the memory log was + * cleared: + * com.sun.jmx.examples.scandir.log.memory.cleared. + **/ + public final static String MEMORY_LOG_CLEARED = + "com.sun.jmx.examples.scandir.log.memory.cleared"; + + /** + * This MBean emits three kind of notifications: + *
+     *    com.sun.jmx.examples.scandir.log.file.switched
+     *    com.sun.jmx.examples.scandir.log.memory.full
+     *    com.sun.jmx.examples.scandir.log.memory.cleared
+     * 
+ **/ + public MBeanNotificationInfo[] getNotificationInfo() { + return new MBeanNotificationInfo[] { + new MBeanNotificationInfo(new String[] { + LOG_FILE_CHANGED}, + Notification.class.getName(), + "Emitted when the log file is switched") + , + new MBeanNotificationInfo(new String[] { + MEMORY_LOG_MAX_CAPACITY}, + Notification.class.getName(), + "Emitted when the memory log capacity is reached") + , + new MBeanNotificationInfo(new String[] { + MEMORY_LOG_CLEARED}, + Notification.class.getName(), + "Emitted when the memory log is cleared") + }; + } + + // Return the name of the log file, or null if logging to file is + // disabled. + private String getLogFileName(boolean absolute) { + synchronized (this) { + if (logFile == null) return null; + if (absolute) return logFile.getAbsolutePath(); + return logFile.getPath(); + } + } + + // This method is be called by the ScanManagerMXBean when a configuration + // is applied. + // + void setConfig(ResultLogConfig logConfigBean) throws IOException { + if (logConfigBean == null) + throw new IllegalArgumentException("logConfigBean is null"); + synchronized (this) { + config = logConfigBean; + setMemoryLogCapacity(config.getMemoryMaxRecords()); + } + final String filename = config.getLogFileName(); + final String logname = getLogFileName(false); + if ((filename != null && !filename.equals(logname)) + || (filename == null && logname != null)) { + newLogFile(config.getLogFileName(), + config.getLogFileMaxRecords()); + } else { + setLogFileCapacity(config.getLogFileMaxRecords()); + } + } + + // This method is called by the ScanManagerMXBean when + // applyCurrentResultLogConfig() is called. + // + ResultLogConfig getConfig() { + return config; + } + + + // Set by preRegister(). + private MBeanServer mbeanServer; + private ObjectName objectName; + + + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManagerMXBean.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManagerMXBean.java new file mode 100644 index 0000000..eb1f0f6 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ResultLogManagerMXBean.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.config.ResultRecord; +import java.io.IOException; +import javax.management.InstanceNotFoundException; + +/** + * The ResultLogManagerMXBean is in charge of managing result logs. + * {@link DirectoryScanner DirectoryScanners} can be configured to log a + * {@link ResultRecord} whenever they take action upon a file that + * matches their set of matching criteria. + * The ResultLogManagerMXBean is responsible for storing these + * results in its result logs. + *

The ResultLogManagerMXBean + * will let you interactively clear these result logs, change their + * capacity, and decide where (memory or file or both) the + * {@link ResultRecord ResultRecords} should be stored. + *

The memory log is useful in so far that its content can be interactively + * returned by the ResultLogManagerMXBean. + * The file log doesn't have this facility. + *

The result logs are intended to be used by e.g. an offline program that + * would take some actions on the files that were matched by the scanners + * criteria: + *

The scandir application could be configured to only produce logs + * (i.e. takes no action but logging the matching files), and the real + * action (e.g. mail the result log to the engineer which maintains the lab, + * or parse the log and prepare and send a single mail to the matching + * files owners, containing the list of file he/she should consider deleting) + * could be performed by such another program/module. + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public interface ResultLogManagerMXBean { + + /** + * Creates a new log file in which to store results. + *

When this method is called, the {@link ResultLogManager} will stop + * logging in its current log file and use the new specified file instead. + * If that file already exists, it will be renamed by appending a '~' to + * its name, and a new empty file with the name specified by + * basename will be created. + *

+ *

Calling this method has no side effect on the {@link + * com.sun.jmx.examples.scandir.config.ScanManagerConfig#getInitialResultLogConfig + * InitialResultLogConfig} held in the {@link ScanDirConfigMXBean} + * configuration. To apply these new values to the + * {@link ScanDirConfigMXBean} + * configuration, you must call {@link + * ScanManagerMXBean#applyCurrentResultLogConfig + * ScanManagerMXBean.applyCurrentResultLogConfig}. + *

+ * @param basename The name of the new log file. This will be the + * new name returned by {@link #getLogFileName}. + * @param maxRecord maximum number of records to log in the specified file + * before creating a new file. maxRecord will be the + * new value returned by {@link #getLogFileCapacity}. + * When that maximum number of + * records is reached the {@link ResultLogManager} will rename + * the file by appending a '~' to its name, and a new empty + * log file will be created. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void newLogFile(String basename, long maxRecord) + throws IOException, InstanceNotFoundException; + + /** + * Logs a result record to the active result logs (memory,file,both,or none) + * depending on how this MBean is currently configured. + * @see #getLogFileName() + * @see #getMemoryLogCapacity() + * @param record The result record to log. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + */ + public void log(ResultRecord record) + throws IOException, InstanceNotFoundException; + + /** + * Gets the name of the current result log file. + *

null means that no log file is configured: logging + * to file is disabled. + *

+ * @return The name of the current result log file, or null + * if logging to file is disabled. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public String getLogFileName() + throws IOException, InstanceNotFoundException; + + /** + * Gets the whole content of the memory log. This cannot exceed + * {@link #getMemoryLogCapacity} records. + * + * @return the whole content of the memory log. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public ResultRecord[] getMemoryLog() + throws IOException, InstanceNotFoundException; + + /** + * Gets the maximum number of records that can be logged in the + * memory log. + *

+ * A non positive value - 0 or negative - means that + * logging in memory is disabled. + *

+ *

The memory log is a FIFO: when its maximum capacity is reached, its + * head element is removed to make place for a new element at its tail. + *

+ * @return The maximum number of records that can be logged in the + * memory log. A value {@code <= 0} means that logging in memory is + * disabled. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public int getMemoryLogCapacity() + throws IOException, InstanceNotFoundException; + + /** + * Sets the maximum number of records that can be logged in the + * memory log. + *

The memory log is a FIFO: when its maximum capacity is reached, its + * head element is removed to make place for a new element at its tail. + *

+ * @param size The maximum number of result records that can be logged in the memory log.

+ * A non positive value - 0 or negative - means that + * logging in memory is disabled. It will also have the side + * effect of clearing the memory log. + *

+ * + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + */ + public void setMemoryLogCapacity(int size) + throws IOException, InstanceNotFoundException; + + /** + * Sets the maximum number of records that can be logged in the result log + * file. + *

When that maximum number of + * records is reached the {@link ResultLogManager} will rename + * the result log file by appending a '~' to its name, and a new empty + * log file will be created. + *

+ *

If logging to file is disabled calling this method + * is irrelevant. + *

+ * @param maxRecord maximum number of records to log in the result log file. + * @see #getLogFileName() + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void setLogFileCapacity(long maxRecord) + throws IOException, InstanceNotFoundException; + + /** + * Gets the maximum number of records that can be logged in the result log + * file. + *

When that maximum number of + * records is reached the {@link ResultLogManager} will rename + * the result log file by appending a '~' to its name, and a new empty + * log file will be created. + *

+ * @see #getLogFileName() + * @return The maximum number of records that can be logged in the result + * log file. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public long getLogFileCapacity() + throws IOException, InstanceNotFoundException; + + /** + * Gets The number of records that have been logged in the + * current result log file. This will always be less than + * {@link #getLogFileCapacity()}. + * @return The number of records in the + * current result log file. + * + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public long getLoggedCount() + throws IOException, InstanceNotFoundException; + + /** + * Clears the memory log and result log file. + * + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void clearLogs() + throws IOException, InstanceNotFoundException; +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirAgent.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirAgent.java new file mode 100644 index 0000000..f4bf1b6 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirAgent.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; +import javax.management.JMException; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationListener; + +/** + *

+ * The ScanDirAgent is the Agent class for the scandir + * application. + * This class contains the {@link #main} method to start a standalone + * scandir application. + *

+ *

+ * The {@link #main main()} method simply registers a {@link + * ScanManagerMXBean} in the platform MBeanServer - see {@link #init init}, + * and then waits for someone to call {@link ScanManagerMXBean#close close} + * on that MBean. + *

+ *

+ * When the {@link ScanManagerMXBean} state is switched to {@link + * ScanManagerMXBean.ScanState#CLOSED CLOSED}, {@link #cleanup cleanup} is + * called, the {@link ScanManagerMXBean} is unregistered, and the application + * terminates (i.e. the main thread completes). + *

+ * @author Sun Microsystems, 2006 - All rights reserved. + **/ +public class ScanDirAgent { + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(ScanDirAgent.class.getName()); + + // Proxy to the ScanManagerMXBean - created by init(); + // + private volatile ScanManagerMXBean proxy = null; + + // A queue to put received Notifications. + // + private final BlockingQueue queue; + + // A listener that will put notifications into the queue. + // + private final NotificationListener listener; + + /** + * Creates a new instance of ScanDirAgent + * You will need to call {@link #init()} later on in order to initialize + * the application. + * @see #main + **/ + public ScanDirAgent() { + // Initialize the notification queue + queue = new LinkedBlockingQueue(); + + // Creates the listener. + listener = new NotificationListener() { + public void handleNotification(Notification notification, + Object handback) { + try { + // Just put the received notification in the queue. + // It will be consumed later on by 'waitForClose()' + // + LOG.finer("Queuing received notification "+notification); + queue.put(notification); + } catch (InterruptedException ex) { + // OK + } + } + }; + } + + /** + * Initialize the application by registering a ScanManagerMXBean in + * the platform MBeanServer + * @throws java.io.IOException Registration failed for communication-related reasons. + * @throws javax.management.JMException Registration failed for JMX-related reasons. + */ + public void init() throws IOException, JMException { + + // Registers the ScanManagerMXBean singleton in the + // platform MBeanServer + // + proxy = ScanManager.register(); + + // Registers a NotificationListener with the ScanManagerMXBean in + // order to receive state changed notifications. + // + ((NotificationEmitter)proxy).addNotificationListener(listener,null,null); + } + + /** + * Cleanup after close: unregister the ScanManagerMXBean singleton. + * @throws java.io.IOException Cleanup failed for communication-related reasons. + * @throws javax.management.JMException Cleanup failed for JMX-related reasons. + */ + public void cleanup() throws IOException, JMException { + try { + ((NotificationEmitter)proxy). + removeNotificationListener(listener,null,null); + } finally { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } + } + + /** + * Wait for someone to call 'close()' on the ScanManagerMXBean singleton. + * Every time its state changes, the ScanManagerMXBean emits a notification. + * We don't rely on the notification content (if we were using a remote + * connection, we could miss some notifications) - we simply use the + * state change notifications to react more quickly to state changes. + * We do so simply by polling the {@link BlockingQueue} in which our + * listener is pushing notifications, and checking the ScanManagerMXBean + * state every time that a notification is received. + *

+ * We can do so because we know that once the ScanManagerMXBean state is + * switched to 'CLOSED', it will remain 'CLOSED' whatsoever.
+ * Therefore we don't need to concern ourselves with the possibility of + * missing the window in which the ScanManagerMXBean state's will be + * CLOSED, because that particular window stays opened forever. + *

+ * Had we wanted to wait for 'RUNNING', we would have needed to apply + * a different strategy - e.g. by taking into account the actual content + * of the state changed notifications we received. + * @throws java.io.IOException wait failed - a communication problem occurred. + * @throws javax.management.JMException wait failed - the MBeanServer threw an exception. + */ + public void waitForClose() throws IOException, JMException { + + // Wait until state is closed + while(proxy.getState() != ScanState.CLOSED ) { + try { + // Wake up at least every 30 seconds - if we missed a + // notification - we will at least get a chance to + // call getState(). 30 seconds is obviously quite + // arbitrary - if this were a real daemon - id'be tempted + // to wait 30 minutes - knowing that any incoming + // notification will wake me up anyway. + // Note: we simply use the state change notifications to + // react more quickly to state changes: see javadoc above. + // + queue.poll(30,TimeUnit.SECONDS); + } catch (InterruptedException ex) { + // OK + } + } + } + + /** + * The agent's main: {@link #init registers} a {@link ScanManagerMXBean}, + * {@link #waitForClose waits} until its state is {@link + * ScanManagerMXBean.ScanState#CLOSED CLOSED}, {@link #cleanup cleanup} + * and exits. + * @param args the command line arguments - ignored + * @throws java.io.IOException A communication problem occurred. + * @throws javax.management.JMException A JMX problem occurred. + */ + public static void main(String[] args) + throws IOException, JMException { + System.out.println("Initializing ScanManager..."); + final ScanDirAgent agent = new ScanDirAgent(); + agent.init(); + try { + System.out.println("Waiting for ScanManager to close..."); + agent.waitForClose(); + } finally { + System.out.println("Cleaning up..."); + agent.cleanup(); + } + } +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirClient.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirClient.java new file mode 100644 index 0000000..442a607 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirClient.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Map; +import javax.management.MBeanServerConnection; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.rmi.ssl.SslRMIClientSocketFactory; + +/** + * The ScanDirClient class is a very simple programmatic client example + * which is able to connect to a secured JMX scandir application. + *

The program initialize the connection environment map with the + * appropriate properties and credentials, and then connects to the + * secure JMX scandir daemon.

+ *

It gets the application's current configuration and prints it on + * its System.out.

+ *

The {@link #main main} method takes two arguments: the host on which + * the server is running (localhost), and the port number + * that was configured to start the server RMI Connector (4545). + *

+ * @author Sun Microsystems, 2006 - All rights reserved. + **/ +public class ScanDirClient { + + // This class has only a main. + private ScanDirClient() { } + + /** + * The usage string for the ScanDirClient. + */ + public static final String USAGE = ScanDirClient.class.getSimpleName() + + " "; + + /** + * Connects to a secured JMX scandir application. + * @param args The {@code main} method takes two parameters: + *
    + *
  • args[0] must be the server's host
  • + *
  • args[1] must be the rmi port number at which the + * JMX scandir daemon is listening for connections + * - that is, the port number of its JMX RMI Connector which + * was configured in {@code management.properties} + *
  • + *
      + **/ + public static void main(String[] args) { + try { + // Check args + // + if (args==null || args.length!=2) { + System.err.println("Bad number of arguments: usage is: \n\t" + + USAGE); + System.exit(1); + } + try { + InetAddress.getByName(args[0]); + } catch (UnknownHostException x) { + System.err.println("No such host: " + args[0]+ + "\n usage is: \n\t" + USAGE); + System.exit(2); + } catch (Exception x) { + System.err.println("Bad address: " + args[0]+ + "\n usage is: \n\t" + USAGE); + System.exit(2); + } + try { + if (Integer.parseInt(args[1]) <= 0) { + System.err.println("Bad port value: " + args[1]+ + "\n usage is: \n\t" + USAGE); + System.exit(2); + } + } catch (Exception x) { + System.err.println("Bad argument: " + args[1]+ + "\n usage is: \n\t" + USAGE); + System.exit(2); + } + + // Create an environment map to hold connection properties + // like credentials etc... We will later pass this map + // to the JMX Connector. + // + System.out.println("\nInitialize the environment map"); + final Map env = new HashMap(); + + // Provide the credentials required by the server + // to successfully perform user authentication + // + final String[] credentials = new String[] { "guest" , "guestpasswd" }; + env.put("jmx.remote.credentials", credentials); + + // Provide the SSL/TLS-based RMI Client Socket Factory required + // by the JNDI/RMI Registry Service Provider to communicate with + // the SSL/TLS-protected RMI Registry + // + env.put("com.sun.jndi.rmi.factory.socket", + new SslRMIClientSocketFactory()); + + // Create the RMI connector client and + // connect it to the RMI connector server + // args[0] is the server's host - localhost + // args[1] is the secure server port - 4545 + // + System.out.println("\nCreate the RMI connector client and " + + "connect it to the RMI connector server"); + final JMXServiceURL url = new JMXServiceURL( + "service:jmx:rmi:///jndi/rmi://"+args[0]+":"+args[1] + + "/jmxrmi"); + + System.out.println("Connecting to: "+url); + final JMXConnector jmxc = JMXConnectorFactory.connect(url, env); + + // Get an MBeanServerConnection + // + System.out.println("\nGet the MBeanServerConnection"); + final MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); + + // Create a proxy for the ScanManager MXBean + // + final ScanManagerMXBean proxy = + ScanManager.newSingletonProxy(mbsc); + + // Get the ScanDirConfig MXBean from the scan manager + // + System.out.println( + "\nGet ScanDirConfigMXBean from ScanManagerMXBean"); + final ScanDirConfigMXBean configMBean = + proxy.getConfigurationMBean(); + + // Print the scan dir configuration + // + System.out.println( + "\nGet 'Configuration' attribute on ScanDirConfigMXBean"); + System.out.println("\nConfiguration:\n" + + configMBean.getConfiguration()); + + // Try to invoke the "close" method on the ScanManager MXBean. + // + // Should get a SecurityException as the user "guest" doesn't + // have readwrite access. + // + System.out.println("\nInvoke 'close' on ScanManagerMXBean"); + try { + proxy.close(); + } catch (SecurityException e) { + System.out.println("\nGot expected security exception: " + e); + } + + // Close MBeanServer connection + // + System.out.println("\nClose the connection to the server"); + jmxc.close(); + System.out.println("\nBye! Bye!"); + } catch (Exception e) { + System.out.println("\nGot unexpected exception: " + e); + e.printStackTrace(); + System.exit(3); + } + } +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfig.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfig.java new file mode 100644 index 0000000..7ecd8a1 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfig.java @@ -0,0 +1,440 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import static com.sun.jmx.examples.scandir.ScanManager.getNextSeqNumber; +import static com.sun.jmx.examples.scandir.ScanDirConfigMXBean.SaveState.*; +import com.sun.jmx.examples.scandir.config.XmlConfigUtils; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.FileMatch; +import com.sun.jmx.examples.scandir.config.ScanManagerConfig; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.management.*; +import javax.xml.bind.JAXBException; + +/** + *

      The ScanDirConfig MBean is in charge of the + * scandir application configuration. + *

      + *

      The ScanDirConfig MBean is able to + * load and save the scandir application configuration to and from an + * XML file. + *

      + *

      + * It will let you also interactively modify that configuration, which you + * can later save to the file, by calling {@link #save}, or discard, by + * reloading the file without saving - see {@link #load}. + *

      + *

      + * There can be as many ScanDirConfigMXBean registered + * in the MBeanServer as you like, but only one of them will be identified as + * the current configuration of the {@link ScanManagerMXBean}. + * You can switch to another configuration by calling {@link + * ScanManagerMXBean#setConfigurationMBean + * ScanManagerMXBean.setConfigurationMBean}. + *

      + *

      + * Once the current configuration has been loaded (by calling {@link #load}) + * or modified (by calling one of {@link #addDirectoryScanner + * addDirectoryScanner}, {@link #removeDirectoryScanner removeDirectoryScanner} + * or {@link #setConfiguration setConfiguration}) it can be pushed + * to the {@link ScanManagerMXBean} by calling {@link + * ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration(true)} - + * true means that we apply the configuration from memory, + * without first reloading the file. + *

      + *

      + * The ScanDirConfig uses the XML annotated Java Beans defined + * in the {@link com.sun.jmx.examples.scandir.config} package. + *

      + *

      + * Note: The ScanDirConfig should probably use + * {@code java.nio.channels.FileLock} and lock its configuration file so that + * two ScanDirConfig object do not share the same file, but it + * doesn't. Feel free to improve the application in that way. + *

      + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class ScanDirConfig extends NotificationBroadcasterSupport + implements ScanDirConfigMXBean, MBeanRegistration { + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(ScanDirConfig.class.getName()); + + // We will emit a notification when the save state of this object + // chenges. We use directly the base notification class, with a + // notification type that indicates the new state at which the + // object has arrived. + // + // All these notification types will have the same prefix, which is + // 'com.sun.jmx.examples.scandir.config'. + // + private final static String NOTIFICATION_PREFIX = + ScanManagerConfig.class.getPackage().getName(); + + /** + * The com.sun.jmx.examples.scandir.config.saved notification + * indicates that the configuration data was saved. + **/ + public final static String NOTIFICATION_SAVED = + NOTIFICATION_PREFIX+".saved"; + /** + * The com.sun.jmx.examples.scandir.config.loaded notification + * indicates that the configuration data was loaded. + **/ + public final static String NOTIFICATION_LOADED = + NOTIFICATION_PREFIX+".loaded"; + + /** + * The com.sun.jmx.examples.scandir.config.modified notification + * indicates that the configuration data was modified. + **/ + public final static String NOTIFICATION_MODIFIED = + NOTIFICATION_PREFIX+".modified"; + + // The array of MBeanNotificationInfo that will be exposed in the + // ScanDirConfigMXBean MBeanInfo. + // We will pass this array to the NotificationBroadcasterSupport + // constructor. + // + private static MBeanNotificationInfo[] NOTIFICATION_INFO = { + new MBeanNotificationInfo( + new String[] {NOTIFICATION_SAVED}, + Notification.class.getName(), + "Emitted when the configuration is saved"), + new MBeanNotificationInfo( + new String[] {NOTIFICATION_LOADED}, + Notification.class.getName(), + "Emitted when the configuration is loaded"), + new MBeanNotificationInfo( + new String[] {NOTIFICATION_MODIFIED}, + Notification.class.getName(), + "Emitted when the configuration is modified"), + }; + + // The ScanDirConfigMXBean configuration data. + private volatile ScanManagerConfig config; + + // The name of the configuration file + private String filename = null; + + // The name of this configuration. This is usually both equal to + // config.getName() and objectName.getKeyProperty(name). + private volatile String configname = null; + + // This object save state. CREATED is the initial state. + // + private volatile SaveState status = CREATED; + + /** + * Creates a new {@link ScanDirConfigMXBean}. + *

      {@code ScanDirConfigMXBean} can be created by the {@link + * ScanManagerMXBean}, or directly by a remote client, using + * {@code createMBean} or {@code registerMBean}. + *

      + *

      {@code ScanDirConfigMXBean} created by the {@link + * ScanManagerMXBean} will be unregistered by the + * {@code ScanManagerMXBean}. {@code ScanDirConfigMXBean} created + * directly by a remote client will not be unregistered by the + * {@code ScanManagerMXBean} - this will remain to the responsibility of + * the code/client that created them. + *

      + *

      This object is created empty, you should call load() if you want it + * to load its data from the configuration file. + *

      + * @param filename The configuration file used by this MBean. + * Can be null (in which case load() and save() will fail). + * Can point to a file that does not exists yet (in which case + * load() will fail if called before save(), and save() will + * attempt to create that file). Can point to an existing file, + * in which case load() will load that file and save() will save + * to that file. + * + **/ + public ScanDirConfig(String filename) { + this(filename,null); + } + + /** + * Create a new ScanDirConfig MBean with an initial configuration. + * @param filename The name of the configuration file. + * @param initialConfig an initial configuration. + **/ + public ScanDirConfig(String filename, ScanManagerConfig initialConfig) { + super(NOTIFICATION_INFO); + this.filename = filename; + this.config = initialConfig; + } + + + // see ScanDirConfigMXBean + public void load() throws IOException { + if (filename == null) + throw new UnsupportedOperationException("load"); + + synchronized(this) { + config = new XmlConfigUtils(filename).readFromFile(); + if (configname != null) config = config.copy(configname); + else configname = config.getName(); + + status=LOADED; + } + sendNotification(NOTIFICATION_LOADED); + } + + // see ScanDirConfigMXBean + public void save() throws IOException { + if (filename == null) + throw new UnsupportedOperationException("load"); + synchronized (this) { + new XmlConfigUtils(filename).writeToFile(config); + status = SAVED; + } + sendNotification(NOTIFICATION_SAVED); + } + + // see ScanDirConfigMXBean + public ScanManagerConfig getConfiguration() { + synchronized (this) { + return XmlConfigUtils.xmlClone(config); + } + } + + + // sends a notification indicating the new save state. + private void sendNotification(String type) { + final Object source = (objectName==null)?this:objectName; + final Notification n = new Notification(type,source, + getNextSeqNumber(), + "The configuration is "+ + type.substring(type.lastIndexOf('.')+1)); + sendNotification(n); + } + + + /** + * Allows the MBean to perform any operations it needs before being + * registered in the MBean server. If the name of the MBean is not + * specified, the MBean can provide a name for its registration. If + * any exception is raised, the MBean will not be registered in the + * MBean server. + * @param server The MBean server in which the MBean will be registered. + * @param name The object name of the MBean. This name is null if the + * name parameter to one of the createMBean or registerMBean methods in + * the MBeanServer interface is null. In that case, this method will + * try to guess its MBean name by examining its configuration data. + * If its configuration data is null (nothing was provided in the + * constructor) or doesn't contain a name, this method returns {@code null}, + * and registration will fail. + *

      + * Otherwise, if {@code name} wasn't {@code null} or if a default name could + * be constructed, the name of the configuration will be set to + * the value of the ObjectName's {@code name=} key, and the configuration + * data will always be renamed to reflect this change. + *

      + * + * @return The name under which the MBean is to be registered. + * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public ObjectName preRegister(MBeanServer server, ObjectName name) + throws Exception { + if (name == null) { + if (config == null) return null; + if (config.getName() == null) return null; + name = ScanManager. + makeMBeanName(ScanDirConfigMXBean.class,config.getName()); + } + objectName = name; + mbeanServer = server; + synchronized (this) { + configname = name.getKeyProperty("name"); + if (config == null) config = new ScanManagerConfig(configname); + else config = config.copy(configname); + } + return name; + } + + /** + * Allows the MBean to perform any operations needed after having + * been registered in the MBean server or after the registration has + * failed. + *

      This implementation does nothing

      + * @param registrationDone Indicates whether or not the MBean has been + * successfully registered in the MBean server. The value false means + * that the registration has failed. + */ + public void postRegister(Boolean registrationDone) { + // Nothing to do here. + } + + /** + * Allows the MBean to perform any operations it needs before being + * unregistered by the MBean server. + *

      This implementation does nothing

      + * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public void preDeregister() throws Exception { + // Nothing to do here. + } + + /** + * Allows the MBean to perform any operations needed after having been + * unregistered in the MBean server. + *

      This implementation does nothing

      + */ + public void postDeregister() { + // Nothing to do here. + } + + // see ScanDirConfigMXBean + public String getConfigFilename() { + return filename; + } + + // see ScanDirConfigMXBean + public void setConfiguration(ScanManagerConfig config) { + synchronized (this) { + if (config == null) { + this.config = null; + return; + } + + if (configname == null) + configname = config.getName(); + + this.config = config.copy(configname); + status = MODIFIED; + } + sendNotification(NOTIFICATION_MODIFIED); + } + + // see ScanDirConfigMXBean + public DirectoryScannerConfig + addDirectoryScanner(String name, String dir, String filePattern, + long sizeExceedsMaxBytes, long sinceLastModified) { + final DirectoryScannerConfig scanner = + new DirectoryScannerConfig(name); + scanner.setRootDirectory(dir); + if (filePattern!=null||sizeExceedsMaxBytes>0||sinceLastModified>0) { + final FileMatch filter = new FileMatch(); + filter.setFilePattern(filePattern); + filter.setSizeExceedsMaxBytes(sizeExceedsMaxBytes); + if (sinceLastModified > 0) + filter.setLastModifiedBefore(new Date(new Date().getTime() + -sinceLastModified)); + scanner.addIncludeFiles(filter); + } + synchronized (this) { + config.putScan(scanner); + status = MODIFIED; + } + LOG.fine("config: "+config); + sendNotification(NOTIFICATION_MODIFIED); + return scanner; + } + + // see ScanDirConfigMXBean + public DirectoryScannerConfig removeDirectoryScanner(String name) + throws IOException, InstanceNotFoundException { + final DirectoryScannerConfig scanner; + synchronized (this) { + scanner = config.removeScan(name); + if (scanner == null) + throw new IllegalArgumentException(name+": scanner not found"); + status = MODIFIED; + } + sendNotification(NOTIFICATION_MODIFIED); + return scanner; + } + + // see ScanDirConfigMXBean + public SaveState getSaveState() { + return status; + } + + // These methods are used by ScanManager to guess a configuration name from + // a configuration filename. + // + static String DEFAULT = "DEFAULT"; + + private static String getBasename(String name) { + final int dot = name.indexOf('.'); + if (dot<0) return name; + if (dot==0) return getBasename(name.substring(1)); + return name.substring(0,dot); + } + + static String guessConfigName(String configFileName,String defaultFile) { + try { + if (configFileName == null) return DEFAULT; + final File f = new File(configFileName); + if (f.canRead()) { + final String confname = XmlConfigUtils.read(f).getName(); + if (confname != null && confname.length()>0) return confname; + } + final File f2 = new File(defaultFile); + if (f.equals(f2)) return DEFAULT; + final String guess = getBasename(f.getName()); + if (guess == null) return DEFAULT; + if (guess.length()==0) return DEFAULT; + return guess; + } catch (Exception x) { + return DEFAULT; + } + } + + // Set by preRegister() + private volatile MBeanServer mbeanServer; + private volatile ObjectName objectName; + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfigMXBean.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfigMXBean.java new file mode 100644 index 0000000..eb4f375 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanDirConfigMXBean.java @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.ScanManagerConfig; +import java.io.IOException; +import javax.management.InstanceNotFoundException; + +/** + *

      The ScanDirConfigMXBean is in charge of the + * scandir application configuration. + *

      + *

      The ScanDirConfigMXBean is an MBean which is able to + * load and save the scandir application configuration to and from an + * XML file. + *

      + *

      + * It will let you also interactively modify that configuration, which you + * can later save to the file, by calling {@link #save}, or discard, by + * reloading the file without saving - see {@link #load}. + *

      + *

      + * There can be as many ScanDirConfigMXBean registered + * in the MBeanServer as you like, but only one of them will be identified as + * the current configuration of the {@link ScanManagerMXBean}. + * You can switch to another configuration by calling {@link + * ScanManagerMXBean#setConfigurationMBean + * ScanManagerMXBean.setConfigurationMBean}. + *

      + *

      + * Once the current configuration has been loaded (by calling {@link #load}) + * or modified (by calling one of {@link #addDirectoryScanner + * addDirectoryScanner}, {@link #removeDirectoryScanner removeDirectoryScanner} + * or {@link #setConfiguration setConfiguration}) it can be pushed + * to the {@link ScanManagerMXBean} by calling {@link + * ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration(true)} - + * true means that we apply the configuration from memory, + * without first reloading the file. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public interface ScanDirConfigMXBean { + /** + * This state tells whether the configuration reflected by the + * {@link ScanDirConfigMXBean} was loaded in memory, saved to the + * configuration file, or modified since last saved. + * Note that this state doesn't tell whether the configuration was + * applied by the {@link ScanManagerMXBean}. + **/ + public enum SaveState { + /** + * Initial state: the {@link ScanDirConfigMXBean} is created, but + * neither {@link #load} or {@link #save} was yet called. + **/ + CREATED, + + /** + * The configuration reflected by the {@link ScanDirConfigMXBean} has + * been loaded, but not modified yet. + **/ + LOADED, + + /** + * The configuration was modified. The modifications are held in memory. + * Call {@link #save} to save them to the file, or {@link #load} to + * reload the file and discard them. + **/ + MODIFIED, + + /** + * The configuration was saved. + **/ + SAVED + }; + + /** + * Loads the configuration from the {@link + * #getConfigFilename configuration file}. + *

      Any unsaved modification will be lost. The {@link #getSaveState state} + * is switched to {@link SaveState#LOADED LOADED}. + *

      + *

      + * This action has no effect on the {@link ScanManagerMXBean} until + * {@link ScanManagerMXBean#getConfigurationMBean ScanManagerMXBean} + * points to this MBean and {@link ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration} is called. + *

      + * @see #getSaveState() + * @throws IOException The configuration couldn't be loaded from the file, + * e.g. because the file doesn't exist or isn't + * readable. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void load() + throws IOException, InstanceNotFoundException; + + /** + * Saves the configuration to the {@link + * #getConfigFilename configuration file}. + * + *

      If the configuration file doesn't exists, this method will + * attempt to create it. Otherwise, the existing file will + * be renamed by appending a '~' to its name, and a new file + * will be created, in which the configuration will be saved. + * The {@link #getSaveState state} + * is switched to {@link SaveState#SAVED SAVED}. + *

      + *

      + * This action has no effect on the {@link ScanManagerMXBean}. + *

      + * @see #getSaveState() + * + * @throws IOException The configuration couldn't be saved to the file, + * e.g. because the file couldn't be created. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void save() + throws IOException, InstanceNotFoundException; + + /** + * Gets the name of the configuration file. + *

      If the configuration file doesn't exists, {@link #load} will fail + * and {@link #save} will attempt to create the file. + *

      + * + * @return The configuration file name for this MBean. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public String getConfigFilename() + throws IOException, InstanceNotFoundException; + + /** + * Gets the current configuration data. + *

      + * This method returns the configuration data which is currently held + * in memory. + *

      + *

      Call {@link #load} to reload the data from the configuration + * file, and {@link #save} to save the data to the configuration + * file. + *

      + * @see #getSaveState() + * @return The current configuration data in memory. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public ScanManagerConfig getConfiguration() + throws IOException, InstanceNotFoundException; + + /** + * Sets the current configuration data. + *

      + * This method replaces the configuration data in memory. + * The {@link #getSaveState state} is switched to {@link + * SaveState#MODIFIED MODIFIED}. + *

      + *

      Calling {@link #load} will reload the data from the configuration + * file, and all modifications will be lost. + * Calling {@link #save} will save the modified data to the configuration + * file. + *

      + *

      + * This action has no effect on the {@link ScanManagerMXBean} until + * {@link ScanManagerMXBean#getConfigurationMBean ScanManagerMXBean} + * points to this MBean and {@link ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration} is called. + *

      + * @param config The new configuration data. + * @see #getSaveState() + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + */ + public void setConfiguration(ScanManagerConfig config) + throws IOException, InstanceNotFoundException; + + /** + * Adds a new directory scanner to the current configuration data. + *

      + * This method updates the configuration data in memory, adding + * a {@link DirectoryScannerConfig} to the {@link + * ScanManagerConfig#getScanList directory scanner list}. + * The {@link #getSaveState state} is switched to {@link + * SaveState#MODIFIED MODIFIED}. + *

      + *

      Calling {@link #load} will reload the data from the configuration + * file, and all modifications will be lost. + * Calling {@link #save} will save the modified data to the configuration + * file. + *

      + *

      + * This action has no effect on the {@link ScanManagerMXBean} until + * {@link ScanManagerMXBean#getConfigurationMBean ScanManagerMXBean} + * points to this MBean and {@link ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration} is called. + *

      + * @param name A name for the new directory scanner. This is the value + * that will be later used in the {@link DirectoryScannerMXBean} + * ObjectName for the name= key. + * @param dir The root directory at which this scanner will start scanning. + * @param filePattern A {@link java.util.regex.Pattern regular expression} + * to match against a selected file name. + * @param sizeExceedsMaxBytes Only file whose size exceeds that limit will + * be selected. or a + * negative value means no limit. + * @param sinceLastModified Select files which haven't been modified for + * that number of milliseconds - i.e. + * {@code sinceLastModified=3600000} will exclude files which + * have been modified in the last hour. + * The date of last modification is ignored if 0 or a + * negative value is provided. + * @see #getSaveState() + * @return The added DirectoryScannerConfig. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public DirectoryScannerConfig + addDirectoryScanner(String name, String dir, String filePattern, + long sizeExceedsMaxBytes, long sinceLastModified) + throws IOException, InstanceNotFoundException; + + /** + * Removes a directory scanner from the current configuration data. + *

      + * This method updates the configuration data in memory, removing + * a {@link DirectoryScannerConfig} from the {@link + * ScanManagerConfig#getScanList directory scanner list}. + * The {@link #getSaveState state} is switched to {@link + * SaveState#MODIFIED MODIFIED}. + *

      + *

      Calling {@link #load} will reload the data from the configuration + * file, and all modifications will be lost. + * Calling {@link #save} will save the modified data to the configuration + * file. + *

      + *

      + * This action has no effect on the {@link ScanManagerMXBean} until + * {@link ScanManagerMXBean#getConfigurationMBean ScanManagerMXBean} + * points to this MBean and {@link ScanManagerMXBean#applyConfiguration + * ScanManagerMXBean.applyConfiguration} is called. + *

      + * @param name The name of the new directory scanner. This is the value + * that is used in the {@link DirectoryScannerMXBean} + * ObjectName for the name= key. + * @return The removed DirectoryScannerConfig. + * @throws IllegalArgumentException if there's no directory scanner by + * that name in the current configuration data. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public DirectoryScannerConfig + removeDirectoryScanner(String name) + throws IOException, InstanceNotFoundException; + + /** + * Gets the save state of the current configuration data. + *

      + * {@link SaveState#CREATED CREATED} means that the configuration data was just + * created. It has not been loaded from the configuration file. + * Calling {@link #load} will load the data from the configuration file. + * Calling {@link #save} will write the empty data to the configuration + * file. + *

      + *

      + * {@link SaveState#LOADED LOADED} means that the configuration data + * was loaded from the configuration file. + *

      + *

      + * {@link SaveState#MODIFIED MODIFIED} means that the configuration data + * was modified since it was last loaded or saved. + * Calling {@link #load} will reload the data from the configuration file, + * and all modifications will be lost. + * Calling {@link #save} will write the modified data to the configuration + * file. + *

      + *

      + * {@link SaveState#SAVED SAVED} means that the configuration data + * was saved to the configuration file. + *

      + *

      + * This state doesn't indicate whether this MBean configuration data + * was {@link ScanManagerMXBean#applyConfiguration applied} by the + * {@link ScanManagerMXBean}. + *

      + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + * @return The save state of the {@code ScanDirConfigMXBean}. + */ + public SaveState getSaveState() + throws IOException, InstanceNotFoundException; + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManager.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManager.java new file mode 100644 index 0000000..e34b12a --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManager.java @@ -0,0 +1,1160 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import static com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState.*; +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.ScanManagerConfig; +import java.io.File; + +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.management.AttributeChangeNotification; +import javax.management.InstanceNotFoundException; +import javax.management.JMException; +import javax.management.JMX; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.Notification; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.ObjectInstance; +import javax.management.ObjectName; + +/** + *

      + * The ScanManager is responsible for applying a configuration, + * starting and scheduling directory scans, and reporting application state. + *

      + *

      + * The ScanManager MBean is a singleton MBean which controls + * scan session. The ScanManager name is defined by + * {@link #SCAN_MANAGER_NAME ScanManager.SCAN_MANAGER_NAME}. + *

      + *

      + * The ScanManager MBean is the entry point of the scandir + * application management interface. It is from this MBean that all other MBeans + * will be created and registered. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class ScanManager implements ScanManagerMXBean, + NotificationEmitter, MBeanRegistration { + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(ScanManager.class.getName()); + + /** + * The name of the ScanManager singleton MBean. + **/ + public final static ObjectName SCAN_MANAGER_NAME = + makeSingletonName(ScanManagerMXBean.class); + + /** + * Sequence number used for sending notifications. We use this + * sequence number throughout the application. + **/ + private static long seqNumber=0; + + /** + * The NotificationBroadcasterSupport object used to handle + * listener registration. + **/ + private final NotificationBroadcasterSupport broadcaster; + + /** + * The MBeanServer in which this MBean is registered. We obtain + * this reference by implementing the {@link MBeanRegistration} + * interface. + **/ + private volatile MBeanServer mbeanServer; + + /** + * A queue of pending notifications we are about to send. + * We're using a BlockingQueue in order to avoid sending + * notifications from within a synchronized block. + **/ + private final BlockingQueue pendingNotifs; + + /** + * The state of the scan session. + **/ + private volatile ScanState state = STOPPED; + + /** + * The list of DirectoryScannerMBean that are run by a scan session. + **/ + private final Map scanmap; + + /** + * The list of ScanDirConfigMXBean that were created by this MBean. + **/ + private final Map configmap; + + // The ResultLogManager for this application. + private final ResultLogManager log; + + /** + * We use a semaphore to ensure proper sequencing of exclusive + * action. The logic we have implemented is to fail - rather + * than block, if an exclusive action is already in progress. + **/ + private final Semaphore sequencer = new Semaphore(1); + + // A proxy to the current ScanDirConfigMXBean which holds the current + // configuration data. + // + private volatile ScanDirConfigMXBean config = null; + + // Avoid to write parameters twices when creating a new ConcurrentHashMap. + // + private static Map newConcurrentHashMap() { + return new ConcurrentHashMap(); + } + + // Avoid to write parameters twices when creating a new HashMap. + // + private static Map newHashMap() { + return new HashMap(); + } + + /** + * Creates a default singleton ObjectName for a given class. + * @param clazz The interface class of the MBean for which we want to obtain + * a default singleton name, or its implementation class. + * Give one or the other depending on what you wish to see in + * the value of the key {@code type=}. + * @return A default singleton name for a singleton MBean class. + * @throws IllegalArgumentException if the name can't be created + * for some unfathomable reason (e.g. an unexpected + * exception was raised). + **/ + public final static ObjectName makeSingletonName(Class clazz) { + try { + final Package p = clazz.getPackage(); + final String packageName = (p==null)?null:p.getName(); + final String className = clazz.getSimpleName(); + final String domain; + if (packageName == null || packageName.length()==0) { + // We use a reference to ScanDirAgent.class to ease + // to keep track of possible class renaming. + domain = ScanDirAgent.class.getSimpleName(); + } else { + domain = packageName; + } + final ObjectName name = new ObjectName(domain,"type",className); + return name; + } catch (Exception x) { + final IllegalArgumentException iae = + new IllegalArgumentException(String.valueOf(clazz),x); + throw iae; + } + } + + /** + * Creates a default ObjectName with keys type= and + * name= for an instance of a given MBean interface class. + * @param clazz The interface class of the MBean for which we want to obtain + * a default name, or its implementation class. + * Give one or the other depending on what you wish to see in + * the value of the key {@code type=}. + * @param name The value of the name= key. + * @return A default name for an instance of the given MBean interface class. + * @throws IllegalArgumentException if the name can't be created. + * (e.g. an unexpected exception was raised). + **/ + public static final ObjectName makeMBeanName(Class clazz, String name) { + try { + return ObjectName. + getInstance(makeSingletonName(clazz) + .toString()+",name="+name); + } catch (MalformedObjectNameException x) { + final IllegalArgumentException iae = + new IllegalArgumentException(String.valueOf(name),x); + throw iae; + } + } + + /** + * Return the ObjectName for a DirectoryScannerMXBean of that name. + * This is {@code makeMBeanName(DirectoryScannerMXBean.class,name)}. + * @param name The value of the name= key. + * @return the ObjectName for a DirectoryScannerMXBean of that name. + */ + public static final ObjectName makeDirectoryScannerName(String name) { + return makeMBeanName(DirectoryScannerMXBean.class,name); + } + + /** + * Return the ObjectName for a {@code ScanDirConfigMXBean} of that name. + * This is {@code makeMBeanName(ScanDirConfigMXBean.class,name)}. + * @param name The value of the name= key. + * @return the ObjectName for a {@code ScanDirConfigMXBean} of that name. + */ + public static final ObjectName makeScanDirConfigName(String name) { + return makeMBeanName(ScanDirConfigMXBean.class,name); + } + + /** + * Create and register a new singleton instance of the ScanManager + * MBean in the given {@link MBeanServerConnection}. + * @param mbs The MBeanServer in which the new singleton instance + * should be created. + * @throws JMException The MBeanServer connection raised an exception + * while trying to instantiate and register the singleton MBean + * instance. + * @throws IOException There was a connection problem while trying to + * communicate with the underlying MBeanServer. + * @return A proxy for the registered MBean. + **/ + public static ScanManagerMXBean register(MBeanServerConnection mbs) + throws IOException, JMException { + final ObjectInstance moi = + mbs.createMBean(ScanManager.class.getName(),SCAN_MANAGER_NAME); + final ScanManagerMXBean proxy = + JMX.newMXBeanProxy(mbs,moi.getObjectName(), + ScanManagerMXBean.class,true); + return proxy; + } + + /** + * Creates a new {@code ScanManagerMXBean} proxy over the given + * {@code MBeanServerConnection}. Does not check whether a + * {@code ScanManagerMXBean} + * is actually registered in that {@code MBeanServerConnection}. + * @return a new {@code ScanManagerMXBean} proxy. + * @param mbs The {@code MBeanServerConnection} which holds the + * {@code ScanManagerMXBean} to proxy. + */ + public static ScanManagerMXBean + newSingletonProxy(MBeanServerConnection mbs) { + final ScanManagerMXBean proxy = + JMX.newMXBeanProxy(mbs,SCAN_MANAGER_NAME, + ScanManagerMXBean.class,true); + return proxy; + } + + /** + * Creates a new {@code ScanManagerMXBean} proxy over the platform + * {@code MBeanServer}. This is equivalent to + * {@code newSingletonProxy(ManagementFactory.getPlatformMBeanServer())}. + * @return a new {@code ScanManagerMXBean} proxy. + **/ + public static ScanManagerMXBean newSingletonProxy() { + return newSingletonProxy(ManagementFactory.getPlatformMBeanServer()); + } + + /** + * Create and register a new singleton instance of the ScanManager + * MBean in the given {@link MBeanServerConnection}. + * @throws JMException The MBeanServer connection raised an exception + * while trying to instantiate and register the singleton MBean + * instance. + * @throws IOException There was a connection problem while trying to + * communicate with the underlying MBeanServer. + * @return A proxy for the registered MBean. + **/ + public static ScanManagerMXBean register() + throws IOException, JMException { + final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + return register(mbs); + } + + /** + * Create a new ScanManager MBean + **/ + public ScanManager() { + broadcaster = new NotificationBroadcasterSupport(); + pendingNotifs = new LinkedBlockingQueue(100); + scanmap = newConcurrentHashMap(); + configmap = newConcurrentHashMap(); + log = new ResultLogManager(); + } + + + // Creates a new DirectoryScannerMXBean, from the given configuration data. + DirectoryScannerMXBean createDirectoryScanner(DirectoryScannerConfig config) { + return new DirectoryScanner(config,log); + } + + // Applies a configuration. + // throws IllegalStateException if lock can't be acquired. + // Unregisters all existing directory scanners, the create and registers + // new directory scanners according to the given config. + // Then pushes the log config to the result log manager. + // + private void applyConfiguration(ScanManagerConfig bean) + throws IOException, JMException { + if (bean == null) return; + if (!sequencer.tryAcquire()) { + throw new IllegalStateException("Can't acquire lock"); + } + try { + unregisterScanners(); + final DirectoryScannerConfig[] scans = bean.getScanList(); + if (scans == null) return; + for (DirectoryScannerConfig scan : scans) { + addDirectoryScanner(scan); + } + log.setConfig(bean.getInitialResultLogConfig()); + } finally { + sequencer.release(); + } + } + + // See ScanManagerMXBean + public void applyConfiguration(boolean fromMemory) + throws IOException, JMException { + if (fromMemory == false) config.load(); + applyConfiguration(config.getConfiguration()); + } + + // See ScanManagerMXBean + public void applyCurrentResultLogConfig(boolean toMemory) + throws IOException, JMException { + final ScanManagerConfig bean = config.getConfiguration(); + bean.setInitialResultLogConfig(log.getConfig()); + config.setConfiguration(bean); + if (toMemory==false) config.save(); + } + + // See ScanManagerMXBean + public void setConfigurationMBean(ScanDirConfigMXBean config) { + this.config = config; + } + + // See ScanManagerMXBean + public ScanDirConfigMXBean getConfigurationMBean() { + return config; + } + + // Creates and registers a new directory scanner. + // Called by applyConfiguration. + // throws IllegalStateException if state is not STOPPED or COMPLETED + // (you cannot change the config while scanning is scheduled or running). + // + private DirectoryScannerMXBean addDirectoryScanner( + DirectoryScannerConfig bean) + throws JMException { + try { + final DirectoryScannerMXBean scanner; + final ObjectName scanName; + synchronized (this) { + if (state != STOPPED && state != COMPLETED) + throw new IllegalStateException(state.toString()); + scanner = createDirectoryScanner(bean); + scanName = makeDirectoryScannerName(bean.getName()); + } + LOG.fine("server: "+mbeanServer); + LOG.fine("scanner: "+scanner); + LOG.fine("scanName: "+scanName); + final ObjectInstance moi = + mbeanServer.registerMBean(scanner,scanName); + final ObjectName moiName = moi.getObjectName(); + final DirectoryScannerMXBean proxy = + JMX.newMXBeanProxy(mbeanServer,moiName, + DirectoryScannerMXBean.class,true); + scanmap.put(moiName,proxy); + return proxy; + } catch (RuntimeException x) { + final String msg = "Operation failed: "+x; + if (LOG.isLoggable(Level.FINEST)) + LOG.log(Level.FINEST,msg,x); + else LOG.fine(msg); + throw x; + } catch (JMException x) { + final String msg = "Operation failed: "+x; + if (LOG.isLoggable(Level.FINEST)) + LOG.log(Level.FINEST,msg,x); + else LOG.fine(msg); + throw x; + } + } + + // See ScanManagerMXBean + public ScanDirConfigMXBean createOtherConfigurationMBean(String name, + String filename) + throws JMException { + final ScanDirConfig profile = new ScanDirConfig(filename); + final ObjectName profName = makeScanDirConfigName(name); + final ObjectInstance moi = mbeanServer.registerMBean(profile,profName); + final ScanDirConfigMXBean proxy = + JMX.newMXBeanProxy(mbeanServer,profName, + ScanDirConfigMXBean.class,true); + configmap.put(moi.getObjectName(),proxy); + return proxy; + } + + + // See ScanManagerMXBean + public Map getDirectoryScanners() { + final Map proxyMap = newHashMap(); + for (Entry item : scanmap.entrySet()){ + proxyMap.put(item.getKey().getKeyProperty("name"),item.getValue()); + } + return proxyMap; + } + + // --------------------------------------------------------------- + // State Management + // --------------------------------------------------------------- + + /** + * For each operation, this map stores a list of states from + * which the corresponding operation can be legally called. + * For instance, it is legal to call "stop" regardless of the + * application state. However, "schedule" can be called only if + * the application state is STOPPED, etc... + **/ + private final static Map> allowedStates; + static { + allowedStates = newHashMap(); + // You can always call stop + allowedStates.put("stop",EnumSet.allOf(ScanState.class)); + + // You can only call closed when stopped + allowedStates.put("close",EnumSet.of(STOPPED,COMPLETED,CLOSED)); + + // You can call schedule only when the current task is + // completed or stopped. + allowedStates.put("schedule",EnumSet.of(STOPPED,COMPLETED)); + + // switch reserved for background task: goes from SCHEDULED to + // RUNNING when it enters the run() method. + allowedStates.put("scan-running",EnumSet.of(SCHEDULED)); + + // switch reserved for background task: goes from RUNNING to + // SCHEDULED when it has completed but needs to reschedule + // itself for specified interval. + allowedStates.put("scan-scheduled",EnumSet.of(RUNNING)); + + // switch reserved for background task: + // goes from RUNNING to COMPLETED upon successful completion + allowedStates.put("scan-done",EnumSet.of(RUNNING)); + } + + // Get this object's state. No need to synchronize because + // state is volatile. + // See ScanManagerMXBean + public ScanState getState() { + return state; + } + + /** + * Enqueue a state changed notification for the given states. + **/ + private void queueStateChangedNotification( + long sequence, + long time, + ScanState old, + ScanState current) { + final AttributeChangeNotification n = + new AttributeChangeNotification(SCAN_MANAGER_NAME,sequence,time, + "ScanManager State changed to "+current,"State", + ScanState.class.getName(),old.toString(),current.toString()); + // Queue the notification. We have created an unlimited queue, so + // this method should always succeed. + try { + if (!pendingNotifs.offer(n,2,TimeUnit.SECONDS)) { + LOG.fine("Can't queue Notification: "+n); + } + } catch (InterruptedException x) { + LOG.fine("Can't queue Notification: "+x); + } + } + + /** + * Send all notifications present in the queue. + **/ + private void sendQueuedNotifications() { + Notification n; + while ((n = pendingNotifs.poll()) != null) { + broadcaster.sendNotification(n); + } + } + + /** + * Checks that the current state is allowed for the given operation, + * and if so, switch its value to the new desired state. + * This operation also enqueue the appropriate state changed + * notification. + **/ + private ScanState switchState(ScanState desired,String forOperation) { + return switchState(desired,allowedStates.get(forOperation)); + } + + /** + * Checks that the current state is one of the allowed states, + * and if so, switch its value to the new desired state. + * This operation also enqueue the appropriate state changed + * notification. + **/ + private ScanState switchState(ScanState desired,EnumSet allowed) { + final ScanState old; + final long timestamp; + final long sequence; + synchronized(this) { + old = state; + if (!allowed.contains(state)) + throw new IllegalStateException(state.toString()); + state = desired; + timestamp = System.currentTimeMillis(); + sequence = getNextSeqNumber(); + } + LOG.fine("switched state: "+old+" -> "+desired); + if (old != desired) + queueStateChangedNotification(sequence,timestamp,old,desired); + return old; + } + + + // --------------------------------------------------------------- + // schedule() creates a new SessionTask that will be executed later + // (possibly right away if delay=0) by a Timer thread. + // --------------------------------------------------------------- + + // The timer used by this object. Lazzy evaluation. Cleaned in + // postDeregister() + // + private Timer timer = null; + + // See ScanManagerMXBean + public void schedule(long delay, long interval) { + if (!sequencer.tryAcquire()) { + throw new IllegalStateException("Can't acquire lock"); + } + try { + LOG.fine("scheduling new task: state="+state); + final ScanState old = switchState(SCHEDULED,"schedule"); + final boolean scheduled = + scheduleSession(new SessionTask(interval),delay); + if (scheduled) + LOG.fine("new task scheduled: state="+state); + } finally { + sequencer.release(); + } + sendQueuedNotifications(); + } + + // Schedule a SessionTask. The session task may reschedule + // a new identical task when it eventually ends. + // We use this logic so that the 'interval' time is measured + // starting at the end of the task that finishes, rather than + // at its beginning. Therefore if a repeated task takes x ms, + // it will be repeated every x+interval ms. + // + private synchronized boolean scheduleSession(SessionTask task, long delay) { + if (state == STOPPED) return false; + if (timer == null) timer = new Timer("ScanManager"); + tasklist.add(task); + timer.schedule(task,delay); + return true; + } + + // --------------------------------------------------------------- + // start() is equivalent to schedule(0,0) + // --------------------------------------------------------------- + + // See ScanManagerMXBean + public void start() throws IOException, InstanceNotFoundException { + schedule(0,0); + } + + // --------------------------------------------------------------- + // Methods used to implement stop() - stop() is asynchronous, + // and needs to notify any running background task that it needs + // to stop. It also needs to prevent scheduled task from being + // run. + // --------------------------------------------------------------- + + // See ScanManagerMXBean + public void stop() { + if (!sequencer.tryAcquire()) + throw new IllegalStateException("Can't acquire lock"); + int errcount = 0; + final StringBuilder b = new StringBuilder(); + + try { + switchState(STOPPED,"stop"); + + errcount += cancelSessionTasks(b); + errcount += stopDirectoryScanners(b); + } finally { + sequencer.release(); + } + + sendQueuedNotifications(); + if (errcount > 0) { + b.insert(0,"stop partially failed with "+errcount+" error(s):"); + throw new RuntimeException(b.toString()); + } + } + + // See ScanManagerMXBean + public void close() { + switchState(CLOSED,"close"); + sendQueuedNotifications(); + } + + // Appends exception to a StringBuilder message. + // + private void append(StringBuilder b,String prefix,Throwable t) { + final String first = (prefix==null)?"\n":"\n"+prefix; + b.append(first).append(String.valueOf(t)); + Throwable cause = t; + while ((cause = cause.getCause())!=null) { + b.append(first).append("Caused by:").append(first); + b.append('\t').append(String.valueOf(cause)); + } + } + + // Cancels all scheduled session tasks + // + private int cancelSessionTasks(StringBuilder b) { + int errcount = 0; + // Stops scheduled tasks if any... + // + for (SessionTask task : tasklist) { + try { + task.cancel(); + tasklist.remove(task); + } catch (Exception ex) { + errcount++; + append(b,"\t",ex); + } + } + return errcount; + } + + // Stops all DirectoryScanners configured for this object. + // + private int stopDirectoryScanners(StringBuilder b) { + int errcount = 0; + // Stops directory scanners if any... + // + for (DirectoryScannerMXBean s : scanmap.values()) { + try { + s.stop(); + } catch (Exception ex) { + errcount++; + append(b,"\t",ex); + } + } + return errcount; + } + + + // --------------------------------------------------------------- + // We start scanning in background in a Timer thread. + // The methods below implement that logic. + // --------------------------------------------------------------- + + private void scanAllDirectories() + throws IOException, InstanceNotFoundException { + + int errcount = 0; + final StringBuilder b = new StringBuilder(); + for (ObjectName key : scanmap.keySet()) { + final DirectoryScannerMXBean s = scanmap.get(key); + try { + if (state == STOPPED) return; + s.scan(); + } catch (Exception ex) { + LOG.log(Level.FINE,key + " failed to scan: "+ex,ex); + errcount++; + append(b,"\t",ex); + } + } + if (errcount > 0) { + b.insert(0,"scan partially performed with "+errcount+" error(s):"); + throw new RuntimeException(b.toString()); + } + } + + // List of scheduled session task. Needed by stop() to cancel + // scheduled sessions. There's usually at most 1 session in + // this list (unless there's a bug somewhere ;-)) + // + private final ConcurrentLinkedQueue tasklist = + new ConcurrentLinkedQueue(); + + // Used to give a unique id to session task - useful for + // debugging. + // + private volatile static long taskcount = 0; + + /** + * A session task will be scheduled to run in background in a + * timer thread. There can be at most one session task running + * at a given time (this is ensured by using a timer - which is + * a single threaded object). + * + * If the session needs to be repeated, it will reschedule an + * identical session when it finishes to run. This ensure that + * two session runs are separated by the given interval time. + * + **/ + private class SessionTask extends TimerTask { + + /** + * Delay after which the next iteration of this task will + * start. This delay is measured starting at the end of + * the previous iteration. + **/ + final long delayBeforeNext; + + /** + * A unique id for this task. + **/ + final long taskid; + + /** + * Whether it's been cancelled by stop() + **/ + volatile boolean cancelled=false; + + /** + * create a new SessionTask. + **/ + SessionTask(long scheduleNext) { + delayBeforeNext = scheduleNext; + taskid = taskcount++; + } + + /** + * When run() begins, the state is switched to RUNNING. + * When run() ends then: + * If the task is repeated, the state will be switched + * to SCHEDULED (because a new task was scheduled). + * Otherwise the state will be switched to either + * STOPPED (if it was stopped before it could complete) + * or COMPLETED (if it completed gracefully) + * This method is used to switch to the desired state and + * send the appropriate notifications. + * When entering the method, we check whether the state is + * STOPPED. If so, we return false - and the SessionTask will + * stop. Otherwise, we switch the state to the desired value. + **/ + private boolean notifyStateChange(ScanState newState,String condition) { + synchronized (ScanManager.this) { + if (state == STOPPED || state == CLOSED) return false; + switchState(newState,condition); + } + sendQueuedNotifications(); + return true; + } + + // Cancels this task. + public boolean cancel() { + cancelled=true; + return super.cancel(); + } + + /** + * Invoke all directories scanners in sequence. At each + * step, checks to see whether the task should stop. + **/ + private boolean execute() { + final String tag = "Scheduled session["+taskid+"]"; + try { + if (cancelled) { + LOG.finer(tag+" cancelled: done"); + return false; + } + if (!notifyStateChange(RUNNING,"scan-running")) { + LOG.finer(tag+" stopped: done"); + return false; + } + scanAllDirectories(); + } catch (Exception x) { + if (LOG.isLoggable(Level.FINEST)) { + LOG.log(Level.FINEST, + tag+" failed to scan: "+x,x); + } else if (LOG.isLoggable(Level.FINE)) { + LOG.fine(tag+" failed to scan: "+x); + } + } + return true; + } + + /** + * Schedule an identical task for next iteration. + **/ + private boolean scheduleNext() { + final String tag = "Scheduled session["+taskid+"]"; + + // We need now to reschedule a new task for after 'delayBeforeNext' ms. + try { + LOG.finer(tag+": scheduling next session for "+ delayBeforeNext + "ms"); + if (cancelled || !notifyStateChange(SCHEDULED,"scan-scheduled")) { + LOG.finer(tag+" stopped: do not reschedule"); + return false; + } + final SessionTask nextTask = new SessionTask(delayBeforeNext); + if (!scheduleSession(nextTask,delayBeforeNext)) return false; + LOG.finer(tag+": next session successfully scheduled"); + } catch (Exception x) { + if (LOG.isLoggable(Level.FINEST)) { + LOG.log(Level.FINEST,tag+ + " failed to schedule next session: "+x,x); + } else if (LOG.isLoggable(Level.FINE)) { + LOG.fine(tag+" failed to schedule next session: "+x); + } + } + return true; + } + + + /** + * The run method: + * executes scanning logic, the schedule next iteration if needed. + **/ + public void run() { + final String tag = "Scheduled session["+taskid+"]"; + LOG.entering(SessionTask.class.getName(),"run"); + LOG.finer(tag+" starting..."); + try { + if (execute()==false) return; + + LOG.finer(tag+" terminating - state is "+state+ + ((delayBeforeNext >0)?(" next session is due in "+delayBeforeNext+" ms."): + " no additional session scheduled")); + + // if delayBeforeNext <= 0 we are done, either because the session was + // stopped or because it successfully completed. + if (delayBeforeNext <= 0) { + if (!notifyStateChange(COMPLETED,"scan-done")) + LOG.finer(tag+" stopped: done"); + else + LOG.finer(tag+" completed: done"); + return; + } + + // we need to reschedule a new session for 'delayBeforeNext' ms. + scheduleNext(); + + } finally { + tasklist.remove(this); + LOG.finer(tag+" finished..."); + LOG.exiting(SessionTask.class.getName(),"run"); + } + } + } + + // --------------------------------------------------------------- + // --------------------------------------------------------------- + + // --------------------------------------------------------------- + // MBean Notification support + // The methods below are imported from {@link NotificationEmitter} + // --------------------------------------------------------------- + + /** + * Delegates the implementation of this method to the wrapped + * {@code NotificationBroadcasterSupport} object. + **/ + public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException { + broadcaster.addNotificationListener(listener, filter, handback); + } + + + /** + * We emit an {@code AttributeChangeNotification} when the {@code State} + * attribute changes. + **/ + public MBeanNotificationInfo[] getNotificationInfo() { + return new MBeanNotificationInfo[] { + new MBeanNotificationInfo(new String[] { + AttributeChangeNotification.ATTRIBUTE_CHANGE}, + AttributeChangeNotification.class.getName(), + "Emitted when the State attribute changes") + }; + } + + /** + * Delegates the implementation of this method to the wrapped + * {@code NotificationBroadcasterSupport} object. + **/ + public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException { + broadcaster.removeNotificationListener(listener); + } + + /** + * Delegates the implementation of this method to the wrapped + * {@code NotificationBroadcasterSupport} object. + **/ + public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException { + broadcaster.removeNotificationListener(listener, filter, handback); + } + + /** + * Returns and increment the sequence number used for + * notifications. We use the same sequence number throughout the + * application - this is why this method is only package protected. + * @return A unique sequence number for the next notification. + */ + static synchronized long getNextSeqNumber() { + return seqNumber++; + } + + // --------------------------------------------------------------- + // End of MBean Notification support + // --------------------------------------------------------------- + + // --------------------------------------------------------------- + // MBeanRegistration support + // The methods below are imported from {@link MBeanRegistration} + // --------------------------------------------------------------- + + /** + * Allows the MBean to perform any operations it needs before being + * registered in the MBean server. If the name of the MBean is not + * specified, the MBean can provide a name for its registration. If + * any exception is raised, the MBean will not be registered in the + * MBean server. + *

      In this implementation, we check that the provided name is + * either {@code null} or equals to {@link #SCAN_MANAGER_NAME}. If it + * isn't then we throw an IllegalArgumentException, otherwise we return + * {@link #SCAN_MANAGER_NAME}.

      + *

      This ensures that there will be a single instance of ScanManager + * registered in a given MBeanServer, and that it will always be + * registered with the singleton's {@link #SCAN_MANAGER_NAME}.

      + *

      We do not need to check whether an MBean by that name is + * already registered because the MBeanServer will perform + * this check just after having called preRegister().

      + * @param server The MBean server in which the MBean will be registered. + * @param name The object name of the MBean. This name is null if the + * name parameter to one of the createMBean or registerMBean methods in + * the MBeanServer interface is null. In that case, this method must + * return a non-null ObjectName for the new MBean. + * @return The name under which the MBean is to be registered. This value + * must not be null. If the name parameter is not null, it will usually + * but not necessarily be the returned value. + * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { + if (name != null) { + if (!SCAN_MANAGER_NAME.equals(name)) + throw new IllegalArgumentException(String.valueOf(name)); + } + mbeanServer = server; + return SCAN_MANAGER_NAME; + } + + // Returns the default configuration filename + static String getDefaultConfigurationFileName() { + // This is a file calles 'jmx-scandir.xml' located + // in the user directory. + final String user = System.getProperty("user.home"); + final String defconf = user+File.separator+"jmx-scandir.xml"; + return defconf; + } + + /** + * Allows the MBean to perform any operations needed after having + * been registered in the MBean server or after the registration has + * failed. + *

      + * If registration was not successful, the method returns immediately. + *

      + * If registration is successful, register the {@link ResultLogManager} + * and default {@link ScanDirConfigMXBean}. If registering these + * MBean fails, the {@code ScanManager} state will be switched to + * {@link #close CLOSED}, and postRegister ends there. + *

      + *

      Otherwise the {@code ScanManager} will ask the + * {@link ScanDirConfigMXBean} to load its configuration. + * If it succeeds, the configuration will be {@link + * #applyConfiguration applied}. Otherwise, the method simply returns, + * assuming that the user will later create/update a configuration and + * apply it. + * @param registrationDone Indicates whether or not the MBean has been + * successfully registered in the MBean server. The value false means + * that the registration has failed. + */ + public void postRegister(Boolean registrationDone) { + if (!registrationDone) return; + Exception test=null; + try { + mbeanServer.registerMBean(log, + ResultLogManager.RESULT_LOG_MANAGER_NAME); + final String defconf = getDefaultConfigurationFileName(); + final String conf = System.getProperty("scandir.config.file",defconf); + final String confname = ScanDirConfig.guessConfigName(conf,defconf); + final ObjectName defaultProfileName = + makeMBeanName(ScanDirConfigMXBean.class,confname); + if (!mbeanServer.isRegistered(defaultProfileName)) + mbeanServer.registerMBean(new ScanDirConfig(conf), + defaultProfileName); + config = JMX.newMXBeanProxy(mbeanServer,defaultProfileName, + ScanDirConfigMXBean.class,true); + configmap.put(defaultProfileName,config); + } catch (Exception x) { + LOG.config("Failed to populate MBeanServer: "+x); + close(); + return; + } + try { + config.load(); + } catch (Exception x) { + LOG.finest("No config to load: "+x); + test = x; + } + if (test == null) { + try { + applyConfiguration(config.getConfiguration()); + } catch (Exception x) { + if (LOG.isLoggable(Level.FINEST)) + LOG.log(Level.FINEST,"Failed to apply config: "+x,x); + LOG.config("Failed to apply config: "+x); + } + } + } + + // Unregisters all created DirectoryScanners + private void unregisterScanners() throws JMException { + unregisterMBeans(scanmap); + } + + // Unregisters all created ScanDirConfigs + private void unregisterConfigs() throws JMException { + unregisterMBeans(configmap); + } + + // Unregisters all MBeans named by the given map + private void unregisterMBeans(Map map) throws JMException { + for (ObjectName key : map.keySet()) { + if (mbeanServer.isRegistered(key)) + mbeanServer.unregisterMBean(key); + map.remove(key); + } + } + + // Unregisters the ResultLogManager. + private void unregisterResultLogManager() throws JMException { + final ObjectName name = ResultLogManager.RESULT_LOG_MANAGER_NAME; + if (mbeanServer.isRegistered(name)) { + mbeanServer.unregisterMBean(name); + } + } + + /** + * Allows the MBean to perform any operations it needs before being + * unregistered by the MBean server. + * This implementation also unregisters all the MXBeans + * that were created by this object. + * @throws IllegalStateException if the lock can't be acquire, or if + * the MBean's state doesn't allow the MBean to be unregistered + * (e.g. because it's scheduled or running). + * @throws Exception This exception will be caught by the MBean server and + * re-thrown as an MBeanRegistrationException. + */ + public void preDeregister() throws Exception { + try { + close(); + if (!sequencer.tryAcquire()) + throw new IllegalStateException("can't acquire lock"); + try { + unregisterScanners(); + unregisterConfigs(); + unregisterResultLogManager(); + } finally { + sequencer.release(); + } + } catch (Exception x) { + LOG.log(Level.FINEST,"Failed to unregister: "+x,x); + throw x; + } + } + + /** + * Allows the MBean to perform any operations needed after having been + * unregistered in the MBean server. + * Cancels the internal timer - if any. + */ + public synchronized void postDeregister() { + if (timer != null) { + try { + timer.cancel(); + } catch (Exception x) { + if (LOG.isLoggable(Level.FINEST)) + LOG.log(Level.FINEST,"Failed to cancel timer",x); + else if (LOG.isLoggable(Level.FINE)) + LOG.fine("Failed to cancel timer: "+x); + } finally { + timer = null; + } + } + } + + // --------------------------------------------------------------- + // End of MBeanRegistration support + // --------------------------------------------------------------- + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManagerMXBean.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManagerMXBean.java new file mode 100644 index 0000000..1f6d4ff --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/ScanManagerMXBean.java @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import java.io.IOException; +import java.util.Map; +import javax.management.InstanceNotFoundException; +import javax.management.JMException; + +/** + * The ScanManagerMXBean is responsible for applying a + * configuration, starting and scheduling directory scans, and reporting + * application state. + *

      + * The ScanManagerMXBean is a singleton MBean: there can be + * at most one instance of such an MBean registered in a given MBeanServer. + * The name of that MBean is a constant defined in + * {@link ScanManager#SCAN_MANAGER_NAME ScanManager.SCAN_MANAGER_NAME}. + *

      + *

      + * The ScanManagerMXBean is the entry point of the scandir + * application management interface. It is from this MBean that all other + * MBeans will be created and registered. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + **/ +public interface ScanManagerMXBean { + /** + * This state tells whether directory scans are running, scheduled, + * successfully completed, or stopped. + *

      + * The {@link #CLOSED} state means + * that the {@link ScanManagerMXBean} was closed and is no longer usable. + * This state is used when the {@link ScanManagerMXBean} needs to be + * unregistered. + *

      + **/ + public enum ScanState { + /** + * Scanning of directories is in process. + **/ + RUNNING, + + /** + * Scanning of directories is not in process, but is scheduled + * for a later date. + **/ + SCHEDULED, + + /** + * Scanning is successfully completed. + **/ + COMPLETED, + + /** + * Scanning is stopped. No scanning is scheduled. + **/ + STOPPED, + + /** + * close() was called. + **/ + CLOSED + + } + + /** + * Returns the current state of the application. + * @return the current state of the application. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public ScanState getState() + throws IOException, InstanceNotFoundException; + + /** + * Schedule a scan session for a later date. + *

      + * A scan session is a background task that will sequentially call {@link + * DirectoryScannerMXBean#scan scan()} on every {@link + * DirectoryScannerMXBean} configured for this MBean. + *

      + * @see #getDirectoryScanners + * @param delay The first scan session will be started after + * the given delay. 0 means start now. + * @param interval Scan session will be rescheduled periodically + * at the specified interval. The interval starts at the + * the end of the scan session: if a scan session takes + * on average x milliseconds to complete, then a scan session will + * be started on average every x+interval milliseconds. + * if (interval == 0) then scan session will not be + * rescheduled, and will run only once. + * @throws IllegalStateException if a scan session is already + * running or scheduled, or the MBean is closed. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void schedule(long delay, long interval) + throws IOException, InstanceNotFoundException; + + + /** + * Stops current running or scheduled scan sessions if any. + *

      + * A scan session is a background task that will sequentially call {@link + * DirectoryScannerMXBean#scan scan()} on every {@link + * DirectoryScannerMXBean} configured for this MBean. + *

      + *

      + * Scan sessions are started/scheduled by calls to {@link #start start} or + * {@link #schedule schedule}. + *

      + * After this method completes the state of the application will + * be {@link ScanState#STOPPED}. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void stop() + throws IOException, InstanceNotFoundException; + + /** + * Switches the state to CLOSED. + * When closed, this MBean cannot be used any more. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void close() + throws IOException, InstanceNotFoundException; + + /** + * Starts a scan session immediately. + * This is equivalent to {@link #schedule(long,long) schedule(0,0)}. + * @throws IllegalStateException if a scan session is already + * running or scheduled, or the MBean is closed. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public void start() + throws IOException, InstanceNotFoundException; + + /** + * Gets the list of directory scanners configured for this MBean. + * @return A {@code Map} where the + * key in the map is the value of the name= key + * of the {@link DirectoryScannerMXBean} ObjectName. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws JMException The MBeanServer failed to call the underlying MBean. + **/ + public Map getDirectoryScanners() + throws IOException, JMException; + + /** + * Apply the configuration handled by the {@link + * #getConfigurationMBean configuration MBean}. + *

      + * When the configuration is applied, all the {@link DirectoryScannerMXBean} + * created by this MBean will be unregistered, and new {@link + * DirectoryScannerMXBean} will be created and registered from the + * new {@link ScanDirConfigMXBean#getConfiguration configuration data}. + *

      + *

      + * The initial result log configuration held by the {@link + * #getConfigurationMBean configuration MBean} will also be pushed to the + * {@link ResultLogManagerMXBean}. If you don't want to lose your current + * {@link ResultLogManagerMXBean} configuration, you should therefore call + * {@link #applyCurrentResultLogConfig + * applyCurrentResultLogConfig} before calling + * {@link #applyConfiguration applyConfiguration} + *

      + * @param fromMemory if {@code true}, the configuration will be applied + * from memory. if {@code false}, the {@code ScanManagerMXBean} will + * ask the {@link + * #getConfigurationMBean configuration MBean} to {@link + * ScanDirConfigMXBean#load reload its configuration} before applying + * it. + * @throws IllegalStateException if a scan session is + * running or scheduled, or the MBean is closed. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws JMException The MBeanServer failed to call the underlying MBean. + **/ + public void applyConfiguration(boolean fromMemory) + throws IOException, JMException; + /** + * Replaces the {@link + * #getConfigurationMBean configuration MBean}'s {@link + * com.sun.jmx.examples.scandir.config.ScanManagerConfig#getInitialResultLogConfig + * initial result log configuration} with the current {@link + * ResultLogManagerMXBean} + * configuration. This prevents the ResultLogManagerMXBean + * current configuration from being reset when {@link #applyConfiguration + * applyConfiguration} is called. + * @param toMemory if {@code true} only replaces the initial result log + * configuration held in memory. + * if {@code false}, the {@link + * #getConfigurationMBean configuration MBean} will be asked to commit + * the whole configuration to the configuration file. + * + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws JMException The MBeanServer failed to call the underlying MBean. + **/ + public void applyCurrentResultLogConfig(boolean toMemory) + throws IOException, JMException; + + /** + * Instruct the {@code ScanManagerMXBean} to use another {@link + * ScanDirConfigMXBean configuration MBean}. + *

      This method doesn't {@link #applyConfiguration apply} the new + * configuration. If you want to apply the new configuration, you should + * additionally call {@link #applyConfiguration + * applyConfiguration(true|false)}. Note that you cannot apply a + * configuration as long as a scan session is scheduled or running. + * In that case you will need to wait for that session to complete + * or call {@link #stop} to stop it. + *

      + * @param config A proxy to the {@link ScanDirConfigMXBean} that holds + * the new configuration for the application. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + */ + public void setConfigurationMBean(ScanDirConfigMXBean config) + throws IOException, InstanceNotFoundException; + /** + * Gets the current configuration MBean. + * @return A proxy to the current configuration MBean. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws InstanceNotFoundException The underlying MBean is not + * registered in the MBeanServer. + **/ + public ScanDirConfigMXBean getConfigurationMBean() + throws IOException, InstanceNotFoundException; + /** + * This method creates a new alternate {@link ScanDirConfigMXBean}. + * + *

      You will need to call {@link #setConfigurationMBean + * setConfigurationMBean} if you + * want this new {@link ScanDirConfigMXBean} to become the + * current configuration MBean. + *

      + *

      + * This new {@link ScanDirConfigMXBean} will be unregistered automatically + * by the {@code ScanManagerMXBean} when the {@code ScanManagerMXBean} + * is unregistered. + *

      + * @param name The short name for the new {@link ScanDirConfigMXBean}. + * This name will be used in the ObjectName name= key + * of the new {@link ScanDirConfigMXBean}. + * @param filename The path of the file from which the new {@link + * ScanDirConfigMXBean} can {@link ScanDirConfigMXBean#load load} or + * {@link ScanDirConfigMXBean#save save} its configuration data. + * Note that even if the file exists and contain a valid + * configuration, you will still need to call {@link + * ScanDirConfigMXBean#load load} to make the {@link + * ScanDirConfigMXBean} load its configuration data. + * @throws IOException A connection problem occurred when accessing + * the underlying resource. + * @throws JMException The MBeanServer failed to call the underlying MBean. + * @return A proxy to the created {@link ScanDirConfigMXBean}. + */ + public ScanDirConfigMXBean createOtherConfigurationMBean(String name, + String filename) + throws JMException, IOException; +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/DirectoryScannerConfig.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/DirectoryScannerConfig.java new file mode 100644 index 0000000..b3f8e9f --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/DirectoryScannerConfig.java @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.io.File; +import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Logger; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlList; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * The DirectoryScannerConfig Java Bean is used to model + * the configuration of a {@link + * com.sun.jmx.examples.scandir.DirectoryScannerMXBean}. + *

      + * This class is annotated for XML binding. + *

      + * @author Sun Microsystems, 2006 - All rights reserved. + */ +@XmlRootElement(name="DirectoryScanner", + namespace=XmlConfigUtils.NAMESPACE) +public class DirectoryScannerConfig { + + // + // A logger for this class. + // + // private static final Logger LOG = + // Logger.getLogger(DirectoryScannerConfig.class.getName()); + + /** + * This enumeration is used to model the actions that a {@link + * com.sun.jmx.examples.scandir.DirectoryScannerMXBean + * DirectoryScannerMXBean} should take when a file matches its set + * of matching criteria. + **/ + public enum Action { + /** + * Indicates that the {@code DirectoryScannerMXBean} should + * emit a {@code Notification} when a matching file is found. + */ + NOTIFY, + /** + * Indicates that the {@code DirectoryScannerMXBean} should + * delete the matching files. + */ + DELETE, + /** + * Indicates that the {@code DirectoryScannerMXBean} should + * log the actions that were taken on the matching files. + */ + LOGRESULT }; + + // A short name for the Directory Scanner + // This name is used for the value of the {@code name=} key in the + // {@code DirectoryScannerMXBean} ObjectName. + private String name; + + // The root directory of the Directory Scanner + private String rootDirectory; + + // List of filters identifying files that should be selected. + // A file is selected if at least one filter matches. + // + private final List includeFiles = + new ArrayList(); + + // List of filters identifying files that should be excluded. + // A file is excluded if at least one filter matches. + // + private final List excludeFiles = + new ArrayList(); + + + // The actions that this Directory Scanner should carry out when a + // file is selected. Default is NOTIFY and LOGRESULT. + // + private Action[] actions = { Action.NOTIFY, Action.LOGRESULT }; + + /** + * Creates a new instance of {@code DirectoryScannerConfig}. + * We keep this empty constructor to make XML binding easier. + * You shouldn't use this constructor directly: + * use {@link #DirectoryScannerConfig(String) + * DirectoryScannerConfig(String name)} instead. + * @deprecated

      Tagged deprecated so that a compiler warning is issued. + * Use {@link #DirectoryScannerConfig(String) + * DirectoryScannerConfig(String name)} instead. + *

      + **/ + public DirectoryScannerConfig() { + this(null); + } + + /** + * Creates a new instance of {@code DirectoryScannerConfig}. + * @param name A short name for the Directory Scanner. This name is used for + * the value of the {@code name=} key in the + * {@code DirectoryScannerMXBean} ObjectName. + **/ + public DirectoryScannerConfig(String name) { + this.name = name; + rootDirectory = null; + } + + /** + * Gets the root directory configured for that Directory Scanner. + * @return the root directory at which the directory scanner should start + * scanning. + **/ + @XmlElement(name="RootDirectory",namespace=XmlConfigUtils.NAMESPACE) + public String getRootDirectory() { + return rootDirectory; + } + + /** + * Configures a root directory for that Directory Scanner. + * @param root The root directory at which the directory scanner should + * start scanning. + **/ + public void setRootDirectory(String root) { + rootDirectory=root; + } + + + /** + * Gets the short name of this directory scanner. + * + *

      + * This name is used for the value of the {@code name=} key in the + * {@code DirectoryScannerMXBean} ObjectName. + *

      + * + * @return the short name of this directory scanner. + **/ + @XmlAttribute(name="name",required=true) + public String getName() { + return this.name; + } + + /** + * Setter for property {@link #getName() name}. + * Once set its value cannot change. + * @param name New value of property name. + * @throws IllegalArgumentException if {@code name} is already set to a + * different non null value. + */ + public void setName(String name) { + if (this.name == null) + this.name = name; + else if (name == null) + throw new IllegalArgumentException("name=null"); + else if (!name.equals(this.name)) + throw new IllegalArgumentException("name="+name); + } + + /** + * Getter for property includeFiles. + * This is an array of filters identifying files that should be selected. + * A file is selected if at least one filter matches. + * @return Value of property includeFiles. + */ + @XmlElementWrapper(name="IncludeFiles", + namespace=XmlConfigUtils.NAMESPACE) + @XmlElementRef + public FileMatch[] getIncludeFiles() { + synchronized(includeFiles) { + return includeFiles.toArray(new FileMatch[0]); + } + } + + /** + * Adds a filter to the includeFiles property. + * A file is selected if at least one filter matches. + * @param include A filter identifying files that should be selected. + */ + public void addIncludeFiles(FileMatch include) { + if (include == null) + throw new IllegalArgumentException("null"); + synchronized (includeFiles) { + includeFiles.add(include); + } + } + + /** + * Setter for property includeFiles. + * @param includeFiles New value of property includeFiles. + * This is an array of filters identifying files + * that should be selected. A file is selected if at least + * one filter matches. + */ + public void setIncludeFiles(FileMatch[] includeFiles) { + synchronized (this.includeFiles) { + this.includeFiles.clear(); + if (includeFiles == null) return; + this.includeFiles.addAll(Arrays.asList(includeFiles)); + } + } + + /** + * Getter for property excludeFiles. + * This is an array of filters identifying files that should be excluded. + * A file is excluded if at least one filter matches. + * @return Value of property excludeFiles. + */ + @XmlElementWrapper(name="ExcludeFiles", + namespace=XmlConfigUtils.NAMESPACE) + @XmlElementRef + public FileMatch[] getExcludeFiles() { + synchronized(excludeFiles) { + return excludeFiles.toArray(new FileMatch[0]); + } + } + + /** + * Setter for property excludeFiles. + * @param excludeFiles New value of property excludeFiles. + * This is an array of filters identifying files + * that should be excluded. A file is excluded if at least + * one filter matches. + */ + public void setExcludeFiles(FileMatch[] excludeFiles) { + synchronized (this.excludeFiles) { + this.excludeFiles.clear(); + if (excludeFiles == null) return; + this.excludeFiles.addAll(Arrays.asList(excludeFiles)); + } + } + + /** + * Adds a filter to the excludeFiles property. + * A file is excluded if at least one filter matches. + * @param exclude A filter identifying files that should be excluded. + */ + public void addExcludeFiles(FileMatch exclude) { + if (exclude == null) + throw new IllegalArgumentException("null"); + synchronized (excludeFiles) { + this.excludeFiles.add(exclude); + } + } + + /** + * Gets the list of actions that this Directory Scanner should carry + * out when a file is selected. Default is NOTIFY and LOGRESULT. + + * @return The list of actions that this Directory Scanner should carry + * out when a file is selected. + */ + @XmlElement(name="Actions",namespace=XmlConfigUtils.NAMESPACE) + @XmlList + public Action[] getActions() { + return (actions == null)?null:actions.clone(); + } + + /** + * Sets the list of actions that this Directory Scanner should carry + * out when a file is selected. Default is NOTIFY and LOGRESULT. + + * @param actions The list of actions that this Directory Scanner should + * carry out when a file is selected. + */ + public void setActions(Action[] actions) { + this.actions = (actions == null)?null:actions.clone(); + } + + /** + * Builds a {@code FileFilter} from the {@link #getIncludeFiles + * includeFiles} and {@link #getExcludeFiles excludeFiles} lists. + * A file will be accepted if it is selected by at least one of + * the filters in {@link #getIncludeFiles includeFiles}, and is + * not excluded by any of the filters in {@link + * #getExcludeFiles excludeFiles}. If there's no filter in + * {@link #getIncludeFiles includeFiles}, then a file is accepted + * simply if it is not excluded by any of the filters in {@link + * #getExcludeFiles excludeFiles}. + * + * @return A new {@code FileFilter} created from the current snapshot + * of the {@link #getIncludeFiles + * includeFiles} and {@link #getExcludeFiles excludeFiles} lists. + * Later modification of these lists will not affect the + * returned {@code FileFilter}. + **/ + public FileFilter buildFileFilter() { + final FileFilter[] ins = getIncludeFiles(); + final FileFilter[] outs = getExcludeFiles(); + final FileFilter filter = new FileFilter() { + public boolean accept(File f) { + boolean result = false; + // If no include filter, all files are included. + if (ins != null) { + for (FileFilter in: ins) { + // if one filter accepts it, file is included + if (!in.accept(f)) continue; + + // file is accepted, include it + result=true; + break; + } + } else result= true; + if (result == false) return false; + + // The file is in the include list. Let's see if it's not + // in the exclude list... + // + if (outs != null) { + for (FileFilter out: outs) { + // if one filter accepts it, file is excluded + if (!out.accept(f)) continue; + + // file is accepted, exclude it. + result=false; + break; + } + } + return result; + } + }; + return filter; + } + + // Used for equality - see equals(). + private Object[] toArray() { + final Object[] thisconfig = { + name,rootDirectory,actions,excludeFiles,includeFiles + }; + return thisconfig; + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof DirectoryScannerConfig)) return false; + final DirectoryScannerConfig other = (DirectoryScannerConfig)o; + final Object[] thisconfig = toArray(); + final Object[] otherconfig = other.toArray(); + return Arrays.deepEquals(thisconfig,otherconfig); + } + + @Override + public int hashCode() { + final String key = name; + if (key == null) return 0; + else return key.hashCode(); + } + + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java new file mode 100644 index 0000000..31f44ce --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.io.File; +import java.io.FileFilter; +import java.util.Arrays; +import java.util.Date; +import java.util.logging.Logger; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * The FileMatch Java Bean is used to model + * the configuration of a {@link FileFilter} which + * matches {@link File files} against a set of criteria. + *

      + * The FileMatch class also implements + * {@link FileFilter} - applying an {@code AND} on all + * its conditions. {@code OR} conditions can be obtained + * by supplying several instances of FileMatch + * to the encapsulating {@link DirectoryScannerConfig}, which + * respectively applies an {@code OR} on all its + * {@code } elements. + *

      + * + *

      + * This class is annotated for XML binding. + *

      + * @author Sun Microsystems, 2006 - All rights reserved. + */ +@XmlRootElement(name="FileFilter", + namespace=XmlConfigUtils.NAMESPACE) +public class FileMatch implements FileFilter { + + // + // A logger for this class. + // + // private static final Logger LOG = + // Logger.getLogger(FileMatch.class.getName()); + + /** + * A regular expression against which directory names should be matched. + */ + private String directoryPattern; + + /** + * A regular expression against which file names should be matched. + */ + private String filePattern; + + /** + * File whose size in bytes exceeds this limit will be selected. + */ + private long sizeExceedsMaxBytes; + + /** + * A file which will be selected only if it was last modified after + * this date + */ + private Date lastModifiedAfter; + + /** + * A file which will be selected only if it was last modified before + * this date + */ + private Date lastModifiedBefore; + + /** + * Creates a new instance of FileMatch + */ + public FileMatch() { + } + + /** + * Getter for property directoryPattern. This is a regular expression + * against which directory names should be matched. + * Applies only to directory, and tells whether a directory should be + * included or excluded from the search. + *

      If File.isDirectory() && directoryPattern!=null && + * File.getName().matches(directoryPattern), + * then File matches this filter.
      + * If File.isDirectory() && directoryPattern!=null && + * File.getName().matches(directoryPattern)==false, + * then File doesn't match this filter.
      + *

      + * @see java.util.regex.Pattern + * @see java.lang.String#matches(java.lang.String) + * @return Value of property directoryPattern. + */ + @XmlElement(name="DirectoryPattern",namespace=XmlConfigUtils.NAMESPACE) + public String getDirectoryPattern() { + return this.directoryPattern; + } + + /** + * Setter for property directoryPattern. + * @param directoryPattern New value of property directoryPattern. + * This is a regular expression + * against which directory names should be {@link #getDirectoryPattern + * matched}. + * @see java.util.regex.Pattern + * @see java.lang.String#matches(java.lang.String) + */ + public void setDirectoryPattern(String directoryPattern) { + this.directoryPattern = directoryPattern; + } + + /** + * Getter for property filePattern. This is a regular expression + * against which file names should be matched. + * Applies only to files. + *

      + * If File.isDirectory()==false && filePattern!=null && + * File.getName().matches(filePattern)==false, + * then File doesn't match this filter. + *

      + * @see java.util.regex.Pattern + * @see java.lang.String#matches(java.lang.String) + * @return Value of property filePatern. + */ + @XmlElement(name="FilePattern",namespace=XmlConfigUtils.NAMESPACE) + public String getFilePattern() { + return this.filePattern; + } + + /** + * Setter for property filePattern. + * @param filePattern New value of property filePattern. + * This is a regular expression + * against which file names should be {@link #getFilePattern matched}. + * @see java.util.regex.Pattern + * @see java.lang.String#matches(java.lang.String) + */ + public void setFilePattern(String filePattern) { + this.filePattern = filePattern; + } + + /** + * Getter for property sizeExceedsMaxBytes. + * Ignored if 0 or negative. Otherwise, files whose size in bytes does + * not exceed this limit will be excluded by this filter. + * + * @return Value of property sizeExceedsMaxBytes. + */ + @XmlElement(name="SizeExceedsMaxBytes",namespace=XmlConfigUtils.NAMESPACE) + public long getSizeExceedsMaxBytes() { + return this.sizeExceedsMaxBytes; + } + + /** + * Setter for property sizeExceedsMaxBytes. + * @param sizeLimitInBytes New value of property sizeExceedsMaxBytes. + * Ignored if 0 or negative. Otherwise, files whose size in bytes does + * not exceed this limit will be excluded by this filter. + * + */ + public void setSizeExceedsMaxBytes(long sizeLimitInBytes) { + this.sizeExceedsMaxBytes = sizeLimitInBytes; + } + + /** + * Getter for property {@code lastModifiedAfter}. + * A file will be selected only if it was last modified after + * {@code lastModifiedAfter}. + *
      This condition is ignored if {@code lastModifiedAfter} is + * {@code null}. + * @return Value of property {@code lastModifiedAfter}. + */ + @XmlElement(name="LastModifiedAfter",namespace=XmlConfigUtils.NAMESPACE) + public Date getLastModifiedAfter() { + return (lastModifiedAfter==null)?null:(Date)lastModifiedAfter.clone(); + } + + /** + * Setter for property {@code lastModifiedAfter}. + * @param lastModifiedAfter A file will be selected only if it was + * last modified after {@code lastModifiedAfter}. + *
      This condition is ignored if {@code lastModifiedAfter} is + * {@code null}. + */ + public void setLastModifiedAfter(Date lastModifiedAfter) { + this.lastModifiedAfter = + (lastModifiedAfter==null)?null:(Date)lastModifiedAfter.clone(); + } + + /** + * Getter for property {@code lastModifiedBefore}. + * A file will be selected only if it was last modified before + * {@code lastModifiedBefore}. + *
      This condition is ignored if {@code lastModifiedBefore} is + * {@code null}. + * @return Value of property {@code lastModifiedBefore}. + */ + @XmlElement(name="LastModifiedBefore",namespace=XmlConfigUtils.NAMESPACE) + public Date getLastModifiedBefore() { + return (lastModifiedBefore==null)?null:(Date)lastModifiedBefore.clone(); + } + + /** + * Setter for property {@code lastModifiedBefore}. + * @param lastModifiedBefore A file will be selected only if it was + * last modified before {@code lastModifiedBefore}. + *
      This condition is ignored if {@code lastModifiedBefore} is + * {@code null}. + */ + public void setLastModifiedBefore(Date lastModifiedBefore) { + this.lastModifiedBefore = + (lastModifiedBefore==null)?null:(Date)lastModifiedBefore.clone(); + } + + // Accepts or rejects a file with regards to the values of the fields + // configured in this bean. The accept() method is the implementation + // of FileFilter.accept(File); + // + /** + * A file is accepted when all the criteria that have been set + * are matched. + * @param f The file to match against the configured criteria. + * @return {@code true} if the file matches all criteria, + * {@code false} otherwise. + */ + public boolean accept(File f) { + + // Directories are accepted if they match against the directory pattern. + // + if (f.isDirectory()) { + if (directoryPattern != null + && !f.getName().matches(directoryPattern)) + return false; + else return true; + } + + // If we reach here, the f is not a directory. + // + // Files are accepted if they match all other conditions. + + // Check whether f matches filePattern + if (filePattern != null + && !f.getName().matches(filePattern)) + return false; + + // Check whether f exceeeds size limit + if (sizeExceedsMaxBytes > 0 && f.length() <= sizeExceedsMaxBytes) + return false; + + // Check whether f was last modified after lastModifiedAfter + if (lastModifiedAfter != null && + lastModifiedAfter.after(new Date(f.lastModified()))) + return false; + + // Check whether f was last modified before lastModifiedBefore + if (lastModifiedBefore != null && + lastModifiedBefore.before(new Date(f.lastModified()))) + return false; + + // All conditions were met: accept file. + return true; + } + + // used by equals() + private Object[] toArray() { + final Object[] thisconfig = { + directoryPattern, filePattern, lastModifiedAfter, + lastModifiedBefore, sizeExceedsMaxBytes + }; + return thisconfig; + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof FileMatch)) return false; + final FileMatch other = (FileMatch)o; + final Object[] thisconfig = toArray(); + final Object[] otherconfig = other.toArray(); + return Arrays.deepEquals(thisconfig,otherconfig); + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(toArray()); + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultLogConfig.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultLogConfig.java new file mode 100644 index 0000000..5f3d668 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultLogConfig.java @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.util.Arrays; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * The ResultLogConfig Java Bean is used to model + * the initial configuration of the {@link + * com.sun.jmx.examples.scandir.ResultLogManagerMXBean}. + * + *

      + * This class is annotated for XML binding. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +@XmlRootElement(name="ResultLogConfig", + namespace=XmlConfigUtils.NAMESPACE) +public class ResultLogConfig { + + // + // A logger for this class. + // + // private static final Logger LOG = + // Logger.getLogger(ResultLogConfig.class.getName()); + + /** + * The path to the result log file. {@code null} means that logging to + * file is disabled. + */ + private String logFileName; + + /** + * Maximum number of record that will be logged in the log file before + * switching to a new log file. + */ + private long logFileMaxRecords; + + /** + * The maximum number of records that can be contained in the memory log. + * When this number is reached, the memory log drops its eldest record + * to make way for the new one. + */ + private int memoryMaxRecords; + + /** + * Creates a new instance of ResultLogConfig + */ + public ResultLogConfig() { + } + + /** + * Gets the path to the result log file. {@code null} means that logging to + * file is disabled. + * @return the path to the result log file. + */ + @XmlElement(name="LogFileName",namespace=XmlConfigUtils.NAMESPACE) + public String getLogFileName() { + return this.logFileName; + } + + /** + * Sets the path to the result log file. {@code null} means that + * logging to file is disabled. + * @param logFileName the path to the result log file. + */ + public void setLogFileName(String logFileName) { + this.logFileName = logFileName; + } + + /** + * Gets the maximum number of record that will be logged in the log file + * before switching to a new log file. + * A 0 or negative value means no limit. + * @return the maximum number of record that will be logged in the log file. + */ + @XmlElement(name="LogFileMaxRecords",namespace=XmlConfigUtils.NAMESPACE) + public long getLogFileMaxRecords() { + return this.logFileMaxRecords; + } + + /** + * Sets the maximum number of record that will be logged in the log file + * before switching to a new log file. + * A 0 or negative value means no limit. + * @param logFileMaxRecords the maximum number of record that will be + * logged in the log file. + */ + public void setLogFileMaxRecords(long logFileMaxRecords) { + this.logFileMaxRecords = logFileMaxRecords; + } + + /** + * Gets the maximum number of records that can be contained in the memory + * log. + * When this number is reached, the memory log drops its eldest record + * to make way for the new one. + * @return the maximum number of records that can be contained in the + * memory log. + */ + @XmlElement(name="MemoryMaxRecords",namespace=XmlConfigUtils.NAMESPACE) + public int getMemoryMaxRecords() { + return this.memoryMaxRecords; + } + + /** + * Sets the maximum number of records that can be contained in the memory + * log. + * When this number is reached, the memory log drops its eldest record + * to make way for the new one. + * @param memoryMaxRecords the maximum number of records that can be + * contained in the memory log. + */ + public void setMemoryMaxRecords(int memoryMaxRecords) { + this.memoryMaxRecords = memoryMaxRecords; + } + + private Object[] toArray() { + final Object[] thisconfig = { + memoryMaxRecords,logFileMaxRecords,logFileName + }; + return thisconfig; + } + + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof ResultLogConfig)) return false; + final ResultLogConfig other = (ResultLogConfig)o; + return Arrays.deepEquals(toArray(),other.toArray()); + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(toArray()); + } +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultRecord.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultRecord.java new file mode 100644 index 0000000..5e3188a --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ResultRecord.java @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.util.Date; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlList; +import javax.xml.bind.annotation.XmlRootElement; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig.Action; +import java.io.File; +import java.util.Arrays; + +/** + * The ResultRecord Java Bean is used to write the + * results of a directory scan to a result log. + * + *

      + * This class is annotated for XML binding. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +@XmlRootElement(name="ResultRecord",namespace=XmlConfigUtils.NAMESPACE) +public class ResultRecord { + + /** + * The name of the file for which this result record is built. + */ + private String filename; + + /** + * The Date at which this result was obtained. + */ + private Date date; + + /** + * The short name of the directory scanner which performed the operation. + * @see DirectoryScannerConfig#getName() + */ + private String directoryScanner; + + /** + * The list of actions that were successfully carried out. + */ + private Action[] actions; + + /** + * Creates a new empty instance of ResultRecord. + */ + public ResultRecord() { + } + + /** + * Creates a new instance of ResultRecord. + * @param scan The DirectoryScannerConfig for which this result was + * obtained. + * @param actions The list of actions that were successfully carried out. + * @param f The file for which these actions were successfully carried out. + */ + public ResultRecord(DirectoryScannerConfig scan, Action[] actions, + File f) { + directoryScanner = scan.getName(); + this.actions = actions; + date = new Date(); + filename = f.getAbsolutePath(); + } + + /** + * Gets the name of the file for which this result record is built. + * @return The name of the file for which this result record is built. + */ + @XmlElement(name="Filename",namespace=XmlConfigUtils.NAMESPACE) + public String getFilename() { + return this.filename; + } + + /** + * Sets the name of the file for which this result record is being built. + * @param filename the name of the file for which this result record is + * being built. + */ + public void setFilename(String filename) { + this.filename = filename; + } + + /** + * Gets the Date at which this result was obtained. + * @return the Date at which this result was obtained. + */ + @XmlElement(name="Date",namespace=XmlConfigUtils.NAMESPACE) + public Date getDate() { + synchronized(this) { + return (date==null)?null:(new Date(date.getTime())); + } + } + + /** + * Sets the Date at which this result was obtained. + * @param date the Date at which this result was obtained. + */ + public void setDate(Date date) { + synchronized (this) { + this.date = (date==null)?null:(new Date(date.getTime())); + } + } + + /** + * Gets the short name of the directory scanner which performed the + * operation. + * @see DirectoryScannerConfig#getName() + * @return the short name of the directory scanner which performed the + * operation. + */ + @XmlElement(name="DirectoryScanner",namespace=XmlConfigUtils.NAMESPACE) + public String getDirectoryScanner() { + return this.directoryScanner; + } + + /** + * Sets the short name of the directory scanner which performed the + * operation. + * @see DirectoryScannerConfig#getName() + * @param directoryScanner the short name of the directory scanner which + * performed the operation. + */ + public void setDirectoryScanner(String directoryScanner) { + this.directoryScanner = directoryScanner; + } + + /** + * Gets the list of actions that were successfully carried out. + * @return the list of actions that were successfully carried out. + */ + @XmlElement(name="Actions",namespace=XmlConfigUtils.NAMESPACE) + @XmlList + public Action[] getActions() { + return (actions == null)?null:actions.clone(); + } + + /** + * Sets the list of actions that were successfully carried out. + * @param actions the list of actions that were successfully carried out. + */ + public void setActions(Action[] actions) { + this.actions = (actions == null)?null:actions.clone(); + } + + // Used for equality + private Object[] toArray() { + final Object[] thisconfig = { + filename, date, directoryScanner, actions + }; + return thisconfig; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof ResultRecord)) return false; + return Arrays.deepEquals(toArray(),((ResultRecord)o).toArray()); + } + + @Override + public int hashCode() { + return Arrays.deepHashCode(toArray()); + } +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ScanManagerConfig.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ScanManagerConfig.java new file mode 100644 index 0000000..e1afcce --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/ScanManagerConfig.java @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + + +/** + * The ScanManagerConfig Java Bean is used to model + * the configuration of the {@link + * com.sun.jmx.examples.scandir.ScanManagerMXBean ScanManagerMXBean}. + * + * The {@link + * com.sun.jmx.examples.scandir.ScanManagerMXBean ScanManagerMXBean} will + * use this configuration to initialize the {@link + * com.sun.jmx.examples.scandir.ResultLogManagerMXBean ResultLogManagerMXBean} + * and create the {@link + * com.sun.jmx.examples.scandir.DirectoryScannerMXBean DirectoryScannerMXBeans} + *

      + * This class is annotated for XML binding. + *

      + * + * @author Sun Microsystems, 2006 - All rights reserved. + **/ +@XmlRootElement(name="ScanManager", + namespace="jmx:com.sun.jmx.examples.scandir.config") +public class ScanManagerConfig { + + // A logger for this class + // + // private static final Logger LOG = + // Logger.getLogger(ScanManagerConfig.class.getName()); + + /** + * A set of DirectoryScannerConfig objects indexed by their names. + **/ + private final Map directoryScanners; + + /** + * The initial Result Log configuration. + */ + private ResultLogConfig initialResultLogConfig; + + /** + * Holds value of property name. The name of the configuration + * usually corresponds to + * the value of the {@code name=} key of the {@code ObjectName} + * of the {@link + * com.sun.jmx.examples.scandir.ScanDirConfigMXBean + * ScanDirConfigMXBean} which owns this configuration. + **/ + private String name; + + /** + * Creates a new instance of ScanManagerConfig. + *

      You should not use this constructor directly, but use + * {@link #ScanManagerConfig(String)} instead. + *

      + *

      This constructor is tagged deprecated so that the compiler + * will generate a warning if it is used by mistake. + *

      + * @deprecated Use {@link #ScanManagerConfig(String)} instead. This + * constructor is used through reflection by the XML + * binding framework. + */ + public ScanManagerConfig() { + this(null,true); + } + + /** + * Creates a new instance of ScanManagerConfig. + * @param name The name of the configuration which usually corresponds to + * the value of the {@code name=} key of the {@code ObjectName} + * of the {@link + * com.sun.jmx.examples.scandir.ScanDirConfigMXBean + * ScanDirConfigMXBean} which owns this configuration. + **/ + public ScanManagerConfig(String name) { + this(name,false); + } + + // Our private constructor... + private ScanManagerConfig(String name, boolean allowsNull) { + if (name == null && allowsNull==false) + throw new IllegalArgumentException("name=null"); + this.name = name; + directoryScanners = new LinkedHashMap(); + this.initialResultLogConfig = new ResultLogConfig(); + this.initialResultLogConfig.setMemoryMaxRecords(1024); + } + + // Creates an array for deep equality. + private Object[] toArray() { + final Object[] thisconfig = { + name,directoryScanners,initialResultLogConfig + }; + return thisconfig; + } + + // equals + @Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof ScanManagerConfig)) return false; + final ScanManagerConfig other = (ScanManagerConfig)o; + if (this.directoryScanners.size() != other.directoryScanners.size()) + return false; + return Arrays.deepEquals(toArray(),other.toArray()); + } + + @Override + public int hashCode() { + final String key = name; + if (key == null) return 0; + else return key.hashCode(); + } + + /** + * Gets the name of this configuration. The name of the configuration + * usually corresponds to + * the value of the {@code name=} key of the {@code ObjectName} + * of the {@link + * com.sun.jmx.examples.scandir.ScanDirConfigMXBean + * ScanDirConfigMXBean} which owns this configuration. + * @return The name of this configuration. + */ + @XmlAttribute(name="name",required=true) + public String getName() { + return this.name; + } + + /** + * Sets the name of this configuration. The name of the configuration + * usually corresponds to + * the value of the {@code name=} key of the {@code ObjectName} + * of the {@link + * com.sun.jmx.examples.scandir.ScanDirConfigMXBean + * ScanDirConfigMXBean} which owns this configuration. + *

      Once set this value cannot change.

      + * @param name The name of this configuration. + */ + public void setName(String name) { + if (this.name == null) + this.name = name; + else if (name == null) + throw new IllegalArgumentException("name=null"); + else if (!name.equals(this.name)) + throw new IllegalArgumentException("name="+name); + } + + /** + * Gets the list of Directory Scanner configured by this + * configuration. From each element in this list, the + * {@link com.sun.jmx.examples.scandir.ScanManagerMXBean ScanManagerMXBean} + * will create, initialize, and register a {@link + * com.sun.jmx.examples.scandir.DirectoryScannerMXBean}. + * @return The list of Directory Scanner configured by this configuration. + */ + @XmlElementWrapper(name="DirectoryScannerList", + namespace=XmlConfigUtils.NAMESPACE) + @XmlElementRef + public DirectoryScannerConfig[] getScanList() { + return directoryScanners.values().toArray(new DirectoryScannerConfig[0]); + } + + /** + * Sets the list of Directory Scanner configured by this + * configuration. From each element in this list, the + * {@link com.sun.jmx.examples.scandir.ScanManagerMXBean ScanManagerMXBean} + * will create, initialize, and register a {@link + * com.sun.jmx.examples.scandir.DirectoryScannerMXBean}. + * @param scans The list of Directory Scanner configured by this configuration. + */ + public void setScanList(DirectoryScannerConfig[] scans) { + directoryScanners.clear(); + for (DirectoryScannerConfig scan : scans) + directoryScanners.put(scan.getName(),scan); + } + + /** + * Get a directory scanner by its name. + * + * @param name The name of the directory scanner. This is the + * value returned by {@link + * DirectoryScannerConfig#getName()}. + * @return The named {@code DirectoryScannerConfig} + */ + public DirectoryScannerConfig getScan(String name) { + return directoryScanners.get(name); + } + + /** + * Adds a directory scanner to the list. + *

      If a directory scanner + * configuration by that name already exists in the list, it will + * be replaced by the given scan. + *

      + * @param scan The {@code DirectoryScannerConfig} to add to the list. + * @return The replaced {@code DirectoryScannerConfig}, or {@code null} + * if there was no {@code DirectoryScannerConfig} by that name + * in the list. + */ + public DirectoryScannerConfig putScan(DirectoryScannerConfig scan) { + return this.directoryScanners.put(scan.getName(),scan); + } + + // XML value of this object. + public String toString() { + return XmlConfigUtils.toString(this); + } + + /** + * Removes the named directory scanner from the list. + * + * @param name The name of the directory scanner. This is the + * value returned by {@link + * DirectoryScannerConfig#getName()}. + * @return The removed {@code DirectoryScannerConfig}, or {@code null} + * if there was no directory scanner by that name in the list. + */ + public DirectoryScannerConfig removeScan(String name) { + return this.directoryScanners.remove(name); + } + + /** + * Gets the initial Result Log Configuration. + * @return The initial Result Log Configuration. + */ + @XmlElement(name="InitialResultLogConfig",namespace=XmlConfigUtils.NAMESPACE) + public ResultLogConfig getInitialResultLogConfig() { + return this.initialResultLogConfig; + } + + /** + * Sets the initial Result Log Configuration. + * @param initialLogConfig The initial Result Log Configuration. + */ + public void setInitialResultLogConfig(ResultLogConfig initialLogConfig) { + this.initialResultLogConfig = initialLogConfig; + } + + /** + * Creates a copy of this object, with the specified name. + * @param newname the name of the copy. + * @return A copy of this object. + **/ + public ScanManagerConfig copy(String newname) { + return copy(newname,this); + } + + // Copy by XML cloning, then change the name. + // + private static ScanManagerConfig + copy(String newname, ScanManagerConfig other) { + ScanManagerConfig newbean = XmlConfigUtils.xmlClone(other); + newbean.name = newname; + return newbean; + } +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/XmlConfigUtils.java b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/XmlConfigUtils.java new file mode 100644 index 0000000..a3e663d --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/XmlConfigUtils.java @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.logging.Logger; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; + +/** + * The class XmlConfigUtils is used to deal with XML serialization + * and XML files. + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class XmlConfigUtils { + + /** + * A URI for our XML configuration namespace. This doesn't start with + * http:// because we are not going to publish this private schema + * anywhere. + **/ + public static final String NAMESPACE = + "jmx:com.sun.jmx.examples.scandir.config"; + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(XmlConfigUtils.class.getName()); + + // Our JAXBContext. + private static JAXBContext context; + + // The file name of the XML file in which an instance of this object + // will read and write XML data. + final String file; + + /** + * Creates a new instance of XmlConfigUtils. + * @param file The file name of the XML file in which an instance of this + * object will read and write XML data. + */ + public XmlConfigUtils(String file) { + this.file = file; + } + + /** + * Write the given bean to the XML file. + *

      + * Performs an atomic write, first writing in {@code .new}, then + * renaming {@code } to {@code ~}, then renaming + * renaming {@code .new} to {@code }. + *

      + * @param bean The configuration to write in the XML file. + * @throws IOException if write to file failed. + **/ + public synchronized void writeToFile(ScanManagerConfig bean) + throws IOException { + + // Creates a new file named .new + final File f = newXmlTmpFile(file); + try { + final FileOutputStream out = new FileOutputStream(f); + boolean failed = true; + try { + // writes to .new + write(bean,out,false); + + // no exception: set failed=false for finaly {} block. + failed = false; + } finally { + out.close(); + // An exception was raised: delete temporary file. + if (failed == true) f.delete(); + } + + // rename to ~ and .new to + commit(file,f); + } catch (JAXBException x) { + final IOException io = + new IOException("Failed to write SessionConfigBean to " + + file+": "+x,x); + throw io; + } + } + + /** + * Creates an XML string representation of the given bean. + * @throws IllegalArgumentException if the bean class is not known by the + * underlying XMLbinding context. + * @return An XML string representation of the given bean. + **/ + public static String toString(Object bean) { + try { + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final Marshaller m = createMarshaller(); + m.setProperty(m.JAXB_FRAGMENT,Boolean.TRUE); + m.marshal(bean, baos); + return baos.toString(); + } catch (JAXBException x) { + final IllegalArgumentException iae = + new IllegalArgumentException( + "Failed to write SessionConfigBean: "+x,x); + throw iae; + } + } + + /** + * Creates an XML clone of the given bean. + *

      + * In other words, this method XML-serializes the given bean, and + * XML-deserializes a copy of that bean. + *

      + * @return A deep-clone of the given bean. + * @throws IllegalArgumentException if the bean class is not known by the + * underlying XML binding context. + * @param bean The bean to clone. + */ + public static ScanManagerConfig xmlClone(ScanManagerConfig bean) { + final Object clone = copy(bean); + return (ScanManagerConfig)clone; + } + + /** + * Creates an XML clone of the given bean. + *

      + * In other words, this method XML-serializes the given bean, and + * XML-deserializes a copy of that bean. + *

      + * @throws IllegalArgumentException if the bean class is not known by the + * underlying XML binding context. + * @return A deep-clone of the given bean. + **/ + private static Object copy(Object bean) { + try { + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final Marshaller m = createMarshaller(); + m.marshal(bean, baos); + final ByteArrayInputStream bais = + new ByteArrayInputStream(baos.toByteArray()); + return createUnmarshaller().unmarshal(bais); + } catch (JAXBException x) { + final IllegalArgumentException iae = + new IllegalArgumentException("Failed to write SessionConfigBean: "+x,x); + throw iae; + } + } + + /** + * Creates an XML clone of the given bean. + *

      + * In other words, this method XML-serializes the given bean, and + * XML-deserializes a copy of that bean. + *

      + * @return A deep-clone of the given bean. + * @throws IllegalArgumentException if the bean class is not known by the + * underlying XML binding context. + * @param bean The bean to clone. + */ + public static DirectoryScannerConfig xmlClone(DirectoryScannerConfig bean) { + final Object clone = copy(bean); + return (DirectoryScannerConfig)clone; + } + + /** + * Reads the configuration from the XML configuration file. + * @throws IOException if it fails to read the configuration. + * @return A {@code ScanManagerConfig} bean read from the + * XML configuration file. + **/ + public synchronized ScanManagerConfig readFromFile() throws IOException { + final File f = new File(file); + if (!f.exists()) + throw new IOException("No such file: "+file); + if (!f.canRead()) + throw new IOException("Can't read file: "+file); + try { + return read(f); + } catch (JAXBException x) { + final IOException io = + new IOException("Failed to read SessionConfigBean from " + + file+": "+x,x); + throw io; + } + } + + /** + * Reads the configuration from the given XML configuration file. + * @param f the file to read from. + * @return A {@code ScanManagerConfig} bean read from the + * XML configuration file. + * @throws javax.xml.bind.JAXBException if it fails to read the configuration. + */ + public static ScanManagerConfig read(File f) + throws JAXBException { + final Unmarshaller u = createUnmarshaller(); + return (ScanManagerConfig) u.unmarshal(f); + + } + + /** + * Writes the given bean to the given output stream. + * @param bean the bean to write. + * @param os the output stream to write to. + * @param fragment whether the {@code } header should be + * included. The header is not included if the bean is just an + * XML fragment encapsulated in a higher level XML element. + * @throws JAXBException An XML Binding exception occurred. + **/ + public static void write(ScanManagerConfig bean, OutputStream os, + boolean fragment) + throws JAXBException { + writeXml((Object)bean,os,fragment); + } + + /** + * Writes the given bean to the given output stream. + * @param bean the bean to write. + * @param os the output stream to write to. + * @param fragment whether the {@code } header should be + * included. The header is not included if the bean is just an + * XML fragment encapsulated in a higher level XML element. + * @throws JAXBException An XML Binding exception occurred. + **/ + public static void write(ResultRecord bean, OutputStream os, boolean fragment) + throws JAXBException { + writeXml((Object)bean,os,fragment); + } + + /** + * Writes the given bean to the given output stream. + * @param bean the bean to write. + * @param os the output stream to write to. + * @param fragment whether the {@code } header should be + * included. The header is not included if the bean is just an + * XML fragment encapsulated in a higher level XML element. + * @throws JAXBException An XML Binding exception occurred. + **/ + private static void writeXml(Object bean, OutputStream os, boolean fragment) + throws JAXBException { + final Marshaller m = createMarshaller(); + if (fragment) m.setProperty(m.JAXB_FRAGMENT,Boolean.TRUE); + m.marshal(bean,os); + } + + // Creates a JAXB Unmarshaller. + private static Unmarshaller createUnmarshaller() throws JAXBException { + return getContext().createUnmarshaller(); + } + + // Creates a JAXB Marshaller - for nicely XML formatted output. + private static Marshaller createMarshaller() throws JAXBException { + final Marshaller m = getContext().createMarshaller(); + m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE); + return m; + } + + // Creates a JAXBContext if needed, and returns it. + // The JAXBContext instance we create will be able to handle the + // ScanManagerConfig and ResultRecord classes, plus all the property + // classes they reference (DirectoryScannerBean etc...). + // + private static synchronized JAXBContext getContext() throws JAXBException { + if (context == null) + context = JAXBContext.newInstance(ScanManagerConfig.class, + ResultRecord.class); + return context; + } + + + // Creates a new XML temporary file called .new + // This method is used to implement atomic writing to file. + // The usual sequence is: + // + // Final tmp = newXmlTmpFile(basename); + // boolean failed = true; + // try { + // ... write to 'tmp' ... + // // no exception: set failed=false for finaly {} block. + // failed = false; + // } finally + // // failed==true means there was an exception and + // // commit won't be called... + // if (failed==true) tmp.delete(); + // } + // commit(tmp,basename) + // + private static File newXmlTmpFile(String basename) throws IOException { + final File f = new File(basename+".new"); + if (!f.createNewFile()) + throw new IOException("file "+f.getName()+" already exists"); + + try { + final OutputStream newStream = new FileOutputStream(f); + try { + final String decl = + ""; + newStream.write(decl.getBytes("UTF-8")); + newStream.flush(); + } finally { + newStream.close(); + } + } catch (IOException x) { + f.delete(); + throw x; + } + return f; + } + + // Commit the temporary file by renaming to ~ + // and tmpFile to . + private static File commit(String basename, File tmpFile) + throws IOException { + try { + final String backupName = basename+"~"; + final File desired = new File(basename); + final File backup = new File(backupName); + backup.delete(); + if (desired.exists()) { + if (!desired.renameTo(new File(backupName))) + throw new IOException("can't rename to "+backupName); + } + if (!tmpFile.renameTo(new File(basename))) + throw new IOException("can't rename to "+basename); + } catch (IOException x) { + tmpFile.delete(); + throw x; + } + return new File(basename); + } + + /** + * Creates a new committed XML file for {@code }, containing only + * the {@code } header. + *

      This method will rename {@code } to {@code ~}, + * if it exists. + *

      + * @return A newly created XML file containing the regular + * {@code } header. + * @param basename The name of the new file. + * @throws IOException if the new XML file couldn't be created. + */ + public static File createNewXmlFile(String basename) throws IOException { + return commit(basename,newXmlTmpFile(basename)); + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/package.html b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/package.html new file mode 100644 index 0000000..5390c29 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/package.html @@ -0,0 +1,69 @@ + + + + + + + + com.sun.jmx.examples.scandir.config + + +

      + This package defines plain Java Beans, annotated for + XML bindings, and used to store and model the scandir + application configuration. +

      +

      All the Java Beans defined in this package have been + designed to be naturally serialized by JAXB. + Their bean properties were designed to minimize + the number of XML annotation required, as well as + making them transparently convertible by the + JMX MXBean framework. +

      +

      The {@link com.sun.jmx.examples.scandir.config.ScanManagerConfig} + bean corresponds to the root element of the application's configuration. + From an instance of this element, the + {@link com.sun.jmx.examples.scandir.ScanManagerMXBean} will be + able to initialize the + {@link com.sun.jmx.examples.scandir.ResultLogManagerMXBean} and will + create, register and initialize + {@link com.sun.jmx.examples.scandir.DirectoryScannerMXBean DirectoryScannerMXBeans} +

      +

      The {@link com.sun.jmx.examples.scandir.config.XmlConfigUtils} class is a simple utility + classes used to deal with XML and XML configuration files. +

      +

      The {@link com.sun.jmx.examples.scandir.config.ResultRecord ResultRecords} + are used to store the results of directory scans in the result logs + managed by the {@link com.sun.jmx.examples.scandir.ResultLogManagerMXBean} +

      + + diff --git a/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/package.html b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/package.html new file mode 100644 index 0000000..54d3172 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/package.html @@ -0,0 +1,45 @@ + + + + + + + com.sun.jmx.examples.scandir + + +

      + This package defines the set of MBeans which compose the + management interface of the scandir application. +

      + + + diff --git a/runtime/sample/jmx/jmx-scandir/src/etc/access.properties b/runtime/sample/jmx/jmx-scandir/src/etc/access.properties new file mode 100644 index 0000000..c8286ed --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/etc/access.properties @@ -0,0 +1,51 @@ +###################################################################### +# Default Access Control File for Remote JMX(TM) Monitoring +###################################################################### +# +# Access control file for Remote JMX API access to monitoring. +# This file defines the allowed access for different roles. The +# password file (jmxremote.password by default) defines the roles and their +# passwords. To be functional, a role must have an entry in +# both the password and the access files. +# +# Default location of this file is $JRE/lib/management/jmxremote.access +# You can specify an alternate location by specifying a property in +# the management config file $JRE/lib/management/management.properties +# (See that file for details) +# +# The file format for password and access files is syntactically the same +# as the Properties file format. The syntax is described in the Javadoc +# for java.util.Properties.load. +# Typical access file has multiple lines, where each line is blank, +# a comment (like this one), or an access control entry. +# +# An access control entry consists of a role name, and an +# associated access level. The role name is any string that does not +# itself contain spaces or tabs. It corresponds to an entry in the +# password file (jmxremote.password). The access level is one of the +# following: +# "readonly" grants access to read attributes of MBeans. +# For monitoring, this means that a remote client in this +# role can read measurements but cannot perform any action +# that changes the environment of the running program. +# "readwrite" grants access to read and write attributes of MBeans, +# to invoke operations on them, and to create or remove them. +# This access should be granted to only trusted clients, +# since they can potentially interfere with the smooth +# operation of a running program +# +# A given role should have at most one entry in this file. If a role +# has no entry, it has no access. +# If multiple entries are found for the same role name, then the last +# access entry is used. +# +# +# Default access control entries: +# o The "monitorRole" role has readonly access. +# o The "controlRole" role has readwrite access. +# +# monitorRole readonly +# controlRole readwrite + +guest readonly +admin readwrite diff --git a/runtime/sample/jmx/jmx-scandir/src/etc/management.properties b/runtime/sample/jmx/jmx-scandir/src/etc/management.properties new file mode 100644 index 0000000..5035139 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/etc/management.properties @@ -0,0 +1,273 @@ +##################################################################### +# Default Configuration File for Java Platform Management +##################################################################### +# +# The Management Configuration file (in java.util.Properties format) +# will be read if one of the following system properties is set: +# -Dcom.sun.management.jmxremote.port= +# or -Dcom.sun.management.snmp.port= +# or -Dcom.sun.management.config.file= +# +# The default Management Configuration file is: +# +# $JRE/lib/management/management.properties +# +# Another location for the Management Configuration File can be specified +# by the following property on the Java command line: +# +# -Dcom.sun.management.config.file= +# +# If -Dcom.sun.management.config.file= is set, the port +# number for the management agent can be specified in the config file +# using the following lines: +# +# ################ Management Agent Port ######################### +# +# For setting the JMX RMI agent port use the following line +com.sun.management.jmxremote.port=4545 +# +# For setting the SNMP agent port use the following line +# com.sun.management.snmp.port= + +##################################################################### +# Optional Instrumentation +##################################################################### +# +# By default only the basic instrumentation with low overhead is on. +# The following properties allow to selectively turn on optional +# instrumentation which are off by default and may have some +# additional overhead. +# +# com.sun.management.enableThreadContentionMonitoring +# +# This option enables thread contention monitoring if the +# Java virtual machine supports such instrumentation. +# Refer to the specification for the java.lang.management.ThreadMBean +# interface - see isThreadContentionMonitoringSupported() method. +# + +# To enable thread contention monitoring, uncomment the following line +# com.sun.management.enableThreadContentionMonitoring + +##################################################################### +# SNMP Management Properties +##################################################################### +# +# If the system property -Dcom.sun.management.snmp.port= +# is set then +# - The SNMP agent (with the Java virtual machine MIB) is started +# that listens on the specified port for incoming SNMP requests. +# - the following properties for read for SNMP management. +# +# The configuration can be specified only at startup time. +# Later changes to the above system property (e.g. via setProperty method), this +# config file, or the ACL file has no effect to the running SNMP agent. +# + +# +# ##################### SNMP Trap Port ######################### +# +# com.sun.management.snmp.trap= +# Specifies the remote port number at which managers are expected +# to listen for trap. For each host defined in the ACL file, +# the SNMP agent will send traps at : +# Default for this property is 162. +# + +# To set port for sending traps to a different port use the following line +# com.sun.management.snmp.trap= + +# +# ################ SNMP listen interface ######################### +# +# com.sun.management.snmp.interface= +# Specifies the local interface on which the SNMP agent will bind. +# This is usefull when running on machines which have several +# interfaces defined. It makes it possible to listen to a specific +# subnet accessible through that interface. +# Default for this property is "localhost". +# +# The format of the value for that property is any string accepted +# by java.net.InetAddress.getByName(String). +# + +# For restricting the port on which SNMP agent listens use the following line +# com.sun.management.snmp.interface= + +# +# #################### SNMP ACL file ######################### +# +# com.sun.management.snmp.acl=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then the ACL file +# is not checked: all manager hosts are allowed all access. +# + +# For SNMP without checking ACL file uncomment the following line +# com.sun.management.snmp.acl=false + +# +# com.sun.management.snmp.acl.file=filepath +# Specifies location for ACL file +# This is optional - default location is +# $JRE/lib/management/snmp.acl +# +# If the property "com.sun.management.snmp.acl" is set to false, +# then this property and the ACL file are ignored. +# Otherwise the ACL file must exist and be in the valid format. +# If the ACL file is empty or non existent then no access is allowed. +# +# The SNMP agent will read the ACL file at startup time. +# Modification to the ACL file has no effect to any running SNMP +# agents which read that ACL file at startup. +# + +# For a non-default acl file location use the following line +# com.sun.management.snmp.acl.file=filepath + +##################################################################### +# RMI Management Properties +##################################################################### +# +# If system property -Dcom.sun.management.jmxremote.port= +# is set then +# - A MBean server is started +# - JRE Platform MBeans are registered in the MBean server +# - RMI connector is published in a private readonly registry at +# specified port using a well known name, "jmxrmi" +# - the following properties are read for JMX remote management. +# +# The configuration can be specified only at startup time. +# Later changes to above system property (e.g. via setProperty method), +# this config file, the password file, or the access file have no effect to the +# running MBean server, the connector, or the registry. +# + +# +# ###################### RMI SSL ############################# +# +# com.sun.management.jmxremote.ssl=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then SSL is not used. +# + +# For RMI monitoring without SSL use the following line +# com.sun.management.jmxremote.ssl=false + +# com.sun.management.jmxremote.ssl.enabled.cipher.suites= +# The value of this property is a string that is a comma-separated list +# of SSL/TLS cipher suites to enable. This property can be specified in +# conjunction with the previous property "com.sun.management.jmxremote.ssl" +# in order to control which particular SSL/TLS cipher suites are enabled +# for use by accepted connections. If this property is not specified then +# the SSL/TLS RMI Server Socket Factory uses the SSL/TLS cipher suites that +# are enabled by default. +# + +# com.sun.management.jmxremote.ssl.enabled.protocols= +# The value of this property is a string that is a comma-separated list +# of SSL/TLS protocol versions to enable. This property can be specified in +# conjunction with the previous property "com.sun.management.jmxremote.ssl" +# in order to control which particular SSL/TLS protocol versions are +# enabled for use by accepted connections. If this property is not +# specified then the SSL/TLS RMI Server Socket Factory uses the SSL/TLS +# protocol versions that are enabled by default. +# + +# com.sun.management.jmxremote.ssl.need.client.auth=true|false +# Default for this property is false. (Case for true/false ignored) +# If this property is specified as true in conjunction with the previous +# property "com.sun.management.jmxremote.ssl" then the SSL/TLS RMI Server +# Socket Factory will require client authentication. +# + +# For RMI monitoring with SSL client authentication use the following line +com.sun.management.jmxremote.ssl.need.client.auth=true + +# com.sun.management.jmxremote.registry.ssl=true|false +# Default for this property is false. (Case for true/false ignored) +# If this property is specified as true then the RMI registry used +# to bind the RMIServer remote object is protected with SSL/TLS +# RMI Socket Factories that can be configured with the properties: +# com.sun.management.jmxremote.ssl.enabled.cipher.suites +# com.sun.management.jmxremote.ssl.enabled.protocols +# com.sun.management.jmxremote.ssl.need.client.auth +# If the two properties below are true at the same time, i.e. +# com.sun.management.jmxremote.ssl=true +# com.sun.management.jmxremote.registry.ssl=true +# then the RMIServer remote object and the RMI registry are +# both exported with the same SSL/TLS RMI Socket Factories. +# + +# For using an SSL/TLS protected RMI registry use the following line +com.sun.management.jmxremote.registry.ssl=true + +# +# ################ RMI User authentication ################ +# +# com.sun.management.jmxremote.authenticate=true|false +# Default for this property is true. (Case for true/false ignored) +# If this property is specified as false then no authentication is +# performed and all users are allowed all access. +# + +# For RMI monitoring without any checking use the following line +# com.sun.management.jmxremote.authenticate=false + +# +# ################ RMI Login configuration ################### +# +# com.sun.management.jmxremote.login.config= +# Specifies the name of a JAAS login configuration entry to use when +# authenticating users of RMI monitoring. +# +# Setting this property is optional - the default login configuration +# specifies a file-based authentication that uses the password file. +# +# When using this property to override the default login configuration +# then the named configuration entry must be in a file that gets loaded +# by JAAS. In addition, the login module(s) specified in the configuration +# should use the name and/or password callbacks to acquire the user's +# credentials. See the NameCallback and PasswordCallback classes in the +# javax.security.auth.callback package for more details. +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# + +# For a non-default login configuration use the following line +# com.sun.management.jmxremote.login.config= + +# +# ################ RMI Password file location ################## +# +# com.sun.management.jmxremote.password.file=filepath +# Specifies location for password file +# This is optional - default location is +# $JRE/lib/management/jmxremote.password +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# Otherwise the password file must exist and be in the valid format. +# If the password file is empty or non-existent then no access is allowed. +# + +# For a non-default password file location use the following line +com.sun.management.jmxremote.password.file=src/etc/password.properties + +# +# ################ RMI Access file location ##################### +# +# com.sun.management.jmxremote.access.file=filepath +# Specifies location for access file +# This is optional - default location is +# $JRE/lib/management/jmxremote.access +# +# If the property "com.sun.management.jmxremote.authenticate" is set to +# false, then this property and the password & access files are ignored. +# Otherwise, the access file must exist and be in the valid format. +# If the access file is empty or non-existent then no access is allowed. +# + +# For a non-default password file location use the following line +com.sun.management.jmxremote.access.file=src/etc/access.properties diff --git a/runtime/sample/jmx/jmx-scandir/src/etc/password.properties b/runtime/sample/jmx/jmx-scandir/src/etc/password.properties new file mode 100644 index 0000000..d90c8c8 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/etc/password.properties @@ -0,0 +1,55 @@ +############################################################## +# Password File for Remote JMX Monitoring +############################################################## +# +# Password file for Remote JMX API access to monitoring. This +# file defines the different roles and their passwords. The access +# control file (jmxremote.access by default) defines the allowed +# access for each role. To be functional, a role must have an entry +# in both the password and the access files. +# +# Default location of this file is $JRE/lib/management/jmxremote.password +# You can specify an alternate location by specifying a property in +# the management config file $JRE/lib/management/management.properties +# or by specifying a system property (See that file for details). + + +############################################################## +# File permissions of the jmxremote.password file +############################################################## +# Since there are cleartext passwords stored in this file, +# this file must be readable by ONLY the owner, +# otherwise the program will exit with an error. +# +# The file format for password and access files is syntactically the same +# as the Properties file format. The syntax is described in the Javadoc +# for java.util.Properties.load. +# Typical password file has multiple lines, where each line is blank, +# a comment (like this one), or a password entry. +# +# +# A password entry consists of a role name and an associated +# password. The role name is any string that does not itself contain +# spaces or tabs. The password is again any string that does not +# contain spaces or tabs. Note that passwords appear in the clear in +# this file, so it is a good idea not to use valuable passwords. +# +# A given role should have at most one entry in this file. If a role +# has no entry, it has no access. +# If multiple entries are found for the same role name, then the last one +# is used. +# +# In a typical installation, this file can be read by anybody on the +# local machine, and possibly by people on other machines. +# For # security, you should either restrict the access to this file, +# or specify another, less accessible file in the management config file +# as described above. +# +# Following are two commented-out entries. The "measureRole" role has +# password "QED". The "controlRole" role has password "R&D". +# +# monitorRole QED +# controlRole R&D + +guest guestpasswd +admin adminpasswd diff --git a/runtime/sample/jmx/jmx-scandir/src/etc/testconfig.xml b/runtime/sample/jmx/jmx-scandir/src/etc/testconfig.xml new file mode 100644 index 0000000..cf0fece --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/src/etc/testconfig.xml @@ -0,0 +1,53 @@ + + + + + + + 2048 + build/scandir.log + 128 + + + + NOTIFY LOGRESULT + + + + .*\.class + 4096 + + + build + + + diff --git a/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/DirectoryScannerTest.java b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/DirectoryScannerTest.java new file mode 100644 index 0000000..06d1559 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/DirectoryScannerTest.java @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.ResultRecord; +import com.sun.jmx.examples.scandir.config.ScanManagerConfig; +import java.util.LinkedList; +import java.util.concurrent.BlockingQueue; +import junit.framework.*; +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import static com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState.*; +import com.sun.jmx.examples.scandir.ScanManagerTest.Call; +import java.util.EnumSet; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import javax.management.AttributeChangeNotification; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; + +import static com.sun.jmx.examples.scandir.ScanManagerTest.*; +import static com.sun.jmx.examples.scandir.TestUtils.*; +import java.io.File; +import java.lang.management.ManagementFactory; +import java.util.List; + +/** + * Unit tests for {@code DirectoryScanner} + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class DirectoryScannerTest extends TestCase { + + public DirectoryScannerTest(String testName) { + super(testName); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public static Test suite() { + TestSuite suite = new TestSuite(DirectoryScannerTest.class); + + return suite; + } + + private void doTestOperation( + DirectoryScannerMXBean proxy, + Call op, + EnumSet after, + String testName) + throws Exception { + System.out.println("doTestOperation: "+testName); + + final LinkedBlockingQueue queue = + new LinkedBlockingQueue(); + + NotificationListener listener = new NotificationListener() { + public void handleNotification(Notification notification, + Object handback) { + try { + queue.put(notification); + } catch (Exception x) { + System.err.println("Failed to queue notif: "+x); + } + } + }; + NotificationFilter filter = null; + Object handback = null; + final ScanState before; + final NotificationEmitter emitter = (NotificationEmitter) + makeNotificationEmitter(proxy,DirectoryScannerMXBean.class); + emitter.addNotificationListener(listener, filter, handback); + before = proxy.getState(); + op.call(); + try { + final Notification notification = + queue.poll(3000,TimeUnit.MILLISECONDS); + assertEquals(AttributeChangeNotification.ATTRIBUTE_CHANGE, + notification.getType()); + assertEquals(AttributeChangeNotification.class, + notification.getClass()); + assertEquals(getObjectName(proxy), + notification.getSource()); + AttributeChangeNotification acn = + (AttributeChangeNotification)notification; + assertEquals("State",acn.getAttributeName()); + assertEquals(ScanState.class.getName(),acn.getAttributeType()); + assertEquals(before,ScanState.valueOf((String)acn.getOldValue())); + assertContained(after,ScanState.valueOf((String)acn.getNewValue())); + emitter.removeNotificationListener(listener,filter,handback); + } finally { + try { + op.cancel(); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + + /** + * Test of getRootDirectory method, of class com.sun.jmx.examples.scandir.DirectoryScanner. + */ + public void testGetRootDirectory() throws Exception { + System.out.println("getRootDirectory"); + + final ScanManagerMXBean manager = ScanManager.register(); + try { + final String tmpdir = System.getProperty("java.io.tmpdir"); + final ScanDirConfigMXBean config = manager.getConfigurationMBean(); + System.err.println("Configuration MXBean is: " + config); + final DirectoryScannerConfig bean = + config.addDirectoryScanner("test",tmpdir,".*",0,0); + final String root = bean.getRootDirectory(); + if (root == null) + throw new NullPointerException("bean.getRootDirectory()"); + if (config.getConfiguration().getScan("test").getRootDirectory() == null) + throw new NullPointerException("config.getConfig().getScan(\"test\").getRootDirectory()"); + manager.applyConfiguration(true); + final DirectoryScannerMXBean proxy = + manager.getDirectoryScanners().get("test"); + final File tmpFile = new File(tmpdir); + final File rootFile = new File(proxy.getRootDirectory()); + assertEquals(tmpFile,rootFile); + } catch (Exception x) { + x.printStackTrace(); + throw x; + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + + /** + * Test of scan method, of class com.sun.jmx.examples.scandir.DirectoryScanner. + */ + public void testScan() throws Exception { + System.out.println("scan"); + + final ScanManagerMXBean manager = ScanManager.register(); + try { + final String tmpdir = System.getProperty("java.io.tmpdir"); + final ScanDirConfigMXBean config = manager.getConfigurationMBean(); + final DirectoryScannerConfig bean = + config.addDirectoryScanner("test1",tmpdir,".*",0,0); + config.addDirectoryScanner("test2",tmpdir,".*",0,0); + config.addDirectoryScanner("test3",tmpdir,".*",0,0); + manager.applyConfiguration(true); + final DirectoryScannerMXBean proxy = + manager.getDirectoryScanners().get("test1"); + final Call op = new Call() { + public void call() throws Exception { + final BlockingQueue queue = + new LinkedBlockingQueue(); + final NotificationListener listener = new NotificationListener() { + public void handleNotification(Notification notification, + Object handback) { + try { + queue.put(notification); + } catch (Exception e) { + e.printStackTrace(); + } + } + }; + manager.start(); + while(true) { + final Notification n = queue.poll(10,TimeUnit.SECONDS); + if (n == null) break; + final AttributeChangeNotification at = + (AttributeChangeNotification) n; + if (RUNNING == ScanState.valueOf((String)at.getNewValue())) + break; + else { + System.err.println("New state: "+(String)at.getNewValue() + +" isn't "+RUNNING); + } + } + assertContained(EnumSet.of(SCHEDULED,RUNNING,COMPLETED), + proxy.getState()); + } + public void cancel() throws Exception { + manager.stop(); + } + }; + doTestOperation(proxy,op, + EnumSet.of(RUNNING,SCHEDULED,COMPLETED), + "scan"); + } catch (Exception x) { + x.printStackTrace(); + throw x; + } finally { + try { + manager.stop(); + } catch (Exception x) { + System.err.println("Failed to stop: "+x); + } + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + /** + * Test of getState method, of class com.sun.jmx.examples.scandir.DirectoryScanner. + */ + public void testGetState() { + System.out.println("getState"); + + final DirectoryScannerConfig bean = + new DirectoryScannerConfig("test"); + bean.setRootDirectory(System.getProperty("java.io.tmpdir")); + final ResultLogManager log = new ResultLogManager(); + DirectoryScanner instance = + new DirectoryScanner(bean,log); + + ScanState expResult = STOPPED; + ScanState result = instance.getState(); + assertEquals(STOPPED, result); + instance.scan(); + result = instance.getState(); + assertEquals(COMPLETED, result); + } + + /** + * Test of addNotificationListener method, of class com.sun.jmx.examples.scandir.DirectoryScanner. + */ + public void testAddNotificationListener() throws Exception { + System.out.println("addNotificationListener"); + + final ScanManagerMXBean manager = ScanManager.register(); + final Call op = new Call() { + public void call() throws Exception { + manager.start(); + } + public void cancel() throws Exception { + manager.stop(); + } + }; + try { + final String tmpdir = System.getProperty("java.io.tmpdir"); + final ScanDirConfigMXBean config = manager.getConfigurationMBean(); + final DirectoryScannerConfig bean = + config.addDirectoryScanner("test1",tmpdir,".*",0,0); + manager.applyConfiguration(true); + final DirectoryScannerMXBean proxy = + manager.getDirectoryScanners().get("test1"); + doTestOperation(proxy,op, + EnumSet.of(RUNNING,SCHEDULED), + "scan"); + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + +} diff --git a/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanDirConfigTest.java b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanDirConfigTest.java new file mode 100644 index 0000000..c7e9599 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanDirConfigTest.java @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import com.sun.jmx.examples.scandir.config.XmlConfigUtils; +import com.sun.jmx.examples.scandir.config.FileMatch; +import java.io.FileOutputStream; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import junit.framework.*; +import com.sun.jmx.examples.scandir.config.DirectoryScannerConfig; +import com.sun.jmx.examples.scandir.config.ScanManagerConfig; +import java.io.File; +import java.util.concurrent.BlockingQueue; +import javax.management.*; + +/** + * Unit tests for {@code ScanDirConfig} + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class ScanDirConfigTest extends TestCase { + + public ScanDirConfigTest(String testName) { + super(testName); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public static Test suite() { + TestSuite suite = new TestSuite(ScanDirConfigTest.class); + + return suite; + } + + /** + * Test of load method, of class com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testLoad() throws Exception { + System.out.println("load"); + + final File file = File.createTempFile("testconf",".xml"); + final ScanDirConfig instance = new ScanDirConfig(file.getAbsolutePath()); + final ScanManagerConfig bean = + new ScanManagerConfig("testLoad"); + final DirectoryScannerConfig dir = + new DirectoryScannerConfig("tmp"); + dir.setRootDirectory(file.getParent()); + bean.putScan(dir); + XmlConfigUtils.write(bean,new FileOutputStream(file),false); + instance.load(); + + assertEquals(bean,instance.getConfiguration()); + bean.removeScan(dir.getName()); + XmlConfigUtils.write(bean,new FileOutputStream(file),false); + + assertNotSame(bean,instance.getConfiguration()); + + instance.load(); + + assertEquals(bean,instance.getConfiguration()); + + } + + /** + * Test of save method, of class com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testSave() throws Exception { + System.out.println("save"); + + final File file = File.createTempFile("testconf",".xml"); + final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + final ScanManagerMXBean manager = ScanManager.register(mbs); + + try { + final ScanDirConfigMXBean instance = + manager.createOtherConfigurationMBean("testSave",file.getAbsolutePath()); + assertTrue(mbs.isRegistered( + ScanManager.makeScanDirConfigName("testSave"))); + final ScanManagerConfig bean = + new ScanManagerConfig("testSave"); + final DirectoryScannerConfig dir = + new DirectoryScannerConfig("tmp"); + dir.setRootDirectory(file.getParent()); + bean.putScan(dir); + instance.setConfiguration(bean); + instance.save(); + final ScanManagerConfig loaded = + new XmlConfigUtils(file.getAbsolutePath()).readFromFile(); + assertEquals(instance.getConfiguration(),loaded); + assertEquals(bean,loaded); + + instance.getConfiguration().removeScan("tmp"); + instance.save(); + assertNotSame(loaded,instance.getConfiguration()); + final ScanManagerConfig loaded2 = + new XmlConfigUtils(file.getAbsolutePath()).readFromFile(); + assertEquals(instance.getConfiguration(),loaded2); + } finally { + manager.close(); + mbs.unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } + final ObjectName all = + new ObjectName(ScanManager.SCAN_MANAGER_NAME.getDomain()+":*"); + assertEquals(0,mbs.queryNames(all,null).size()); + } + + /** + * Test of saveTo method, of class com.sun.jmx.examples.scandir.ScanProfile. + */ + /* + public void testSaveTo() throws Exception { + System.out.println("saveTo"); + + String filename = ""; + ScanDirConfig instance = null; + + instance.saveTo(filename); + + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); + } + */ + + /** + * Test of getXmlConfigString method, of class com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testGetXmlConfigString() throws Exception { + System.out.println("getXmlConfigString"); + + try { + final File file = File.createTempFile("testconf",".xml"); + final ScanDirConfig instance = new ScanDirConfig(file.getAbsolutePath()); + final ScanManagerConfig bean = + new ScanManagerConfig("testGetXmlConfigString"); + final DirectoryScannerConfig dir = + new DirectoryScannerConfig("tmp"); + dir.setRootDirectory(file.getParent()); + bean.putScan(dir); + instance.setConfiguration(bean); + System.out.println("Expected: " + XmlConfigUtils.toString(bean)); + System.out.println("Received: " + + instance.getConfiguration().toString()); + assertEquals(XmlConfigUtils.toString(bean), + instance.getConfiguration().toString()); + } catch (Exception x) { + x.printStackTrace(); + throw x; + } + } + + + /** + * Test of addNotificationListener method, of class + * com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testAddNotificationListener() throws Exception { + System.out.println("addNotificationListener"); + + final File file = File.createTempFile("testconf",".xml"); + final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + final ScanManagerMXBean manager = ScanManager.register(mbs); + + try { + final ScanDirConfigMXBean instance = + TestUtils.makeNotificationEmitter( + manager.createOtherConfigurationMBean("testSave", + file.getAbsolutePath()), + ScanDirConfigMXBean.class); + assertTrue(mbs.isRegistered( + ScanManager.makeScanDirConfigName("testSave"))); + DirectoryScannerConfig dir = + instance.addDirectoryScanner("tmp",file.getParent(),".*",0,0); + + final BlockingQueue queue = + new LinkedBlockingQueue(); + final NotificationListener listener = new NotificationListener() { + public void handleNotification(Notification notification, + Object handback) { + queue.add(notification); + } + }; + NotificationFilter filter = null; + Object handback = null; + + ((NotificationEmitter)instance).addNotificationListener(listener, + filter, handback); + + instance.save(); + final ScanManagerConfig loaded = + new XmlConfigUtils(file.getAbsolutePath()).readFromFile(); + assertEquals(instance.getConfiguration(),loaded); + + final ScanManagerConfig newConfig = + instance.getConfiguration(); + newConfig.removeScan("tmp"); + instance.setConfiguration(newConfig); + instance.save(); + assertNotSame(loaded,instance.getConfiguration()); + final ScanManagerConfig loaded2 = + new XmlConfigUtils(file.getAbsolutePath()).readFromFile(); + assertEquals(instance.getConfiguration(),loaded2); + instance.load(); + for (int i=0;i<4;i++) { + final Notification n = queue.poll(3,TimeUnit.SECONDS); + assertNotNull(n); + assertEquals(TestUtils.getObjectName(instance),n.getSource()); + switch(i) { + case 0: case 2: + assertEquals(ScanDirConfig.NOTIFICATION_SAVED,n.getType()); + break; + case 1: + assertEquals(ScanDirConfig.NOTIFICATION_MODIFIED,n.getType()); + break; + case 3: + assertEquals(ScanDirConfig.NOTIFICATION_LOADED,n.getType()); + break; + default: break; + } + } + } finally { + manager.close(); + mbs.unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } + final ObjectName all = + new ObjectName(ScanManager.SCAN_MANAGER_NAME.getDomain()+":*"); + assertEquals(0,mbs.queryNames(all,null).size()); + } + + /** + * Test of getConfigFilename method, of class + * com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testGetConfigFilename() throws Exception { + System.out.println("getConfigFilename"); + + final File file = File.createTempFile("testconf",".xml"); + final ScanDirConfig instance = new ScanDirConfig(file.getAbsolutePath()); + + String result = instance.getConfigFilename(); + assertEquals(file.getAbsolutePath(), new File(result).getAbsolutePath()); + + } + + /** + * Test of addDirectoryScanner method, of class + * com.sun.jmx.examples.scandir.ScanDirConfig. + */ + public void testAddDirectoryScanner() throws IOException { + System.out.println("addDirectoryScanner"); + + System.out.println("save"); + + final File file = File.createTempFile("testconf",".xml"); + final ScanDirConfig instance = new ScanDirConfig(file.getAbsolutePath()); + final ScanManagerConfig bean = + new ScanManagerConfig("testSave"); + final DirectoryScannerConfig dir = + new DirectoryScannerConfig("tmp"); + dir.setRootDirectory(file.getParent()); + FileMatch filter = new FileMatch(); + filter.setFilePattern(".*"); + dir.setIncludeFiles(new FileMatch[] { + filter + }); + instance.setConfiguration(bean); + instance.addDirectoryScanner(dir.getName(), + dir.getRootDirectory(), + filter.getFilePattern(), + filter.getSizeExceedsMaxBytes(), + 0); + instance.save(); + final ScanManagerConfig loaded = + new XmlConfigUtils(file.getAbsolutePath()).readFromFile(); + assertNotNull(loaded.getScan(dir.getName())); + assertEquals(dir,loaded.getScan(dir.getName())); + assertEquals(instance.getConfiguration(),loaded); + assertEquals(instance.getConfiguration().getScan(dir.getName()),dir); + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanManagerTest.java b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanManagerTest.java new file mode 100644 index 0000000..94e3c98 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/ScanManagerTest.java @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import javax.management.InstanceNotFoundException; +import javax.management.Notification; +import junit.framework.*; +import static com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState.*; +import com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState; +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.logging.Logger; +import javax.management.AttributeChangeNotification; +import javax.management.JMException; +import javax.management.JMX; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.ObjectInstance; +import javax.management.ObjectName; + +import static com.sun.jmx.examples.scandir.ScanManagerMXBean.ScanState.*; + +/** + * Unit tests for {@code ScanManager} + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class ScanManagerTest extends TestCase { + + public ScanManagerTest(String testName) { + super(testName); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public static Test suite() { + TestSuite suite = new TestSuite(ScanManagerTest.class); + + return suite; + } + + /** + * Test of makeSingletonName method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testMakeSingletonName() { + System.out.println("makeSingletonName"); + + Class clazz = ScanManagerMXBean.class; + + ObjectName expResult = ScanManager.SCAN_MANAGER_NAME; + ObjectName result = ScanManager.makeSingletonName(clazz); + assertEquals(expResult, result); + + } + + /** + * Test of register method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testRegister() throws Exception { + System.out.println("register"); + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + + + ScanManagerMXBean result = ScanManager.register(mbs); + try { + assertEquals(STOPPED,result.getState()); + } finally { + try { + mbs.unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + + } + + public interface Call { + public void call() throws Exception; + public void cancel() throws Exception; + } + + /** + * Test of addNotificationListener method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testAddNotificationListener() throws Exception { + System.out.println("addNotificationListener"); + + final ScanManagerMXBean manager = ScanManager.register(); + final Call op = new Call() { + public void call() throws Exception { + manager.schedule(100000,0); + } + public void cancel() throws Exception { + manager.stop(); + } + }; + try { + doTestOperation(manager,op, + EnumSet.of(RUNNING,SCHEDULED), + "schedule"); + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + /** + * Test of addNotificationListener method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + private void doTestOperation( + ScanManagerMXBean proxy, + Call op, + EnumSet after, + String testName) + throws Exception { + System.out.println("doTestOperation: "+testName); + + final LinkedBlockingQueue queue = + new LinkedBlockingQueue(); + + NotificationListener listener = new NotificationListener() { + public void handleNotification(Notification notification, + Object handback) { + try { + queue.put(notification); + } catch (Exception x) { + System.err.println("Failed to queue notif: "+x); + } + } + }; + NotificationFilter filter = null; + Object handback = null; + final ScanState before; + final NotificationEmitter emitter = (NotificationEmitter)proxy; + emitter.addNotificationListener(listener, filter, handback); + before = proxy.getState(); + op.call(); + try { + final Notification notification = + queue.poll(3000,TimeUnit.MILLISECONDS); + assertEquals(AttributeChangeNotification.ATTRIBUTE_CHANGE, + notification.getType()); + assertEquals(AttributeChangeNotification.class, + notification.getClass()); + assertEquals(ScanManager.SCAN_MANAGER_NAME, + notification.getSource()); + AttributeChangeNotification acn = + (AttributeChangeNotification)notification; + assertEquals("State",acn.getAttributeName()); + assertEquals(ScanState.class.getName(),acn.getAttributeType()); + assertEquals(before,ScanState.valueOf((String)acn.getOldValue())); + assertContained(after,ScanState.valueOf((String)acn.getNewValue())); + emitter.removeNotificationListener(listener,filter,handback); + } finally { + try { + op.cancel(); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + /** + * Test of preRegister method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testPreRegister() throws Exception { + System.out.println("preRegister"); + + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + ObjectName name = new ObjectName("DownUnder:type=Wombat"); + ScanManager instance = new ScanManager(); + + ObjectName expResult = ScanManager.SCAN_MANAGER_NAME; + ObjectName result; + try { + result = instance.preRegister(server, name); + throw new RuntimeException("bad name accepted!"); + } catch (IllegalArgumentException x) { + // OK! + result = instance.preRegister(server, null); + } + assertEquals(expResult, result); + result = instance.preRegister(server, ScanManager.SCAN_MANAGER_NAME); + assertEquals(expResult, result); + } + + + /** + * Test of getState method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testGetState() throws IOException, InstanceNotFoundException { + System.out.println("getState"); + + ScanManager instance = new ScanManager(); + + ScanState expResult = ScanState.STOPPED; + ScanState result = instance.getState(); + assertEquals(expResult, result); + instance.start(); + final ScanState afterStart = instance.getState(); + assertContained(EnumSet.of(RUNNING,SCHEDULED,COMPLETED),afterStart); + instance.stop(); + assertEquals(STOPPED,instance.getState()); + instance.schedule(1000000L,1000000L); + assertEquals(SCHEDULED,instance.getState()); + instance.stop(); + assertEquals(STOPPED,instance.getState()); + } + + /** + * Test of schedule method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testSchedule() throws Exception { + System.out.println("schedule"); + + final long delay = 10000L; + final long interval = 10000L; + + final ScanManagerMXBean manager = ScanManager.register(); + final Call op = new Call() { + public void call() throws Exception { + manager.schedule(delay,interval); + assertEquals(SCHEDULED,manager.getState()); + } + public void cancel() throws Exception { + manager.stop(); + } + }; + try { + doTestOperation(manager,op,EnumSet.of(SCHEDULED), + "schedule"); + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + public static void assertContained(EnumSet allowed, + ScanState state) { + final String msg = String.valueOf(state) + " is not one of " + allowed; + assertTrue(msg,allowed.contains(state)); + } + + /** + * Test of stop method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testStop() throws Exception { + System.out.println("stop"); + final ScanManagerMXBean manager = ScanManager.register(); + try { + manager.schedule(1000000,0); + assertContained(EnumSet.of(SCHEDULED),manager.getState()); + final Call op = new Call() { + public void call() throws Exception { + manager.stop(); + assertEquals(STOPPED,manager.getState()); + } + public void cancel() throws Exception { + if (manager.getState() != STOPPED) + manager.stop(); + } + }; + doTestOperation(manager,op,EnumSet.of(STOPPED),"stop"); + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + + /** + * Test of start method, of class com.sun.jmx.examples.scandir.ScanManager. + */ + public void testStart() throws Exception { + final ScanManagerMXBean manager = ScanManager.register(); + try { + final Call op = new Call() { + public void call() throws Exception { + assertEquals(STOPPED,manager.getState()); + manager.start(); + assertContained(EnumSet.of(RUNNING,SCHEDULED,COMPLETED), + manager.getState()); + } + public void cancel() throws Exception { + manager.stop(); + } + }; + doTestOperation(manager,op,EnumSet.of(RUNNING,SCHEDULED,COMPLETED), + "start"); + } finally { + try { + ManagementFactory.getPlatformMBeanServer(). + unregisterMBean(ScanManager.SCAN_MANAGER_NAME); + } catch (Exception x) { + System.err.println("Failed to cleanup: "+x); + } + } + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/TestUtils.java b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/TestUtils.java new file mode 100644 index 0000000..4832949 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/TestUtils.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Proxy; +import java.util.logging.Logger; +import javax.management.JMX; +import javax.management.MBeanServerConnection; +import javax.management.MBeanServerInvocationHandler; +import javax.management.NotificationEmitter; +import javax.management.ObjectName; + +/** + * A utility class defining static methods used by our tests. + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class TestUtils { + + /** + * A logger for this class. + **/ + private static final Logger LOG = + Logger.getLogger(TestUtils.class.getName()); + + /** Creates a new instance of TestUtils */ + private TestUtils() { + } + + /** + * Returns the ObjectName of the MBean that a proxy object + * is proxying. + **/ + public static ObjectName getObjectName(Object proxy) { + if (!(proxy instanceof Proxy)) + throw new IllegalArgumentException("not a "+Proxy.class.getName()); + final Proxy p = (Proxy) proxy; + final InvocationHandler handler = + Proxy.getInvocationHandler(proxy); + if (handler instanceof MBeanServerInvocationHandler) + return ((MBeanServerInvocationHandler)handler).getObjectName(); + throw new IllegalArgumentException("not a JMX Proxy"); + } + + /** + * Transfroms a proxy implementing T in a proxy implementing T plus + * NotificationEmitter + * + **/ + public static T makeNotificationEmitter(T proxy, + Class mbeanInterface) { + if (proxy instanceof NotificationEmitter) + return proxy; + if (proxy == null) return null; + if (!(proxy instanceof Proxy)) + throw new IllegalArgumentException("not a "+Proxy.class.getName()); + final Proxy p = (Proxy) proxy; + final InvocationHandler handler = + Proxy.getInvocationHandler(proxy); + if (!(handler instanceof MBeanServerInvocationHandler)) + throw new IllegalArgumentException("not a JMX Proxy"); + final MBeanServerInvocationHandler h = + (MBeanServerInvocationHandler)handler; + final ObjectName name = h.getObjectName(); + final MBeanServerConnection mbs = h.getMBeanServerConnection(); + final boolean isMXBean = h.isMXBean(); + final T newProxy; + if (isMXBean) + newProxy = JMX.newMXBeanProxy(mbs,name,mbeanInterface,true); + else + newProxy = JMX.newMBeanProxy(mbs,name,mbeanInterface,true); + return newProxy; + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/config/XmlConfigUtilsTest.java b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/config/XmlConfigUtilsTest.java new file mode 100644 index 0000000..e4cea49 --- /dev/null +++ b/runtime/sample/jmx/jmx-scandir/test/com/sun/jmx/examples/scandir/config/XmlConfigUtilsTest.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.jmx.examples.scandir.config; + +import junit.framework.*; +import java.io.File; + +/** + * Unit tests for {@code XmlConfigUtils} + * + * @author Sun Microsystems, 2006 - All rights reserved. + */ +public class XmlConfigUtilsTest extends TestCase { + + public XmlConfigUtilsTest(String testName) { + super(testName); + } + + protected void setUp() throws Exception { + } + + protected void tearDown() throws Exception { + } + + public static Test suite() { + TestSuite suite = new TestSuite(XmlConfigUtilsTest.class); + + return suite; + } + + + /** + * Test of writeToFile method, of class XmlConfigUtils. + */ + public void testWriteToFile() throws Exception { + System.out.println("writeToFile"); + + final File file = File.createTempFile("test",".xml"); + file.deleteOnExit(); + + final String tmp = System.getProperty("java.io.tmpdir"); + + DirectoryScannerConfig dir1 = + new DirectoryScannerConfig("scan2"); + dir1.setRootDirectory(tmp); + ScanManagerConfig bean = new ScanManagerConfig("session2"); + bean.putScan(dir1); + XmlConfigUtils instance = new XmlConfigUtils(file.getPath()); + + instance.writeToFile(bean); + } + + /** + * Test of readFromFile method, of class com.sun.jmx.examples.scandir.config.XmlConfigUtils. + */ + public void testReadFromFile() throws Exception { + System.out.println("readFromFile"); + + final String tmp = System.getProperty("java.io.tmpdir"); + final File file = File.createTempFile("test",".xml"); + file.deleteOnExit(); + + DirectoryScannerConfig dir1 = + new DirectoryScannerConfig("scan1"); + dir1.setRootDirectory(tmp); + ScanManagerConfig bean = new ScanManagerConfig("session1"); + bean.putScan(dir1); + XmlConfigUtils instance = new XmlConfigUtils(file.getPath()); + + instance.writeToFile(bean); + + ScanManagerConfig expResult = bean; + ScanManagerConfig result = instance.readFromFile(); + System.out.println(result); + assertEquals(expResult, result); + + + } + +} diff --git a/runtime/sample/jmx/jmx-scandir/truststore b/runtime/sample/jmx/jmx-scandir/truststore new file mode 100644 index 0000000..2f5ba34 Binary files /dev/null and b/runtime/sample/jmx/jmx-scandir/truststore differ diff --git a/runtime/sample/lambda/BulkDataOperations/index.html b/runtime/sample/lambda/BulkDataOperations/index.html new file mode 100644 index 0000000..5a43026 --- /dev/null +++ b/runtime/sample/lambda/BulkDataOperations/index.html @@ -0,0 +1,49 @@ + + + + Bulk Data Operations Demo + + +

      Bulk Data Operations Demo

      + +

      + This demo shows how to use bulk data operations with the new JDK8 + Collections API. + The demo also demonstrates new features of JDK8 such as lambda expressions + and method/constructor references. +

      + +
        +
      • CSV Processor

        + +

        + Analyzes a CSV file, finds and collects useful information, computes + different statistics. For more information, see the source file. +

        + Source: src/CSVProcessor.java +
      • Grep

        + +

        + Behaves like the standard Linux tool Grep. For more information, see + the source file. +

        + Source: src/Grep.java +
      • PasswordGenerator

        + +

        + Produces a password of desired length. For more information see + source file. +

        + Source: src/PasswordGenerator.java +
      • WC

        + +

        + Counts newlines, words, characters, and the maximum line length of a + text file. For more information, see the source + file. +

        + Source: src/WC.java +
      + + \ No newline at end of file diff --git a/runtime/sample/lambda/BulkDataOperations/src/CSVProcessor.java b/runtime/sample/lambda/BulkDataOperations/src/CSVProcessor.java new file mode 100644 index 0000000..ded9030 --- /dev/null +++ b/runtime/sample/lambda/BulkDataOperations/src/CSVProcessor.java @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.*; +import java.util.function.*; +import java.util.regex.Pattern; +import java.util.stream.Collector; +import java.util.stream.Collectors; + +import static java.lang.Double.parseDouble; +import static java.util.stream.Collectors.*; + +/** + * CSVProcessor is a tool for processing CSV files. There are several + * command-line options. Consult the {@link #printUsageAndExit} method for + * instructions and command line parameters. This sample shows examples of the + * following features: + *
        + *
      • Lambda and bulk operations. Working with streams: map(...), filter(...), + * sorted(...) methods. The collect(...) method with different collectors: + * Collectors.maxBy(...), Collectors.minBy(...), Collectors.toList(), + * Collectors.toCollection(...), Collectors.groupingBy(...), + * Collectors.toDoubleSummaryStatistics(...), and a custom Collector.
      • + *
      • Static method reference for printing values.
      • + *
      • Try-with-resources feature for closing files.
      • + *
      • Switch by String feature.
      • + *
      • Other new APIs: Pattern.asPredicate(), BinaryOperator + * BufferedReader.lines(), Collection.forEach(...), Comparator.comparing(...), + * Comparator.reversed(), Arrays.stream(...).
      • + *
      + * + */ +public class CSVProcessor { + + //Number of characters that may be read + private static final int READ_AHEAD_LIMIT = 100_000_000; + + /** + * The main method for the CSVProcessor program. Run the program with an + * empty argument list to see possible arguments. + * + * @param args the argument list for CSVProcessor. + */ + public static void main(String[] args) { + if (args.length < 2) { + printUsageAndExit(); + } + try (BufferedReader br = new BufferedReader( + Files.newBufferedReader(Paths.get(args[args.length - 1])))) { + //Assume that the first line contains column names. + List header = Arrays.stream(br.readLine().split(",")) + .map(String::trim).collect(toList()); + //Calculate an index of the column in question. + int column = getColumnNumber(header, args[1]); + switch (args[0]) { + case "sort": + verifyArgumentNumber(args, 4); + //Define the sort order. + boolean isAsc; + switch (args[2].toUpperCase()) { + case "ASC": + isAsc = true; + break; + case "DESC": + isAsc = false; + break; + default: + printUsageAndExit("Illegal argument" + args[2]); + return;//Should not be reached. + } + /* + * Create a comparator that compares lines by comparing + * values in the specified column. + */ + Comparator cmp + = Comparator.comparing(str -> getCell(str, column), + String.CASE_INSENSITIVE_ORDER); + /* + * sorted(...) is used to sort records. + * forEach(...) is used to output sorted records. + */ + br.lines().sorted(isAsc ? cmp : cmp.reversed()) + .forEach(System.out::println); + break; + case "search": + verifyArgumentNumber(args, 4); + /* + * Records are filtered by a regex. + * forEach(...) is used to output filtered records. + */ + Predicate pattern + = Pattern.compile(args[2]).asPredicate(); + br.lines().filter(str -> pattern.test(getCell(str, column))) + .forEach(System.out::println); + break; + case "groupby": + verifyArgumentNumber(args, 3); + /* + * Group lines by values in the column with collect(...), and + * print with forEach(...) for every distinct value within + * the column. + */ + br.lines().collect( + Collectors.groupingBy(str -> getCell(str, column), + toCollection(TreeSet::new))) + .forEach((str, set) -> { + System.out.println(str + ":"); + set.forEach(System.out::println); + }); + break; + case "stat": + verifyArgumentNumber(args, 3); + + /* + * BufferedReader will be read several times. + * Mark this point to return here after each pass. + * BufferedReader will be read right after the headers line + * because it is already read. + */ + br.mark(READ_AHEAD_LIMIT); + + /* + * Statistics can be collected by a custom collector in one + * pass. One pass is preferable. + */ + System.out.println( + br.lines().collect(new Statistics(column))); + + /* + * Alternatively, statistics can be collected + * by a built-in API in several passes. + * This method demonstrates how separate operations can be + * implemented using a built-in API. + */ + br.reset(); + statInSeveralPasses(br, column); + break; + default: + printUsageAndExit("Illegal argument" + args[0]); + } + } catch (IOException e) { + printUsageAndExit(e.toString()); + } + } + + private static void statInSeveralPasses(BufferedReader br, int column) + throws IOException { + System.out.println("#-----Statistics in several passes-------#"); + //Create a comparator to compare records by the column. + Comparator comparator + = Comparator.comparing( + (String str) -> parseDouble(getCell(str, column))); + //Find max record by using Collectors.maxBy(...) + System.out.println( + "Max: " + br.lines().collect(maxBy(comparator)).get()); + br.reset(); + //Find min record by using Collectors.minBy(...) + System.out.println( + "Min: " + br.lines().collect(minBy(comparator)).get()); + br.reset(); + //Compute the average value and sum with + //Collectors.toDoubleSummaryStatistics(...) + DoubleSummaryStatistics doubleSummaryStatistics + = br.lines().collect(summarizingDouble( + str -> parseDouble(getCell(str, column)))); + System.out.println("Average: " + doubleSummaryStatistics.getAverage()); + System.out.println("Sum: " + doubleSummaryStatistics.getSum()); + } + + private static void verifyArgumentNumber(String[] args, int n) { + if (args.length != n) { + printUsageAndExit("Expected " + n + " arguments but was " + + args.length); + } + } + + private static int getColumnNumber(List header, String name) { + int column = header.indexOf(name); + if (column == -1) { + printUsageAndExit("There is no column with name " + name); + } + return column; + } + + private static String getCell(String record, int column) { + return record.split(",")[column].trim(); + } + + private static void printUsageAndExit(String... str) { + System.out.println("Usages:"); + + System.out.println("CSVProcessor sort COLUMN_NAME ASC|DESC FILE"); + System.out.println("Sort lines by column COLUMN_NAME in CSV FILE\n"); + + System.out.println("CSVProcessor search COLUMN_NAME REGEX FILE"); + System.out.println("Search for REGEX in column COLUMN_NAME in CSV FILE\n"); + + System.out.println("CSVProcessor groupby COLUMN_NAME FILE"); + System.out.println("Split lines into different groups according to column " + + "COLUMN_NAME value\n"); + + System.out.println("CSVProcessor stat COLUMN_NAME FILE"); + System.out.println("Compute max/min/average/sum statistics by column " + + "COLUMN_NAME\n"); + + Arrays.asList(str).forEach(System.err::println); + System.exit(1); + } + + /* + * This is a custom implementation of the Collector interface. + * Statistics are objects gather max,min,sum,average statistics. + */ + private static class Statistics + implements Collector { + + + /* + * This implementation does not need to be thread safe because + * the parallel implementation of + * {@link java.util.stream.Stream#collect Stream.collect()} + * provides the necessary partitioning and isolation for safe parallel + * execution. + */ + private String maxRecord; + private String minRecord; + + private double sum; + private int lineCount; + private final BinaryOperator maxOperator; + private final BinaryOperator minOperator; + private final int column; + + public Statistics(int column) { + this.column = column; + Comparator cmp = Comparator.comparing( + (String str) -> parseDouble(getCell(str, column))); + maxOperator = BinaryOperator.maxBy(cmp); + minOperator = BinaryOperator.minBy(cmp); + } + + /* + * Process line. + */ + public Statistics accept(String line) { + maxRecord = maxRecord == null + ? line : maxOperator.apply(maxRecord, line); + minRecord = minRecord == null + ? line : minOperator.apply(minRecord, line); + + sum += parseDouble(getCell(line, column)); + lineCount++; + return this; + } + + + /* + * Merge two Statistics. + */ + public Statistics combine(Statistics stat) { + maxRecord = maxOperator.apply(maxRecord, stat.getMaxRecord()); + minRecord = minOperator.apply(minRecord, stat.getMinRecord()); + sum += stat.getSum(); + lineCount += stat.getLineCount(); + return this; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("#------Statistics------#\n"); + sb.append("Max: ").append(getMaxRecord()).append("\n"); + sb.append("Min: ").append(getMinRecord()).append("\n"); + sb.append("Sum = ").append(getSum()).append("\n"); + sb.append("Average = ").append(average()).append("\n"); + sb.append("#------Statistics------#\n"); + return sb.toString(); + } + + @Override + public Supplier supplier() { + return () -> new Statistics(column); + } + + @Override + public BiConsumer accumulator() { + return Statistics::accept; + } + + @Override + public BinaryOperator combiner() { + return Statistics::combine; + + } + + @Override + public Function finisher() { + return stat -> stat; + } + + @Override + public Set characteristics() { + return EnumSet.of(Characteristics.IDENTITY_FINISH); + } + + private String getMaxRecord() { + return maxRecord; + } + + private String getMinRecord() { + return minRecord; + } + + private double getSum() { + return sum; + } + + private double average() { + return sum / lineCount; + } + + private int getLineCount() { + return lineCount; + } + + } + +} diff --git a/runtime/sample/lambda/BulkDataOperations/src/Grep.java b/runtime/sample/lambda/BulkDataOperations/src/Grep.java new file mode 100644 index 0000000..cb4bdf7 --- /dev/null +++ b/runtime/sample/lambda/BulkDataOperations/src/Grep.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import static java.util.stream.Collectors.toList; + +/** + * Grep prints lines matching a regex. See {@link #printUsageAndExit(String...)} + * method for instructions and command line parameters. This sample shows + * examples of using next features: + *
        + *
      • Lambda and bulk operations. Working with streams: + * map(...),filter(...),flatMap(...),limit(...) methods.
      • + *
      • Static method reference for printing values.
      • + *
      • New Collections API forEach(...) method.
      • + *
      • Try-with-resources feature.
      • + *
      • new Files.walk(...), Files.lines(...) API.
      • + *
      • Streams that need to be closed.
      • + *
      + * + */ +public class Grep { + + private static void printUsageAndExit(String... str) { + System.out.println("Usage: " + Grep.class.getSimpleName() + + " [OPTION]... PATTERN FILE..."); + System.out.println("Search for PATTERN in each FILE. " + + "If FILE is a directory then whole file tree of the directory" + + " will be processed."); + System.out.println("Example: grep -m 100 'hello world' menu.h main.c"); + System.out.println("Options:"); + System.out.println(" -m NUM: stop analysis after NUM matches"); + Arrays.asList(str).forEach(System.err::println); + System.exit(1); + } + + /** + * The main method for the Grep program. Run program with empty argument + * list to see possible arguments. + * + * @param args the argument list for Grep. + * @throws java.io.IOException If an I/O error occurs. + */ + public static void main(String[] args) throws IOException { + long maxCount = Long.MAX_VALUE; + if (args.length < 2) { + printUsageAndExit(); + } + int i = 0; + //parse OPTIONS + while (args[i].startsWith("-")) { + switch (args[i]) { + case "-m": + try { + maxCount = Long.parseLong(args[++i]); + } catch (NumberFormatException ex) { + printUsageAndExit(ex.toString()); + } + break; + default: + printUsageAndExit("Unexpected option " + args[i]); + } + i++; + } + //parse PATTERN + Pattern pattern = Pattern.compile(args[i++]); + if (i == args.length) { + printUsageAndExit("There are no files for input"); + } + + try { + /* + * First obtain the list of all paths. + * For a small number of arguments there is little to be gained + * by producing this list in parallel. For one argument + * there will be no parallelism. + * + * File names are converted to paths. If a path is a directory then + * Stream is populated with whole file tree of the directory by + * flatMap() method. Files are filtered from directories. + */ + List files = Arrays.stream(args, i, args.length) + .map(Paths::get) + // flatMap will ensure each I/O-based stream will be closed + .flatMap(Grep::getPathStream) + .filter(Files::isRegularFile) + .collect(toList()); + /* + * Then operate on that list in parallel. + * This is likely to give a more even distribution of work for + * parallel execution. + * + * Lines are extracted from files. Lines are filtered by pattern. + * Stream is limited by number of matches. Each remaining string is + * displayed in std output by method reference System.out::println. + */ + files.parallelStream() + // flatMap will ensure each I/O-based stream will be closed + .flatMap(Grep::path2Lines) + .filter(pattern.asPredicate()) + .limit(maxCount) + .forEachOrdered(System.out::println); + } catch (UncheckedIOException ioe) { + printUsageAndExit(ioe.toString()); + } + } + + /** + * Flattens file system hierarchy into a stream. This code is not inlined + * for the reason of Files.walk() throwing a checked IOException that must + * be caught. + * + * @param path - the file or directory + * @return Whole file tree starting from path, a stream with one element - + * the path itself - if it is a file. + */ + private static Stream getPathStream(Path path) { + try { + return Files.walk(path); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Produces a stream of lines from a file. The result is a stream in order + * to close it later. This code is not inlined for the reason of + * Files.lines() throwing a checked IOException that must be caught. + * + * @param path - the file to read + * @return stream of lines from the file + */ + private static Stream path2Lines(Path path) { + try { + return Files.lines(path); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} diff --git a/runtime/sample/lambda/BulkDataOperations/src/PasswordGenerator.java b/runtime/sample/lambda/BulkDataOperations/src/PasswordGenerator.java new file mode 100644 index 0000000..e467798 --- /dev/null +++ b/runtime/sample/lambda/BulkDataOperations/src/PasswordGenerator.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.IntStream; + +/** + * Generates password of desired length. See {@link #usage} method + * for instructions and command line parameters. This sample shows usages of: + *
        + *
      • Method references.
      • + *
      • Lambda and bulk operations. A stream of random integers is mapped to + * chars, limited by desired length and printed in standard output as password + * string.
      • + *
      + * + */ +public class PasswordGenerator { + + private static void usage() { + System.out.println("Usage: PasswordGenerator LENGTH"); + System.out.println( + "Password Generator produces password of desired LENGTH."); + } + + private static final List PASSWORD_CHARS = new ArrayList<>(); + + //Valid symbols. + static { + IntStream.rangeClosed('0', '9').forEach(PASSWORD_CHARS::add); // 0-9 + IntStream.rangeClosed('A', 'Z').forEach(PASSWORD_CHARS::add); // A-Z + IntStream.rangeClosed('a', 'z').forEach(PASSWORD_CHARS::add); // a-z + } + + /** + * The main method for the PasswordGenerator program. Run program with empty + * argument list to see possible arguments. + * + * @param args the argument list for PasswordGenerator. + */ + public static void main(String[] args) { + + if (args.length != 1) { + usage(); + return; + } + + long passwordLength; + try { + passwordLength = Long.parseLong(args[0]); + if (passwordLength < 1) { + printMessageAndUsage("Length has to be positive"); + return; + } + } catch (NumberFormatException ex) { + printMessageAndUsage("Unexpected number format" + args[0]); + return; + } + /* + * Stream of random integers is created containing Integer values + * in range from 0 to PASSWORD_CHARS.size(). + * The stream is limited by passwordLength. + * Valid chars are selected by generated index. + */ + new SecureRandom().ints(passwordLength, 0, PASSWORD_CHARS.size()) + .map(PASSWORD_CHARS::get) + .forEach(i -> System.out.print((char) i)); + } + + private static void printMessageAndUsage(String message) { + System.err.println(message); + usage(); + } + +} diff --git a/runtime/sample/lambda/BulkDataOperations/src/WC.java b/runtime/sample/lambda/BulkDataOperations/src/WC.java new file mode 100644 index 0000000..c724f15 --- /dev/null +++ b/runtime/sample/lambda/BulkDataOperations/src/WC.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.function.Consumer; +import java.util.regex.Pattern; + +/** + * WC - Prints newline, word, and character counts for each file. See + * the {@link #usage} method for instructions and command line parameters. This + * sample shows usages of: + *
        + *
      • Lambda and bulk operations. Shows how to create a custom collector to + * gather custom statistics. Implements the collection of statistics using a + * built-in API.
      • + *
      • Constructor reference.
      • + *
      • Try-with-resources feature.
      • + *
      + * + */ +public class WC { + + //The number of characters that may be read. + private static final int READ_AHEAD_LIMIT = 100_000_000; + + //The pattern for splitting strings by non word characters to get words. + private static final Pattern nonWordPattern = Pattern.compile("\\W"); + + /** + * The main method for the WC program. Run the program with an empty + * argument list to see possible arguments. + * + * @param args the argument list for WC + * @throws java.io.IOException If an input exception occurred. + */ + public static void main(String[] args) throws IOException { + + if (args.length != 1) { + usage(); + return; + } + + try (BufferedReader reader = new BufferedReader( + new FileReader(args[0]))) { + reader.mark(READ_AHEAD_LIMIT); + /* + * Statistics can be gathered in four passes using a built-in API. + * The method demonstrates how separate operations can be + * implemented using a built-in API. + */ + collectInFourPasses(reader); + /* + * Usage of several passes to collect data is not the best way. + * Statistics can be gathered by a custom collector in one pass. + */ + reader.reset(); + collectInOnePass(reader); + } catch (FileNotFoundException e) { + usage(); + System.err.println(e); + } + } + + private static void collectInFourPasses(BufferedReader reader) + throws IOException { + /* + * Input is read as a stream of lines by lines(). + * Every line is turned into a stream of chars by the flatMapToInt(...) + * method. + * Length of the stream is counted by count(). + */ + System.out.println("Character count = " + + reader.lines().flatMapToInt(String::chars).count()); + /* + * Input is read as a stream of lines by lines(). + * Every line is split by nonWordPattern into words by flatMap(...) + * method. + * Empty lines are removed by the filter(...) method. + * Length of the stream is counted by count(). + */ + reader.reset(); + System.out.println("Word count = " + + reader.lines() + .flatMap(nonWordPattern::splitAsStream) + .filter(str -> !str.isEmpty()).count()); + + reader.reset(); + System.out.println("Newline count = " + reader.lines().count()); + /* + * Input is read as a stream of lines by lines(). + * Every line is mapped to its length. + * Maximum of the lengths is calculated. + */ + reader.reset(); + System.out.println("Max line length = " + + reader.lines().mapToInt(String::length).max().getAsInt()); + } + + private static void collectInOnePass(BufferedReader reader) { + /* + * The collect() method has three parameters: + * The first parameter is the {@code WCStatistic} constructor reference. + * collect() will create {@code WCStatistics} instances, where + * statistics will be aggregated. + * The second parameter shows how {@code WCStatistics} will process + * String. + * The third parameter shows how to merge two {@code WCStatistic} + * instances. + * + * Also {@code Collector} can be used, which would be more reusable + * solution. See {@code CSVProcessor} example for how {@code Collector} + * can be implemented. + * + * Note that the any performance increase when going parallel will + * depend on the size of the input (lines) and the cost per-element. + */ + WCStatistics wc = reader.lines().parallel() + .collect(WCStatistics::new, + WCStatistics::accept, + WCStatistics::combine); + System.out.println(wc); + } + + private static void usage() { + System.out.println("Usage: " + WC.class.getSimpleName() + " FILE"); + System.out.println("Print newline, word," + + " character counts and max line length for FILE."); + } + + private static class WCStatistics implements Consumer { + /* + * @implNote This implementation does not need to be thread safe because + * the parallel implementation of + * {@link java.util.stream.Stream#collect Stream.collect()} + * provides the necessary partitioning and isolation for safe parallel + * execution. + */ + + private long characterCount; + private long lineCount; + private long wordCount; + private long maxLineLength; + + + /* + * Processes line. + */ + @Override + public void accept(String line) { + characterCount += line.length(); + lineCount++; + wordCount += nonWordPattern.splitAsStream(line) + .filter(str -> !str.isEmpty()).count(); + maxLineLength = Math.max(maxLineLength, line.length()); + } + + /* + * Merges two WCStatistics. + */ + public void combine(WCStatistics stat) { + wordCount += stat.wordCount; + lineCount += stat.lineCount; + characterCount += stat.characterCount; + maxLineLength = Math.max(maxLineLength, stat.maxLineLength); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("#------WCStatistic------#\n"); + sb.append("Character count = ").append(characterCount).append('\n'); + sb.append("Word count = ").append(wordCount).append('\n'); + sb.append("Newline count = ").append(lineCount).append('\n'); + sb.append("Max line length = ").append(maxLineLength).append('\n'); + return sb.toString(); + } + } +} diff --git a/runtime/sample/lambda/DefaultMethods/ArrayIterator.java b/runtime/sample/lambda/DefaultMethods/ArrayIterator.java new file mode 100644 index 0000000..2eca801 --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/ArrayIterator.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * The code sample illustrates the usage of default methods in the JDK 8. Most + * implementations of {@link Iterator} don't provide a useful + * {@link Iterator#remove()} method, however, + * they still have to implement this method to throw + * an UnsupportedOperationException. With the default method, the same + * default behavior in interface Iterator itself can be provided. + */ +public class ArrayIterator { + + /** Close the constructor because ArrayIterator is part of the utility + * class. + */ + protected ArrayIterator() { + throw new UnsupportedOperationException(); + } + + /** + * Returns an iterator that goes over the elements in the array. + * + * @param type of an array element + * @param array source array to iterate over it + * @return an iterator that goes over the elements in the array + */ + public static Iterator iterator(final E[] array) { + return new Iterator() { + /** + * Index of the current position + * + */ + private int index = 0; + + /** + * Returns the next element in the iteration + * + * @return the next element in the iteration + * @throws NoSuchElementException if the iteration has no more + * elements + */ + @Override + public boolean hasNext() { + return (index < array.length); + } + + /** + * Returns {@code true} if the iteration has more elements. (In + * other words, returns {@code true} if {@link #next} returns + * an element, rather than throwing an exception.) + * + * @return {@code true} if the iteration has more elements + */ + @Override + public E next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + return array[index++]; + } + + /** + * This method does not need to be overwritten in JDK 8. + */ + //@Override + //public void remove() { + // throw UnsupportedOperationException( + // "Arrays don't support remove.") + //} + }; + } + + /** + * Sample usage of the ArrayIterator + * + * @param args command-line arguments + */ + public static void main(final String[] args) { + Iterator it = ArrayIterator.iterator( + new String[]{"one", "two", "three"}); + + while (it.hasNext()) { + System.out.println(it.next()); + } + } +} diff --git a/runtime/sample/lambda/DefaultMethods/DiamondInheritance.java b/runtime/sample/lambda/DefaultMethods/DiamondInheritance.java new file mode 100644 index 0000000..9214d58 --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/DiamondInheritance.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * This sample diamond interface inheritance with default methods. + * If there's not already a unique method implementation to inherit, + * you must provide it. The inheritance diagram is similar to the following: + *
      + *                   Animal
      + *                    /   \
      + *                 Horse   Bird
      + *                    \   /
      + *                   Pegasus
      + * 
      + * + * Both {@link Horse} and {@link Bird} interfaces implements the go + * method. The {@link Pegasus} class have to overrides the + * go method. + * + * The new syntax of super-call is used here: + *
      + *     <interface_name>.super.<method>(...);
      + *     For example:  Horse.super.go();
      + * 
      So, Pegasus moves like a horse. + */ +public class DiamondInheritance { + + /** + * Base interface to illustrate the diamond inheritance. + * + * @see DiamondInheritance + */ + public interface Animal { + + /** + * Return string representation of the "go" action for concrete animal + * + * @return string representation of the "go" action for concrete animal + */ + String go(); + } + + /** + * Interface to illustrate the diamond inheritance. + * + * @see DiamondInheritance + */ + public interface Horse extends Animal { + + /** + * Return string representation of the "go" action for horse + * + * @return string representation of the "go" action for horse + */ + @Override + default String go() { + return this.getClass().getSimpleName() + " walks on four legs"; + } + } + + /** + * Interface to illustrate the diamond inheritance. + * + * @see DiamondInheritance + */ + public interface Bird extends Animal { + + /** + * Return string representation of the "go" action for bird + * + * @return string representation of the "go" action for bird + */ + @Override + default String go() { + return this.getClass().getSimpleName() + " walks on two legs"; + } + + /** + * Return string representation of the "fly" action for bird + * + * @return string representation of the "fly" action for bird + */ + default String fly() { + return "I can fly"; + } + } + + /** + * Class to illustrate the diamond inheritance. Pegasus must mix horse and + * bird behavior. + * + * @see DiamondInheritance + */ + public static class Pegasus implements Horse, Bird { + + /** + * Return string representation of the "go" action for the fictitious + * creature Pegasus + * + * @return string representation of the "go" action for the fictitious + * creature Pegasus + */ + @Override + public String go() { + return Horse.super.go(); + } + } + + /** + * Illustrate the behavior of the {@link Pegasus} class + * + * @param args command line arguments + */ + public static void main(final String[] args) { + System.out.println(new Pegasus().go()); + } +} diff --git a/runtime/sample/lambda/DefaultMethods/Inheritance.java b/runtime/sample/lambda/DefaultMethods/Inheritance.java new file mode 100644 index 0000000..961de2c --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/Inheritance.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * The sample illustrates rules to resolve conflicts between inheritance + * candidates with default methods. There are two simple rules: + *
        + *
      • Class wins. If the superclass has a concrete or abstract declaration of + * this method, then it is preferred over all defaults.
      • + *
      • Subtype wins. If an interface extends another interface, and both provide + * a default, then the more specific interface wins.
      • + *
      + */ +public class Inheritance { + + /** + * The behavior of an creature that can swim + */ + public interface Swimable { + + /** + * Return string representation of the swim action for a creature that + * can swim + * + * @return string representation of the swim action for a creature + * that can swim + */ + default String swim() { + return "I can swim."; + } + } + + /** + * The abstract class that overrides {@link #swim} method + */ + public abstract static class Fish implements Swimable { + + /** + * Return string representation of the swim action for a fish + * + * @return string representation of the swim action for a fish + */ + @Override + public String swim() { + return this.getClass().getSimpleName() + " swims under water"; + } + } + + /** + * This class is used for the illustration rule of 1. See the source code + * of the {@link #main} method. + *
      +     *      System.out.println(new Tuna().swim()); //"Tuna swims under water" output is suspected here
      +     * 
      + */ + public static class Tuna extends Fish implements Swimable { + } + + /** + * The behavior of an creature that can dive: the interface that overrides + * {@link #swim} method (subtype of {@link Swimable}) + */ + public interface Diveable extends Swimable { + + /** + * Return string representation of the swim action for a creature that + * can dive + * + * @return string representation of the swim action for a creature + * that can dive + */ + @Override + default String swim() { + return "I can swim on the surface of the water."; + } + + /** + * Return string representation of the dive action for a creature that + * can dive + * + * @return string representation of the dive action for a creature + * that can dive + */ + default String dive() { + return "I can dive."; + } + } + + /** + * This class is used for the illustration of rule 2. See the source code + * of the {@link #main} method + *
      +     *      //"I can swim on the surface of the water." output is suspected here
      +     *      System.out.println(new Duck().swim());
      +     * 
      + */ + public static class Duck implements Swimable, Diveable { + } + + /** + * Illustrate behavior of the classes: {@link Tuna} and {@link Duck} + * + * @param args command line arguments + */ + public static void main(final String[] args) { + // Illustrates rule 1. The Fish.swim() implementation wins + //"Tuna swims under water" is output + System.out.println(new Tuna().swim()); + + // Illustrates rule 2. The Diveable.swim() implementation wins + //"I can swim on the surface of the water." is output + System.out.println(new Duck().swim()); + } +} diff --git a/runtime/sample/lambda/DefaultMethods/MixIn.java b/runtime/sample/lambda/DefaultMethods/MixIn.java new file mode 100644 index 0000000..d9ed81d --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/MixIn.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import java.io.IOException; +import java.lang.reflect.Field; + +/** + * The example illustrates how to use the default method for mixin. + * @see BuildType + * @see Debuggable + */ +public class MixIn { + + /** + * Implement this interface for a class that must be in debug print + */ + public interface Debuggable { + + /** + * Print the class name and all fields to a string. Uses reflection to + * obtain and access fields of this object. + * + * @return the string formatted like the following:
      +         * State of the: <Class Name>
      +         * <member name> : <value>
      +         * ...
      +         * 
      + */ + default String toDebugString() { + StringBuilder sb = new StringBuilder(); + sb.append("State of the: ").append( + this.getClass().getSimpleName()).append("\n"); + for (Class cls = this.getClass(); + cls != null; + cls = cls.getSuperclass()) { + for (Field f : cls.getDeclaredFields()) { + try { + f.setAccessible(true); + sb.append(f.getName()).append(" : "). + append(f.get(this)).append("\n"); + } catch (IllegalAccessException e) { + } + } + } + return sb.toString(); + } + } + + /** + * Sample exception class to demonstrate mixin. This enum inherits the + * behavior of the {@link Debuggable} + */ + public static enum BuildType implements Debuggable { + + BUILD(0, "-build"), + PLAN(0, "-plan"), + EXCLUDE(1, "-exclude"), + TOTAL(2, "-total"); + + private final int compareOrder; + private final String pathSuffix; + + private BuildType(int compareOrder, String pathSuffix) { + this.compareOrder = compareOrder; + this.pathSuffix = pathSuffix; + } + + public int getCompareOrder() { + return compareOrder; + } + + public String getPathSuffix() { + return pathSuffix; + } + } + + /** + * Illustrate the behavior of the MixClass + * + * @param args command-line arguments + * @throws java.io.IOException internal demo error + */ + public static void main(final String[] args) throws IOException { + System.out.println(BuildType.BUILD.toDebugString()); + } +} diff --git a/runtime/sample/lambda/DefaultMethods/Reflection.java b/runtime/sample/lambda/DefaultMethods/Reflection.java new file mode 100644 index 0000000..78424a2 --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/Reflection.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.stream.Stream; + +/** + * The code sample illustrates changes in the reflection API linked + * default methods. Since Java SE 8, a new method is added into the class + * java.lang.reflect.Method, with which you can reflectively + * determine whether or not a default method provided by an interface + * (Method.isDefault()). + */ +public class Reflection { + + /** + * Base interface to illustrate the new reflection API. + * + * @see Dog + */ + public interface Animal { + + /** + * Return string representation of the eat action for Animal + * + * @return string representation of the eat action for Animal + */ + default String eat() { + return this.getClass().getSimpleName() + + " eats like an ordinary animal"; + } + + /** + * Return string representation of the sleep action for Animal + * + * @return string representation of the sleep action for Animal + */ + default String sleep() { + return this.getClass().getSimpleName() + + " sleeps like an ordinary animal"; + } + + /** + * Return string representation of the go action for Animal + * + * @return string representation of the go action for Animal + */ + String go(); + } + + /** + * Dog class to illustrate the new reflection API. You can see that: + *
        + *
      • the {@link #go} and {@link #sleep} methods are not default. + * {@link #go} is not the default implementation and the {@link #sleep} + * method implementation wins as subtype (according with {@link Inheritance} + * rule. 2)
      • + *
      • the {@link #eat} is a simple default method that is not overridden + * in this class. + *
      • + *
      + */ + public static class Dog implements Animal { + + /** + * Return string representation of the go action for Dog + * + * @return string representation of the go action for Dog + */ + @Override + public String go() { + return "Dog walks on four legs"; + } + + /** + * Return string representation of the sleep action for Dog + * + * @return string representation of the sleep action for Dog + */ + @Override + public String sleep() { + return "Dog sleeps"; + } + } + + /** + * Illustrate the usage of the method java.lang.reflect.Method.isDefault() + * + * @param args command-line arguments + * @throws NoSuchMethodException internal demo error + */ + public static void main(final String[] args) throws NoSuchMethodException { + Dog dog = new Dog(); + Stream.of(Dog.class.getMethod("eat"), Dog.class.getMethod("go"), Dog.class.getMethod("sleep")) + .forEach((m) -> { + System.out.println("Method name: " + m.getName()); + System.out.println(" isDefault: " + m.isDefault()); + System.out.print(" invoke: "); + try { + m.invoke(dog); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + } + System.out.println(); + }); + } +} diff --git a/runtime/sample/lambda/DefaultMethods/SimplestUsage.java b/runtime/sample/lambda/DefaultMethods/SimplestUsage.java new file mode 100644 index 0000000..a971858 --- /dev/null +++ b/runtime/sample/lambda/DefaultMethods/SimplestUsage.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * The sample illustrates the simplest use case of the default methods. + */ +public class SimplestUsage { + + /** + * The Animal interface provides the default implementation + * of the {@link #eat} method. + */ + public interface Animal { + + /** + * Return string representation of the eat action for Animal + * + * @return string representation of the eat action for Animal + */ + default String eat() { + return this.getClass().getSimpleName() + + " eats like an ordinary animal"; + } + } + + /** + * The Dog class doesn't have its own implementation of the {@link #eat} + * method and uses the default implementation. + */ + public static class Dog implements Animal { + } + + /** + * The Mosquito class implements {@link #eat} method, its own implementation + * overrides the default implementation. + * + */ + public static class Mosquito implements Animal { + + /** + * Return string representation of the eat action for Mosquito + * + * @return string representation of the eat action for Mosquito + */ + @Override + public String eat() { + return "Mosquito consumes blood"; + } + } + + /** + * Illustrate behavior of the classes: {@link Dog} and {@link Mosquito} + * + * @param args command-line arguments + */ + public static void main(String[] args) { + // "Dog eats like an ordinary animal" is output + System.out.println(new Dog().eat()); + + // "Mosquito consumes blood" is output + System.out.println(new Mosquito().eat()); + } +} diff --git a/runtime/sample/nbproject/project.xml b/runtime/sample/nbproject/project.xml new file mode 100644 index 0000000..8417326 --- /dev/null +++ b/runtime/sample/nbproject/project.xml @@ -0,0 +1,50 @@ + + + + + + org.netbeans.modules.ant.freeform + + + JDK Samples + + + + + jmx/jmx-scandir + scripting/scriptpad + webservices/EbayClient + webservices/EbayServer + + + + diff --git a/runtime/sample/nio/chatserver/ChatServer.java b/runtime/sample/nio/chatserver/ChatServer.java new file mode 100644 index 0000000..f807aa1 --- /dev/null +++ b/runtime/sample/nio/chatserver/ChatServer.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.net.StandardSocketOptions; +import java.nio.channels.*; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +/** + * Implements a chat server, this class holds the list of {@code clients} connected to the server. + * It sets up a server socket using AsynchronousServerSocketChannel listening to a specified port. + */ +public class ChatServer implements Runnable { + private final List connections = Collections.synchronizedList(new ArrayList()); + private int port; + private final AsynchronousServerSocketChannel listener; + private final AsynchronousChannelGroup channelGroup; + + /** + * + * @param port to listen to + * @throws java.io.IOException when failing to start the server + */ + public ChatServer(int port) throws IOException { + channelGroup = AsynchronousChannelGroup.withFixedThreadPool(Runtime.getRuntime().availableProcessors(), + Executors.defaultThreadFactory()); + this.port = port; + listener = createListener(channelGroup); + } + + /** + * + * @return The socket address that the server is bound to + * @throws java.io.IOException if an I/O error occurs + */ + public SocketAddress getSocketAddress() throws IOException { + return listener.getLocalAddress(); + } + + /** + * Start accepting connections + */ + public void run() { + + // call accept to wait for connections, tell it to call our CompletionHandler when there + // is a new incoming connection + listener.accept(null, new CompletionHandler() { + @Override + public void completed(AsynchronousSocketChannel result, Void attachment) { + // request a new accept and handle the incoming connection + listener.accept(null, this); + handleNewConnection(result); + } + + @Override + public void failed(Throwable exc, Void attachment) { + } + }); + } + + /** + * Shuts down the server + * @throws InterruptedException if terminated while waiting for shutdown + * @throws IOException if failing to shutdown the channel group + */ + public void shutdown() throws InterruptedException, IOException { + channelGroup.shutdownNow(); + channelGroup.awaitTermination(1, TimeUnit.SECONDS); + } + + /* + * Creates a listener and starts accepting connections + */ + private AsynchronousServerSocketChannel createListener(AsynchronousChannelGroup channelGroup) throws IOException { + final AsynchronousServerSocketChannel listener = openChannel(channelGroup); + listener.setOption(StandardSocketOptions.SO_REUSEADDR, true); + listener.bind(new InetSocketAddress(port)); + return listener; + } + + private AsynchronousServerSocketChannel openChannel(AsynchronousChannelGroup channelGroup) throws IOException { + return AsynchronousServerSocketChannel.open(channelGroup); + } + + /** + * Creates a new client and adds it to the list of connections. + * Sets the clients handler to the initial state of NameReader + * + * @param channel the newly accepted channel + */ + private void handleNewConnection(AsynchronousSocketChannel channel) { + Client client = new Client(channel, new ClientReader(this, new NameReader(this))); + try { + channel.setOption(StandardSocketOptions.TCP_NODELAY, true); + } catch (IOException e) { + // ignore + } + connections.add(client); + client.run(); + } + + /** + * Sends a message to all clients except the source. + * The method is synchronized as it is desired that messages are sent to + * all clients in the same order as received. + * + * @param client the message source + * @param message the message to be sent + */ + public void writeMessageToClients(Client client, String message) { + synchronized (connections) { + for (Client clientConnection : connections) { + if (clientConnection != client) { + clientConnection.writeMessageFrom(client, message); + } + } + } + } + + public void removeClient(Client client) { + connections.remove(client); + } + + private static void usage() { + System.err.println("ChatServer [-port ]"); + System.exit(1); + } + + public static void main(String[] args) throws IOException { + int port = 5000; + if (args.length != 0 && args.length != 2) { + usage(); + } else if (args.length == 2) { + try { + if (args[0].equals("-port")) { + port = Integer.parseInt(args[1]); + } else { + usage(); + } + } catch (NumberFormatException e) { + usage(); + } + } + System.out.println("Running on port " + port); + new ChatServer(port).run(); + } +} diff --git a/runtime/sample/nio/chatserver/Client.java b/runtime/sample/nio/chatserver/Client.java new file mode 100644 index 0000000..31ee034 --- /dev/null +++ b/runtime/sample/nio/chatserver/Client.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.CompletionHandler; +import java.util.LinkedList; +import java.util.Queue; +import java.util.concurrent.atomic.AtomicReference; + +/** + * Client represents a remote connection to the chat server. + * It contains methods for reading and writing messages from the + * channel. + * Messages are considered to be separated by newline, so incomplete + * messages are buffered in the {@code Client}. + * + * All reads and writes are asynchronous and uses the nio2 asynchronous + * elements. + */ +class Client { + private final AsynchronousSocketChannel channel; + private AtomicReference reader; + private String userName; + private final StringBuilder messageBuffer = new StringBuilder(); + + private final Queue queue = new LinkedList(); + private boolean writing = false; + + public Client(AsynchronousSocketChannel channel, ClientReader reader) { + this.channel = channel; + this.reader = new AtomicReference(reader); + } + + /** + * Enqueues a write of the buffer to the channel. + * The call is asynchronous so the buffer is not safe to modify after + * passing the buffer here. + * + * @param buffer the buffer to send to the channel + */ + private void writeMessage(final ByteBuffer buffer) { + boolean threadShouldWrite = false; + + synchronized(queue) { + queue.add(buffer); + // Currently no thread writing, make this thread dispatch a write + if (!writing) { + writing = true; + threadShouldWrite = true; + } + } + + if (threadShouldWrite) { + writeFromQueue(); + } + } + + private void writeFromQueue() { + ByteBuffer buffer; + + synchronized (queue) { + buffer = queue.poll(); + if (buffer == null) { + writing = false; + } + } + + // No new data in buffer to write + if (writing) { + writeBuffer(buffer); + } + } + + private void writeBuffer(ByteBuffer buffer) { + channel.write(buffer, buffer, new CompletionHandler() { + @Override + public void completed(Integer result, ByteBuffer buffer) { + if (buffer.hasRemaining()) { + channel.write(buffer, buffer, this); + } else { + // Go back and check if there is new data to write + writeFromQueue(); + } + } + + @Override + public void failed(Throwable exc, ByteBuffer attachment) { + } + }); + } + + /** + * Sends a message + * @param string the message + */ + public void writeStringMessage(String string) { + writeMessage(ByteBuffer.wrap(string.getBytes())); + } + + /** + * Send a message from a specific client + * @param client the message is sent from + * @param message to send + */ + public void writeMessageFrom(Client client, String message) { + if (reader.get().acceptsMessages()) { + writeStringMessage(client.getUserName() + ": " + message); + } + } + + /** + * Enqueue a read + * @param completionHandler callback on completed read + */ + public void read(CompletionHandler completionHandler) { + ByteBuffer input = ByteBuffer.allocate(256); + if (!channel.isOpen()) { + return; + } + channel.read(input, input, completionHandler); + } + + /** + * Closes the channel + */ + public void close() { + try { + channel.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Run the current states actions. + */ + public void run() { + reader.get().run(this); + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public void setReader(ClientReader reader) { + this.reader.set(reader); + } + + public String getUserName() { + return userName; + } + + public void appendMessage(String message) { + synchronized (messageBuffer) { + messageBuffer.append(message); + } + } + + /** + * @return the next newline separated message in the buffer. null is returned if the buffer + * doesn't contain any newline. + */ + public String nextMessage() { + synchronized(messageBuffer) { + int nextNewline = messageBuffer.indexOf("\n"); + if (nextNewline == -1) { + return null; + } + String message = messageBuffer.substring(0, nextNewline + 1); + messageBuffer.delete(0, nextNewline + 1); + return message; + } + } +} diff --git a/runtime/sample/nio/chatserver/ClientReader.java b/runtime/sample/nio/chatserver/ClientReader.java new file mode 100644 index 0000000..822125a --- /dev/null +++ b/runtime/sample/nio/chatserver/ClientReader.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.ByteBuffer; +import java.nio.channels.CompletionHandler; + +/** + * Handles a cycle of reading / writing on the {@code Client}. + */ +class ClientReader { + private final DataReader callback; + private final ChatServer chatServer; + + ClientReader(ChatServer chatServer, DataReader callback) { + this.chatServer = chatServer; + this.callback = callback; + } + + public boolean acceptsMessages() { + return callback.acceptsMessages(); + } + + /** + * Runs a cycle of doing a beforeRead action and then enqueuing a new + * read on the client. Handles closed channels and errors while reading. + * If the client is still connected a new round of actions are called. + */ + public void run(final Client client) { + callback.beforeRead(client); + client.read(new CompletionHandler() { + @Override + public void completed(Integer result, ByteBuffer buffer) { + // if result is negative or zero the connection has been closed or something gone wrong + if (result < 1) { + client.close(); + System.out.println("Closing connection to " + client); + chatServer.removeClient(client); + } else { + callback.onData(client, buffer, result); + // enqueue next round of actions + client.run(); + } + } + + @Override + public void failed(Throwable exc, ByteBuffer buffer) { + client.close(); + chatServer.removeClient(client); + } + }); + } +} diff --git a/runtime/sample/nio/chatserver/DataReader.java b/runtime/sample/nio/chatserver/DataReader.java new file mode 100644 index 0000000..8858c9f --- /dev/null +++ b/runtime/sample/nio/chatserver/DataReader.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.ByteBuffer; + +public interface DataReader { + void beforeRead(Client client); + void onData(Client client, ByteBuffer buffer, int bytes); + boolean acceptsMessages(); +} diff --git a/runtime/sample/nio/chatserver/MessageReader.java b/runtime/sample/nio/chatserver/MessageReader.java new file mode 100644 index 0000000..81c370b --- /dev/null +++ b/runtime/sample/nio/chatserver/MessageReader.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.ByteBuffer; + +/** + * Writes all messages in our buffer to the other clients + * and appends new data read from the socket to our buffer + */ +class MessageReader implements DataReader { + private final ChatServer chatServer; + + public MessageReader(ChatServer chatServer) { + this.chatServer = chatServer; + } + + public boolean acceptsMessages() { + return true; + } + + /** + * Write all full messages in our buffer to + * the other clients + * + * @param client the client to read messages from + */ + @Override + public void beforeRead(Client client) { + // Check if we have any messages buffered and send them + String message = client.nextMessage(); + while (message != null) { + chatServer.writeMessageToClients(client, message); + message = client.nextMessage(); + } + } + + /** + * Append the read buffer to the clients message buffer + * @param client the client to append messages to + * @param buffer the buffer we received from the socket + * @param bytes the number of bytes read into the buffer + */ + @Override + public void onData(Client client, ByteBuffer buffer, int bytes) { + buffer.flip(); + // Just append the message on the buffer + client.appendMessage(new String(buffer.array(), 0, bytes)); + } +} diff --git a/runtime/sample/nio/chatserver/NameReader.java b/runtime/sample/nio/chatserver/NameReader.java new file mode 100644 index 0000000..341d4da --- /dev/null +++ b/runtime/sample/nio/chatserver/NameReader.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.ByteBuffer; + +/** + * The first state a newly connected {@code Client} is in, this + * handles writing out the welcoming message and reads the response + * up to a newline. When a newline character have been received + * it changes the handler from NameReader to MessageReader on the + * client. + */ +class NameReader implements DataReader { + private final StringBuilder buffer = new StringBuilder(); + private final ChatServer chatServer; + private boolean once = true; + private static final String NEWLINE = "\n"; + + public NameReader(ChatServer chatServer) { + this.chatServer = chatServer; + } + + /** + * Writes the welcoming message to the client the first time this method + * is called. + * + * @param client the client to receive the message + */ + @Override + public void beforeRead(Client client) { + // if it is a long name that takes more than one read we only want to display Name: once. + if (once) { + client.writeStringMessage("Name: "); + once = false; + } + } + + public boolean acceptsMessages() { + return false; + } + + /** + * Receives incoming data from the socket, searches for a newline + * and tries to set the username if one is found + */ + @Override + public void onData(Client client, ByteBuffer buffer, int bytes) { + buffer.flip(); + String name; + name = this.buffer.append(new String(buffer.array(), 0, bytes)).toString(); + if (name.contains(NEWLINE)) { + onUserNameRead(client, name); + } + } + + /** + * Splits the name on the newlines, takes the first as the username + * and appends everything else to the clients message buffer. + * Sets the clients handler to MessageReader. + * + * @param client the client to set the username for + * @param name the string containing the buffered input + */ + private void onUserNameRead(Client client, String name) { + String[] strings = name.split(NEWLINE, 2); + client.setUserName(strings[0].trim()); + sendRemainingParts(client, strings); + client.setReader(new ClientReader(chatServer, new MessageReader(chatServer))); + client.writeStringMessage("Welcome " + client.getUserName() + "\n"); + } + + /** + * Appends the remaining parts to the clients message buffer + * + * @param client the client + * @param strings the messages to append to the buffer + */ + private void sendRemainingParts(Client client, String[] strings) { + for (int i = 1; i < strings.length; ++i) { + client.appendMessage(strings[i]); + } + } +} diff --git a/runtime/sample/nio/chatserver/README.txt b/runtime/sample/nio/chatserver/README.txt new file mode 100644 index 0000000..ec9b476 --- /dev/null +++ b/runtime/sample/nio/chatserver/README.txt @@ -0,0 +1,62 @@ +A Simple Chat Server Example + +INTRODUCTION +============ +This directory contains a very simple chat server, the server takes input from a +socket ("user") and sends it to all other connected sockets ("users") along with +the provided name the user was asked for when first connecting. + +The server was written to demonstrate the asynchronous I/O API in JDK 7. +The sample assumes the reader has some familiarity with the subject matter. + +SETUP +===== + +The server must be built with version 7 (or later) of the JDK. +The server is built with: + + % mkdir build + % javac -source 7 -target 7 -d build *.java + +EXECUTION +========= + + % java -classpath build ChatServer [-port ] + + Usage: ChatServer [options] + options: + -port port port number + default: 5000 + +CLIENT EXECUTION +================ + +No client binary is included in the sample. +Connections can be made using for example the telnet command or any program +that supports a raw TCP connection to a port. + +SOURCE CODE OVERVIEW +==================== +ChatServer is the main class, it handles the startup and handles incoming +connections on the listening sockets. It keeps a list of connected client +and provides methods for sending a message to them. + +Client represents a connected user, it provides methods for reading/writing +from/to the underlying socket. It also contains a buffer of input read from +the user. + +DataReader provides the interface of the two states a user can +be in. Waiting for a name (and not receiving any messages while doing so, implemented +by NameReader) and waiting for messages from the user (implemented by MessageReader). + +ClientReader contains the "main loop" for a connected client. + +NameReader is the initial state for a new client, it sends the user a string and +waits for a response before changing the state to MessageReader. + +MessageReader is the main state for a client, it checks for new messages to send to +other clients and reads messages from the client. + +FINALLY +======= +This is a sample: it is not production quality and isn't optimized for performance. diff --git a/runtime/sample/nio/file/AclEdit.java b/runtime/sample/nio/file/AclEdit.java new file mode 100644 index 0000000..90af865 --- /dev/null +++ b/runtime/sample/nio/file/AclEdit.java @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; +import java.util.*; +import java.util.regex.Pattern; + +/** + * Sample utility for editing a file's ACL. + */ + +public class AclEdit { + + // parse string as list of ACE permissions separated by / + static Set parsePermissions(String permsString) { + Set perms = new HashSet(); + String[] result = permsString.split("/"); + for (String s : result) { + if (s.equals("")) + continue; + try { + perms.add(AclEntryPermission.valueOf(s.toUpperCase())); + } catch (IllegalArgumentException x) { + System.err.format("Invalid permission '%s'\n", s); + System.exit(-1); + } + } + return perms; + } + + // parse string as list of ACE flags separated by / + static Set parseFlags(String flagsString) { + Set flags = new HashSet(); + String[] result = flagsString.split("/"); + for (String s : result) { + if (s.equals("")) + continue; + try { + flags.add(AclEntryFlag.valueOf(s.toUpperCase())); + } catch (IllegalArgumentException x) { + System.err.format("Invalid flag '%s'\n", s); + System.exit(-1); + } + } + return flags; + } + + // parse ACE type + static AclEntryType parseType(String typeString) { + // FIXME: support audit and alarm types in the future + if (typeString.equalsIgnoreCase("allow")) + return AclEntryType.ALLOW; + if (typeString.equalsIgnoreCase("deny")) + return AclEntryType.DENY; + System.err.format("Invalid type '%s'\n", typeString); + System.exit(-1); + return null; // keep compiler happy + } + + /** + * Parse string of the form: + * [user|group:]:[:flags]: + */ + static AclEntry parseAceString(String s, + UserPrincipalLookupService lookupService) + { + String[] result = s.split(":"); + + // must have at least 3 components (username:perms:type) + if (result.length < 3) + usage(); + + int index = 0; + int remaining = result.length; + + // optional first component can indicate user or group type + boolean isGroup = false; + if (result[index].equalsIgnoreCase("user") || + result[index].equalsIgnoreCase("group")) + { + if (--remaining < 3) + usage(); + isGroup = result[index++].equalsIgnoreCase("group"); + } + + // user and permissions required + String userString = result[index++]; remaining--; + String permsString = result[index++]; remaining--; + + // flags are optional + String flagsString = ""; + String typeString = null; + if (remaining == 1) { + typeString = result[index++]; + } else { + if (remaining == 2) { + flagsString = result[index++]; + typeString = result[index++]; + } else { + usage(); + } + } + + // lookup UserPrincipal + UserPrincipal user = null; + try { + user = (isGroup) ? + lookupService.lookupPrincipalByGroupName(userString) : + lookupService.lookupPrincipalByName(userString); + } catch (UserPrincipalNotFoundException x) { + System.err.format("Invalid %s '%s'\n", + ((isGroup) ? "group" : "user"), + userString); + System.exit(-1); + } catch (IOException x) { + System.err.format("Lookup of '%s' failed: %s\n", userString, x); + System.exit(-1); + } + + // map string representation of permissions, flags, and type + Set perms = parsePermissions(permsString); + Set flags = parseFlags(flagsString); + AclEntryType type = parseType(typeString); + + // build the ACL entry + return AclEntry.newBuilder() + .setType(type) + .setPrincipal(user) + .setPermissions(perms).setFlags(flags).build(); + } + + static void usage() { + System.err.println("usage: java AclEdit [ACL-operation] file"); + System.err.println(""); + System.err.println("Example 1: Prepends access control entry to the begining of the myfile's ACL"); + System.err.println(" java AclEdit A+alice:read_data/read_attributes:allow myfile"); + System.err.println(""); + System.err.println("Example 2: Remove the entry at index 6 of myfile's ACL"); + System.err.println(" java AclEdit A6- myfile"); + System.err.println(""); + System.err.println("Example 3: Replace the entry at index 2 of myfile's ACL"); + System.err.println(" java AclEdit A2=bob:write_data/append_data:deny myfile"); + System.exit(-1); + } + + static enum Action { + PRINT, + ADD, + REMOVE, + REPLACE; + } + + /** + * Main class: parses arguments and prints or edits ACL + */ + public static void main(String[] args) throws IOException { + Action action = null; + int index = -1; + String entryString = null; + + // parse arguments + if (args.length < 1 || args[0].equals("-help") || args[0].equals("-?")) + usage(); + + if (args.length == 1) { + action = Action.PRINT; + } else { + String s = args[0]; + + // A[index]+entry + if (Pattern.matches("^A[0-9]*\\+.*", s)) { + String[] result = s.split("\\+", 2); + if (result.length == 2) { + if (result[0].length() < 2) { + index = 0; + } else { + index = Integer.parseInt(result[0].substring(1)); + } + entryString = result[1]; + action = Action.ADD; + } + } + + // Aindex- + if (Pattern.matches("^A[0-9]+\\-", s)) { + String[] result = s.split("\\-", 2); + if (result.length == 2) { + index = Integer.parseInt(result[0].substring(1)); + entryString = result[1]; + action = Action.REMOVE; + } + } + + // Aindex=entry + if (Pattern.matches("^A[0-9]+=.*", s)) { + String[] result = s.split("=", 2); + if (result.length == 2) { + index = Integer.parseInt(result[0].substring(1)); + entryString = result[1]; + action = Action.REPLACE; + } + } + } + if (action == null) + usage(); + + int fileArg = (action == Action.PRINT) ? 0 : 1; + Path file = Paths.get(args[fileArg]); + + // read file's ACL + AclFileAttributeView view = + Files.getFileAttributeView(file, AclFileAttributeView.class); + if (view == null) { + System.err.println("ACLs not supported on this platform"); + System.exit(-1); + } + List acl = view.getAcl(); + + switch (action) { + // print ACL + case PRINT : { + for (int i=0; i= acl.size()) { + acl.add(entry); + } else { + acl.add(index, entry); + } + view.setAcl(acl); + break; + } + + // remove ACE + case REMOVE: { + if (index >= acl.size()) { + System.err.format("Index '%d' is invalid", index); + System.exit(-1); + } + acl.remove(index); + view.setAcl(acl); + break; + } + + // replace ACE + case REPLACE: { + if (index >= acl.size()) { + System.err.format("Index '%d' is invalid", index); + System.exit(-1); + } + AclEntry entry = parseAceString(entryString, file + .getFileSystem().getUserPrincipalLookupService()); + acl.set(index, entry); + view.setAcl(acl); + break; + } + } + } +} diff --git a/runtime/sample/nio/file/Chmod.java b/runtime/sample/nio/file/Chmod.java new file mode 100644 index 0000000..05c16b9 --- /dev/null +++ b/runtime/sample/nio/file/Chmod.java @@ -0,0 +1,349 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import java.nio.file.attribute.*; +import static java.nio.file.attribute.PosixFilePermission.*; +import static java.nio.file.FileVisitResult.*; +import java.io.IOException; +import java.util.*; + +/** + * Sample code that changes the permissions of files in a similar manner to the + * chmod(1) program. + */ + +public class Chmod { + + /** + * Compiles a list of one or more symbolic mode expressions that + * may be used to change a set of file permissions. This method is + * intended for use where file permissions are required to be changed in + * a manner similar to the UNIX chmod program. + * + *

      The {@code exprs} parameter is a comma separated list of expressions + * where each takes the form: + *

      + * who operator [permissions] + *
      + * where who is one or more of the characters {@code 'u'}, {@code 'g'}, + * {@code 'o'}, or {@code 'a'} meaning the owner (user), group, others, or + * all (owner, group, and others) respectively. + * + *

      operator is the character {@code '+'}, {@code '-'}, or {@code + * '='} signifying how permissions are to be changed. {@code '+'} means the + * permissions are added, {@code '-'} means the permissions are removed, and + * {@code '='} means the permissions are assigned absolutely. + * + *

      permissions is a sequence of zero or more of the following: + * {@code 'r'} for read permission, {@code 'w'} for write permission, and + * {@code 'x'} for execute permission. If permissions is omitted + * when assigned absolutely, then the permissions are cleared for + * the owner, group, or others as identified by who. When omitted + * when adding or removing then the expression is ignored. + * + *

      The following examples demonstrate possible values for the {@code + * exprs} parameter: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
      {@code u=rw} Sets the owner permissions to be read and write.
      {@code ug+w} Sets the owner write and group write permissions.
      {@code u+w,o-rwx} Sets the owner write, and removes the others read, others write + * and others execute permissions.
      {@code o=} Sets the others permission to none (others read, others write and + * others execute permissions are removed if set)
      + * + * @param exprs + * List of one or more symbolic mode expressions + * + * @return A {@code Changer} that may be used to changer a set of + * file permissions + * + * @throws IllegalArgumentException + * If the value of the {@code exprs} parameter is invalid + */ + public static Changer compile(String exprs) { + // minimum is who and operator (u= for example) + if (exprs.length() < 2) + throw new IllegalArgumentException("Invalid mode"); + + // permissions that the changer will add or remove + final Set toAdd = new HashSet(); + final Set toRemove = new HashSet(); + + // iterate over each of expression modes + for (String expr: exprs.split(",")) { + // minimum of who and operator + if (expr.length() < 2) + throw new IllegalArgumentException("Invalid mode"); + + int pos = 0; + + // who + boolean u = false; + boolean g = false; + boolean o = false; + boolean done = false; + for (;;) { + switch (expr.charAt(pos)) { + case 'u' : u = true; break; + case 'g' : g = true; break; + case 'o' : o = true; break; + case 'a' : u = true; g = true; o = true; break; + default : done = true; + } + if (done) + break; + pos++; + } + if (!u && !g && !o) + throw new IllegalArgumentException("Invalid mode"); + + // get operator and permissions + char op = expr.charAt(pos++); + String mask = (expr.length() == pos) ? "" : expr.substring(pos); + + // operator + boolean add = (op == '+'); + boolean remove = (op == '-'); + boolean assign = (op == '='); + if (!add && !remove && !assign) + throw new IllegalArgumentException("Invalid mode"); + + // who= means remove all + if (assign && mask.length() == 0) { + assign = false; + remove = true; + mask = "rwx"; + } + + // permissions + boolean r = false; + boolean w = false; + boolean x = false; + for (int i=0; i change(Set perms) { + perms.addAll(toAdd); + perms.removeAll(toRemove); + return perms; + } + }; + } + + /** + * A task that changes a set of {@link PosixFilePermission} elements. + */ + public interface Changer { + /** + * Applies the changes to the given set of permissions. + * + * @param perms + * The set of permissions to change + * + * @return The {@code perms} parameter + */ + Set change(Set perms); + } + + /** + * Changes the permissions of the file using the given Changer. + */ + static void chmod(Path file, Changer changer) { + try { + Set perms = Files.getPosixFilePermissions(file); + Files.setPosixFilePermissions(file, changer.change(perms)); + } catch (IOException x) { + System.err.println(x); + } + } + + /** + * Changes the permission of each file and directory visited + */ + static class TreeVisitor implements FileVisitor { + private final Changer changer; + + TreeVisitor(Changer changer) { + this.changer = changer; + } + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { + chmod(dir, changer); + return CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + chmod(file, changer); + return CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) { + if (exc != null) + System.err.println("WARNING: " + exc); + return CONTINUE; + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) { + System.err.println("WARNING: " + exc); + return CONTINUE; + } + } + + static void usage() { + System.err.println("java Chmod [-R] symbolic-mode-list file..."); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + if (args.length < 2) + usage(); + int argi = 0; + int maxDepth = 0; + if (args[argi].equals("-R")) { + if (args.length < 3) + usage(); + argi++; + maxDepth = Integer.MAX_VALUE; + } + + // compile the symbolic mode expressions + Changer changer = compile(args[argi++]); + TreeVisitor visitor = new TreeVisitor(changer); + + Set opts = Collections.emptySet(); + while (argi < args.length) { + Path file = Paths.get(args[argi]); + Files.walkFileTree(file, opts, maxDepth, visitor); + argi++; + } + } +} diff --git a/runtime/sample/nio/file/Copy.java b/runtime/sample/nio/file/Copy.java new file mode 100644 index 0000000..0d61ef3 --- /dev/null +++ b/runtime/sample/nio/file/Copy.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import static java.nio.file.StandardCopyOption.*; +import java.nio.file.attribute.*; +import static java.nio.file.FileVisitResult.*; +import java.io.IOException; +import java.util.*; + +/** + * Sample code that copies files in a similar manner to the cp(1) program. + */ + +public class Copy { + + /** + * Returns {@code true} if okay to overwrite a file ("cp -i") + */ + static boolean okayToOverwrite(Path file) { + String answer = System.console().readLine("overwrite %s (yes/no)? ", file); + return (answer.equalsIgnoreCase("y") || answer.equalsIgnoreCase("yes")); + } + + /** + * Copy source file to target location. If {@code prompt} is true then + * prompt user to overwrite target if it exists. The {@code preserve} + * parameter determines if file attributes should be copied/preserved. + */ + static void copyFile(Path source, Path target, boolean prompt, boolean preserve) { + CopyOption[] options = (preserve) ? + new CopyOption[] { COPY_ATTRIBUTES, REPLACE_EXISTING } : + new CopyOption[] { REPLACE_EXISTING }; + if (!prompt || Files.notExists(target) || okayToOverwrite(target)) { + try { + Files.copy(source, target, options); + } catch (IOException x) { + System.err.format("Unable to copy: %s: %s%n", source, x); + } + } + } + + /** + * A {@code FileVisitor} that copies a file-tree ("cp -r") + */ + static class TreeCopier implements FileVisitor { + private final Path source; + private final Path target; + private final boolean prompt; + private final boolean preserve; + + TreeCopier(Path source, Path target, boolean prompt, boolean preserve) { + this.source = source; + this.target = target; + this.prompt = prompt; + this.preserve = preserve; + } + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { + // before visiting entries in a directory we copy the directory + // (okay if directory already exists). + CopyOption[] options = (preserve) ? + new CopyOption[] { COPY_ATTRIBUTES } : new CopyOption[0]; + + Path newdir = target.resolve(source.relativize(dir)); + try { + Files.copy(dir, newdir, options); + } catch (FileAlreadyExistsException x) { + // ignore + } catch (IOException x) { + System.err.format("Unable to create: %s: %s%n", newdir, x); + return SKIP_SUBTREE; + } + return CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + copyFile(file, target.resolve(source.relativize(file)), + prompt, preserve); + return CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) { + // fix up modification time of directory when done + if (exc == null && preserve) { + Path newdir = target.resolve(source.relativize(dir)); + try { + FileTime time = Files.getLastModifiedTime(dir); + Files.setLastModifiedTime(newdir, time); + } catch (IOException x) { + System.err.format("Unable to copy all attributes to: %s: %s%n", newdir, x); + } + } + return CONTINUE; + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) { + if (exc instanceof FileSystemLoopException) { + System.err.println("cycle detected: " + file); + } else { + System.err.format("Unable to copy: %s: %s%n", file, exc); + } + return CONTINUE; + } + } + + static void usage() { + System.err.println("java Copy [-ip] source... target"); + System.err.println("java Copy -r [-ip] source-dir... target"); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + boolean recursive = false; + boolean prompt = false; + boolean preserve = false; + + // process options + int argi = 0; + while (argi < args.length) { + String arg = args[argi]; + if (!arg.startsWith("-")) + break; + if (arg.length() < 2) + usage(); + for (int i=1; i 1) { + source[i++] = Paths.get(args[argi++]); + remaining--; + } + Path target = Paths.get(args[argi]); + + // check if target is a directory + boolean isDir = Files.isDirectory(target); + + // copy each source file/directory to target + for (i=0; i opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS); + TreeCopier tc = new TreeCopier(source[i], dest, prompt, preserve); + Files.walkFileTree(source[i], opts, Integer.MAX_VALUE, tc); + } else { + // not recursive so source must not be a directory + if (Files.isDirectory(source[i])) { + System.err.format("%s: is a directory%n", source[i]); + continue; + } + copyFile(source[i], dest, prompt, preserve); + } + } + } +} diff --git a/runtime/sample/nio/file/DiskUsage.java b/runtime/sample/nio/file/DiskUsage.java new file mode 100644 index 0000000..7d30bdf --- /dev/null +++ b/runtime/sample/nio/file/DiskUsage.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; + +/** + * Example utility that works like the df(1M) program to print out disk space + * information + */ + +public class DiskUsage { + + static final long K = 1024; + + static void printFileStore(FileStore store) throws IOException { + long total = store.getTotalSpace() / K; + long used = (store.getTotalSpace() - store.getUnallocatedSpace()) / K; + long avail = store.getUsableSpace() / K; + + String s = store.toString(); + if (s.length() > 20) { + System.out.println(s); + s = ""; + } + System.out.format("%-20s %12d %12d %12d\n", s, total, used, avail); + } + + public static void main(String[] args) throws IOException { + System.out.format("%-20s %12s %12s %12s\n", "Filesystem", "kbytes", "used", "avail"); + if (args.length == 0) { + FileSystem fs = FileSystems.getDefault(); + for (FileStore store: fs.getFileStores()) { + printFileStore(store); + } + } else { + for (String file: args) { + FileStore store = Files.getFileStore(Paths.get(file)); + printFileStore(store); + } + } + } +} diff --git a/runtime/sample/nio/file/FileType.java b/runtime/sample/nio/file/FileType.java new file mode 100644 index 0000000..d001d60 --- /dev/null +++ b/runtime/sample/nio/file/FileType.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import java.io.IOException; + +public class FileType { + public static void main(String[] args) throws IOException { + if (args.length == 0) { + System.err.println("usage: java FileType file..."); + System.exit(-1); + } + for (String arg: args) { + Path file = Paths.get(arg); + String type; + if (Files.isDirectory(file)) { + type = "directory"; + } else { + type = Files.probeContentType(file); + if (type == null) + type = ""; + } + System.out.format("%s\t%s%n", file, type); + } + } +} diff --git a/runtime/sample/nio/file/WatchDir.java b/runtime/sample/nio/file/WatchDir.java new file mode 100644 index 0000000..4c73820 --- /dev/null +++ b/runtime/sample/nio/file/WatchDir.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.file.*; +import static java.nio.file.StandardWatchEventKinds.*; +import static java.nio.file.LinkOption.*; +import java.nio.file.attribute.*; +import java.io.IOException; + +/** + * Example to watch a directory (or tree) for changes to files. + */ + +public class WatchDir { + + private final WatchService watcher; + private final boolean recursive; + private boolean trace = false; + private int count; + + @SuppressWarnings("unchecked") + static WatchEvent cast(WatchEvent event) { + return (WatchEvent)event; + } + + /** + * Register the given directory with the WatchService + */ + private void register(Path dir) throws IOException { + WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); + count++; + if (trace) + System.out.format("register: %s\n", dir); + } + + /** + * Register the given directory, and all its sub-directories, with the + * WatchService. + */ + private void registerAll(final Path start) throws IOException { + // register directory and sub-directories + Files.walkFileTree(start, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException + { + register(dir); + return FileVisitResult.CONTINUE; + } + }); + } + + /** + * Creates a WatchService and registers the given directory + */ + WatchDir(Path dir, boolean recursive) throws IOException { + this.watcher = FileSystems.getDefault().newWatchService(); + this.recursive = recursive; + + if (recursive) { + System.out.format("Scanning %s ...\n", dir); + registerAll(dir); + System.out.println("Done."); + } else { + register(dir); + } + + // enable trace after initial registration + this.trace = true; + } + + /** + * Process all events for keys queued to the watcher + */ + void processEvents() { + for (;;) { + + // wait for key to be signalled + WatchKey key; + try { + key = watcher.take(); + } catch (InterruptedException x) { + return; + } + + for (WatchEvent event: key.pollEvents()) { + WatchEvent.Kind kind = event.kind(); + + // TBD - provide example of how OVERFLOW event is handled + if (kind == OVERFLOW) { + continue; + } + + // Context for directory entry event is the file name of entry + WatchEvent ev = cast(event); + Path name = ev.context(); + Path child = ((Path)key.watchable()).resolve(name); + + // print out event + System.out.format("%s: %s\n", event.kind().name(), child); + + // if directory is created, and watching recursively, then + // register it and its sub-directories + if (recursive && (kind == ENTRY_CREATE)) { + try { + if (Files.isDirectory(child, NOFOLLOW_LINKS)) { + registerAll(child); + } + } catch (IOException x) { + // ignore to keep sample readbale + } + } + } + + // reset key + boolean valid = key.reset(); + if (!valid) { + // directory no longer accessible + count--; + if (count == 0) + break; + } + } + } + + static void usage() { + System.err.println("usage: java WatchDir [-r] dir"); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + // parse arguments + if (args.length == 0 || args.length > 2) + usage(); + boolean recursive = false; + int dirArg = 0; + if (args[0].equals("-r")) { + if (args.length < 2) + usage(); + recursive = true; + dirArg++; + } + + // register directory and process its events + Path dir = Paths.get(args[dirArg]); + new WatchDir(dir, recursive).processEvents(); + } +} diff --git a/runtime/sample/nio/file/Xdd.java b/runtime/sample/nio/file/Xdd.java new file mode 100644 index 0000000..c0c7f87 --- /dev/null +++ b/runtime/sample/nio/file/Xdd.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; + +/** + * Example code to list/set/get/delete the user-defined attributes of a file. + */ + +public class Xdd { + + static void usage() { + System.out.println("Usage: java Xdd "); + System.out.println(" java Xdd -set = "); + System.out.println(" java Xdd -get "); + System.out.println(" java Xdd -del "); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + // one or three parameters + if (args.length != 1 && args.length != 3) + usage(); + + Path file = (args.length == 1) ? + Paths.get(args[0]) : Paths.get(args[2]); + + // check that user defined attributes are supported by the file store + FileStore store = Files.getFileStore(file); + if (!store.supportsFileAttributeView(UserDefinedFileAttributeView.class)) { + System.err.format("UserDefinedFileAttributeView not supported on %s\n", store); + System.exit(-1); + + } + UserDefinedFileAttributeView view = + Files.getFileAttributeView(file, UserDefinedFileAttributeView.class); + + // list user defined attributes + if (args.length == 1) { + System.out.println(" Size Name"); + System.out.println("-------- --------------------------------------"); + for (String name: view.list()) { + System.out.format("%8d %s\n", view.size(name), name); + } + return; + } + + // Add/replace a file's user defined attribute + if (args[0].equals("-set")) { + // name=value + String[] s = args[1].split("="); + if (s.length != 2) + usage(); + String name = s[0]; + String value = s[1]; + view.write(name, Charset.defaultCharset().encode(value)); + return; + } + + // Print out the value of a file's user defined attribute + if (args[0].equals("-get")) { + String name = args[1]; + int size = view.size(name); + ByteBuffer buf = ByteBuffer.allocateDirect(size); + view.read(name, buf); + buf.flip(); + System.out.println(Charset.defaultCharset().decode(buf).toString()); + return; + } + + // Delete a file's user defined attribute + if (args[0].equals("-del")) { + view.delete(args[1]); + return; + } + + // option not recognized + usage(); + } + } diff --git a/runtime/sample/nio/multicast/MulticastAddress.java b/runtime/sample/nio/multicast/MulticastAddress.java new file mode 100644 index 0000000..05f5ca5 --- /dev/null +++ b/runtime/sample/nio/multicast/MulticastAddress.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.UnknownHostException; +import java.net.SocketException; + +/** + * Parses and represents a multicast address. + */ + +class MulticastAddress { + private final InetAddress group; + private final int port; + private final NetworkInterface interf; + + private MulticastAddress(InetAddress group, int port, NetworkInterface interf) { + this.group = group; + this.port = port; + this.interf = interf; + } + + InetAddress group() { + return group; + } + + int port() { + return port; + } + + /** + * @return The network interface, may be {@code null} + */ + NetworkInterface interf() { + return interf; + } + + /** + * Parses a string of the form "group:port[@interface]", returning + * a MulticastAddress representing the address + */ + static MulticastAddress parse(String s) { + String[] components = s.split("@"); + if (components.length > 2) + throw new IllegalArgumentException("At most one '@' expected"); + + // get group and port + String target = components[0]; + int len = components[0].length(); + int colon = components[0].lastIndexOf(':'); + if ((colon < 1) || (colon > (len-2))) + throw new IllegalArgumentException("group:port expected"); + String groupString = target.substring(0, colon); + int port = -1; + try { + port = Integer.parseInt(target.substring(colon+1, len)); + } catch (NumberFormatException x) { + throw new IllegalArgumentException(x); + } + + // handle IPv6 literal address + if (groupString.charAt(0) == '[') { + len = groupString.length(); + if (groupString.charAt(len-1) != ']') + throw new IllegalArgumentException("missing ']'"); + groupString = groupString.substring(1,len-1); + if (groupString.length() == 0) + throw new IllegalArgumentException("missing IPv6 address"); + } + + // get group address + InetAddress group = null; + try { + group = InetAddress.getByName(groupString); + } catch (UnknownHostException x) { + throw new IllegalArgumentException(x); + } + if (!group.isMulticastAddress()) { + throw new IllegalArgumentException("'" + group.getHostAddress() + + "' is not multicast address"); + } + + // optional interface + NetworkInterface interf = null; + if (components.length == 2) { + try { + interf = NetworkInterface.getByName(components[1]); + } catch (SocketException x) { + throw new IllegalArgumentException(x); + } + if (interf == null) { + throw new IllegalArgumentException("'" + components[1] + + "' is not valid interface"); + } + } + return new MulticastAddress(group, port, interf); + } +} diff --git a/runtime/sample/nio/multicast/Reader.java b/runtime/sample/nio/multicast/Reader.java new file mode 100644 index 0000000..303c356 --- /dev/null +++ b/runtime/sample/nio/multicast/Reader.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.channels.*; +import java.nio.charset.*; +import java.nio.ByteBuffer; +import java.net.*; +import java.io.IOException; +import java.util.*; + +public class Reader { + + static void usage() { + System.err.println("usage: java Reader group:port@interf [-only source...] [-block source...]"); + System.exit(-1); + } + + static void printDatagram(SocketAddress sa, ByteBuffer buf) { + System.out.format("-- datagram from %s --\n", + ((InetSocketAddress)sa).getAddress().getHostAddress()); + System.out.println(Charset.defaultCharset().decode(buf)); + } + + static void parseAddessList(String s, List list) + throws UnknownHostException + { + String[] sources = s.split(","); + for (int i=0; i includeList = new ArrayList(); + List excludeList = new ArrayList(); + int argc = 1; + while (argc < args.length) { + String option = args[argc++]; + if (argc >= args.length) + usage(); + String value = args[argc++]; + if (option.equals("-only")) { + parseAddessList(value, includeList); + continue; + } + if (option.equals("-block")) { + parseAddessList(value, excludeList); + continue; + } + usage(); + } + if (!includeList.isEmpty() && !excludeList.isEmpty()) { + usage(); + } + + // create and bind socket + ProtocolFamily family = StandardProtocolFamily.INET; + if (target.group() instanceof Inet6Address) { + family = StandardProtocolFamily.INET6; + } + DatagramChannel dc = DatagramChannel.open(family) + .setOption(StandardSocketOptions.SO_REUSEADDR, true) + .bind(new InetSocketAddress(target.port())); + + if (includeList.isEmpty()) { + // join group and block addresses on the exclude list + MembershipKey key = dc.join(target.group(), target.interf()); + for (InetAddress source: excludeList) { + key.block(source); + } + } else { + // join with source-specific membership for each source + for (InetAddress source: includeList) { + dc.join(target.group(), target.interf(), source); + } + } + + // register socket with Selector + Selector sel = Selector.open(); + dc.configureBlocking(false); + dc.register(sel, SelectionKey.OP_READ); + + // print out each datagram that we receive + ByteBuffer buf = ByteBuffer.allocateDirect(4096); + for (;;) { + int updated = sel.select(); + if (updated > 0) { + Iterator iter = sel.selectedKeys().iterator(); + while (iter.hasNext()) { + SelectionKey sk = iter.next(); + iter.remove(); + + DatagramChannel ch = (DatagramChannel)sk.channel(); + SocketAddress sa = ch.receive(buf); + if (sa != null) { + buf.flip(); + printDatagram(sa, buf); + buf.rewind(); + buf.limit(buf.capacity()); + } + } + } + } + } +} diff --git a/runtime/sample/nio/multicast/Sender.java b/runtime/sample/nio/multicast/Sender.java new file mode 100644 index 0000000..f8685f6 --- /dev/null +++ b/runtime/sample/nio/multicast/Sender.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.channels.*; +import java.nio.charset.Charset; +import java.net.*; +import java.io.IOException; +import java.util.*; + +/** + * Sample multicast sender to send a message in a multicast datagram + * to a given group. + */ + +public class Sender { + + private static void usage() { + System.err.println("usage: java Sender group:port[@interface] message"); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + if (args.length < 2) + usage(); + + MulticastAddress target = MulticastAddress.parse(args[0]); + + // create socket + ProtocolFamily family = StandardProtocolFamily.INET; + if (target.group() instanceof Inet6Address) + family = StandardProtocolFamily.INET6; + DatagramChannel dc = DatagramChannel.open(family).bind(new InetSocketAddress(0)); + if (target.interf() != null) { + dc.setOption(StandardSocketOptions.IP_MULTICAST_IF, target.interf()); + } + + // send multicast packet + dc.send(Charset.defaultCharset().encode(args[1]), + new InetSocketAddress(target.group(), target.port())); + dc.close(); + } + +} diff --git a/runtime/sample/nio/server/AcceptHandler.java b/runtime/sample/nio/server/AcceptHandler.java new file mode 100644 index 0000000..41c2570 --- /dev/null +++ b/runtime/sample/nio/server/AcceptHandler.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; +import javax.net.ssl.*; + +/** + * A single threaded Handler that performs accepts SocketChannels and + * registers the Channels with the read/write Selector. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class AcceptHandler implements Handler { + + private ServerSocketChannel channel; + private Dispatcher dsp; + + private SSLContext sslContext; + + AcceptHandler(ServerSocketChannel ssc, Dispatcher dsp, + SSLContext sslContext) { + channel = ssc; + this.dsp = dsp; + this.sslContext = sslContext; + } + + public void handle(SelectionKey sk) throws IOException { + + if (!sk.isAcceptable()) + return; + + SocketChannel sc = channel.accept(); + if (sc == null) { + return; + } + + ChannelIO cio = (sslContext != null ? + ChannelIOSecure.getInstance( + sc, false /* non-blocking */, sslContext) : + ChannelIO.getInstance( + sc, false /* non-blocking */)); + + RequestHandler rh = new RequestHandler(cio); + dsp.register(cio.getSocketChannel(), SelectionKey.OP_READ, rh); + } +} diff --git a/runtime/sample/nio/server/Acceptor.java b/runtime/sample/nio/server/Acceptor.java new file mode 100644 index 0000000..cfdaf0e --- /dev/null +++ b/runtime/sample/nio/server/Acceptor.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; +import javax.net.ssl.*; + +/** + * A Runnable class which sits in a loop accepting SocketChannels, + * then registers the Channels with the read/write Selector. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class Acceptor implements Runnable { + + private ServerSocketChannel ssc; + private Dispatcher d; + + private SSLContext sslContext; + + Acceptor(ServerSocketChannel ssc, Dispatcher d, SSLContext sslContext) { + this.ssc = ssc; + this.d = d; + this.sslContext = sslContext; + } + + public void run() { + for (;;) { + try { + SocketChannel sc = ssc.accept(); + + ChannelIO cio = (sslContext != null ? + ChannelIOSecure.getInstance( + sc, false /* non-blocking */, sslContext) : + ChannelIO.getInstance( + sc, false /* non-blocking */)); + + RequestHandler rh = new RequestHandler(cio); + + d.register(cio.getSocketChannel(), SelectionKey.OP_READ, rh); + + } catch (IOException x) { + x.printStackTrace(); + break; + } + } + } +} diff --git a/runtime/sample/nio/server/B1.java b/runtime/sample/nio/server/B1.java new file mode 100644 index 0000000..c6d7e90 --- /dev/null +++ b/runtime/sample/nio/server/B1.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.channels.*; + +/** + * A blocking/single-threaded server which completely services + * each connection before moving to the next. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public class B1 extends Server { + + B1(int port, int backlog, boolean secure) throws Exception { + super(port, backlog, secure); + } + + void runServer() throws Exception { + for (;;) { + + SocketChannel sc = ssc.accept(); + + ChannelIO cio = (sslContext != null ? + ChannelIOSecure.getInstance( + sc, true /* blocking */, sslContext) : + ChannelIO.getInstance( + sc, true /* blocking */)); + + RequestServicer svc = new RequestServicer(cio); + svc.run(); + } + } +} diff --git a/runtime/sample/nio/server/BN.java b/runtime/sample/nio/server/BN.java new file mode 100644 index 0000000..c765a8b --- /dev/null +++ b/runtime/sample/nio/server/BN.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; + +/** + * A Blocking/Multi-threaded Server which creates a new thread for each + * connection. This is not efficient for large numbers of connections. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public class BN extends Server { + + BN(int port, int backlog, boolean secure) throws Exception { + super(port, backlog, secure); + } + + void runServer() throws IOException { + for (;;) { + + SocketChannel sc = ssc.accept(); + + ChannelIO cio = (sslContext != null ? + ChannelIOSecure.getInstance( + sc, true /* blocking */, sslContext) : + ChannelIO.getInstance( + sc, true /* blocking */)); + + RequestServicer svc = new RequestServicer(cio); + Thread th = new Thread(svc); + th.start(); + } + } +} diff --git a/runtime/sample/nio/server/BP.java b/runtime/sample/nio/server/BP.java new file mode 100644 index 0000000..9540f1c --- /dev/null +++ b/runtime/sample/nio/server/BP.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.channels.*; +import java.util.concurrent.*; + +/** + * A multi-threaded server which creates a pool of threads for use + * by the server. The Thread pool decides how to schedule those threads. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public class BP extends Server { + + private static final int POOL_MULTIPLE = 4; + + BP(int port, int backlog, boolean secure) throws Exception { + super(port, backlog, secure); + } + + void runServer() throws Exception { + + ExecutorService xec = Executors.newFixedThreadPool( + Runtime.getRuntime().availableProcessors() * POOL_MULTIPLE); + + for (;;) { + + SocketChannel sc = ssc.accept(); + + ChannelIO cio = (sslContext != null ? + ChannelIOSecure.getInstance( + sc, true /* blocking */, sslContext) : + ChannelIO.getInstance( + sc, true /* blocking */)); + + RequestServicer svc = new RequestServicer(cio); + xec.execute(svc); + } + } +} diff --git a/runtime/sample/nio/server/ChannelIO.java b/runtime/sample/nio/server/ChannelIO.java new file mode 100644 index 0000000..7d1ca18 --- /dev/null +++ b/runtime/sample/nio/server/ChannelIO.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; +import java.nio.channels.*; + +/** + * A helper class for properly sizing inbound byte buffers and + * redirecting I/O calls to the proper SocketChannel call. + *

      + * Many of these calls may seem unnecessary until you consider + * that they are placeholders for the secure variant, which is much + * more involved. See ChannelIOSecure for more information. + * + * @author Brad R. Wetmore + * @author Mark Reinhold + */ +class ChannelIO { + + protected SocketChannel sc; + + /* + * All of the inbound request data lives here until we determine + * that we've read everything, then we pass that data back to the + * caller. + */ + protected ByteBuffer requestBB; + static private int requestBBSize = 4096; + + protected ChannelIO(SocketChannel sc, boolean blocking) + throws IOException { + this.sc = sc; + sc.configureBlocking(blocking); + } + + static ChannelIO getInstance(SocketChannel sc, boolean blocking) + throws IOException { + ChannelIO cio = new ChannelIO(sc, blocking); + cio.requestBB = ByteBuffer.allocate(requestBBSize); + + return cio; + } + + SocketChannel getSocketChannel() { + return sc; + } + + /* + * Return a ByteBuffer with "remaining" space to work. If you have to + * reallocate the ByteBuffer, copy the existing info into the new buffer. + */ + protected void resizeRequestBB(int remaining) { + if (requestBB.remaining() < remaining) { + // Expand buffer for large request + ByteBuffer bb = ByteBuffer.allocate(requestBB.capacity() * 2); + requestBB.flip(); + bb.put(requestBB); + requestBB = bb; + } + } + + /* + * Perform any handshaking processing. + *

      + * This variant is for Servers without SelectionKeys (e.g. + * blocking). + *

      + * return true when we're done with handshaking. + */ + boolean doHandshake() throws IOException { + return true; + } + + /* + * Perform any handshaking processing. + *

      + * This variant is for Servers with SelectionKeys, so that + * we can register for selectable operations (e.g. selectable + * non-blocking). + *

      + * return true when we're done with handshaking. + */ + boolean doHandshake(SelectionKey sk) throws IOException { + return true; + } + + /* + * Resize (if necessary) the inbound data buffer, and then read more + * data into the read buffer. + */ + int read() throws IOException { + /* + * Allocate more space if less than 5% remains + */ + resizeRequestBB(requestBBSize/20); + return sc.read(requestBB); + } + + /* + * All data has been read, pass back the request in one buffer. + */ + ByteBuffer getReadBuf() { + return requestBB; + } + + /* + * Write the src buffer into the socket channel. + */ + int write(ByteBuffer src) throws IOException { + return sc.write(src); + } + + /* + * Perform a FileChannel.TransferTo on the socket channel. + */ + long transferTo(FileChannel fc, long pos, long len) throws IOException { + return fc.transferTo(pos, len, sc); + } + + /* + * Flush any outstanding data to the network if possible. + *

      + * This isn't really necessary for the insecure variant, but needed + * for the secure one where intermediate buffering must take place. + *

      + * Return true if successful. + */ + boolean dataFlush() throws IOException { + return true; + } + + /* + * Start any connection shutdown processing. + *

      + * This isn't really necessary for the insecure variant, but needed + * for the secure one where intermediate buffering must take place. + *

      + * Return true if successful, and the data has been flushed. + */ + boolean shutdown() throws IOException { + return true; + } + + /* + * Close the underlying connection. + */ + void close() throws IOException { + sc.close(); + } + +} diff --git a/runtime/sample/nio/server/ChannelIOSecure.java b/runtime/sample/nio/server/ChannelIOSecure.java new file mode 100644 index 0000000..7508966 --- /dev/null +++ b/runtime/sample/nio/server/ChannelIOSecure.java @@ -0,0 +1,650 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; +import java.nio.channels.*; +import javax.net.ssl.*; +import javax.net.ssl.SSLEngineResult.*; + +/** + * A helper class which performs I/O using the SSLEngine API. + *

      + * Each connection has a SocketChannel and a SSLEngine that is + * used through the lifetime of the Channel. We allocate byte buffers + * for use as the outbound and inbound network buffers. + * + *

      + *               Application Data
      + *               src      requestBB
      + *                |           ^
      + *                |     |     |
      + *                v     |     |
      + *           +----+-----|-----+----+
      + *           |          |          |
      + *           |       SSL|Engine    |
      + *   wrap()  |          |          |  unwrap()
      + *           | OUTBOUND | INBOUND  |
      + *           |          |          |
      + *           +----+-----|-----+----+
      + *                |     |     ^
      + *                |     |     |
      + *                v           |
      + *            outNetBB     inNetBB
      + *                   Net data
      + * 
      + * + * These buffers handle all of the intermediary data for the SSL + * connection. To make things easy, we'll require outNetBB be + * completely flushed before trying to wrap any more data, but we + * could certainly remove that restriction by using larger buffers. + *

      + * There are many, many ways to handle compute and I/O strategies. + * What follows is a relatively simple one. The reader is encouraged + * to develop the strategy that best fits the application. + *

      + * In most of the non-blocking operations in this class, we let the + * Selector tell us when we're ready to attempt an I/O operation (by the + * application repeatedly calling our methods). Another option would be + * to attempt the operation and return from the method when no forward + * progress can be made. + *

      + * There's lots of room for enhancements and improvement in this example. + *

      + * We're checking for SSL/TLS end-of-stream truncation attacks via + * sslEngine.closeInbound(). When you reach the end of a input stream + * via a read() returning -1 or an IOException, we call + * sslEngine.closeInbound() to signal to the sslEngine that no more + * input will be available. If the peer's close_notify message has not + * yet been received, this could indicate a trucation attack, in which + * an attacker is trying to prematurely close the connection. The + * closeInbound() will throw an exception if this condition were + * present. + * + * @author Brad R. Wetmore + * @author Mark Reinhold + */ +class ChannelIOSecure extends ChannelIO { + + private SSLEngine sslEngine = null; + + private int appBBSize; + private int netBBSize; + + /* + * All I/O goes through these buffers. + *

      + * It might be nice to use a cache of ByteBuffers so we're + * not alloc/dealloc'ing ByteBuffer's for each new SSLEngine. + *

      + * We use our superclass' requestBB for our application input buffer. + * Outbound application data is supplied to us by our callers. + */ + private ByteBuffer inNetBB; + private ByteBuffer outNetBB; + + /* + * An empty ByteBuffer for use when one isn't available, say + * as a source buffer during initial handshake wraps or for close + * operations. + */ + private static ByteBuffer hsBB = ByteBuffer.allocate(0); + + /* + * The FileChannel we're currently transferTo'ing (reading). + */ + private ByteBuffer fileChannelBB = null; + + /* + * During our initial handshake, keep track of the next + * SSLEngine operation that needs to occur: + * + * NEED_WRAP/NEED_UNWRAP + * + * Once the initial handshake has completed, we can short circuit + * handshake checks with initialHSComplete. + */ + private HandshakeStatus initialHSStatus; + private boolean initialHSComplete; + + /* + * We have received the shutdown request by our caller, and have + * closed our outbound side. + */ + private boolean shutdown = false; + + /* + * Constructor for a secure ChannelIO variant. + */ + protected ChannelIOSecure(SocketChannel sc, boolean blocking, + SSLContext sslc) throws IOException { + super(sc, blocking); + + /* + * We're a server, so no need to use host/port variant. + * + * The first call for a server is a NEED_UNWRAP. + */ + sslEngine = sslc.createSSLEngine(); + sslEngine.setUseClientMode(false); + initialHSStatus = HandshakeStatus.NEED_UNWRAP; + initialHSComplete = false; + + // Create a buffer using the normal expected packet size we'll + // be getting. This may change, depending on the peer's + // SSL implementation. + netBBSize = sslEngine.getSession().getPacketBufferSize(); + inNetBB = ByteBuffer.allocate(netBBSize); + outNetBB = ByteBuffer.allocate(netBBSize); + outNetBB.position(0); + outNetBB.limit(0); + } + + /* + * Static factory method for creating a secure ChannelIO object. + *

      + * We need to allocate different sized application data buffers + * based on whether we're secure or not. We can't determine + * this until our sslEngine is created. + */ + static ChannelIOSecure getInstance(SocketChannel sc, boolean blocking, + SSLContext sslc) throws IOException { + + ChannelIOSecure cio = new ChannelIOSecure(sc, blocking, sslc); + + // Create a buffer using the normal expected application size we'll + // be getting. This may change, depending on the peer's + // SSL implementation. + cio.appBBSize = cio.sslEngine.getSession().getApplicationBufferSize(); + cio.requestBB = ByteBuffer.allocate(cio.appBBSize); + + return cio; + } + + /* + * Calls up to the superclass to adjust the buffer size + * by an appropriate increment. + */ + protected void resizeRequestBB() { + resizeRequestBB(appBBSize); + } + + /* + * Adjust the inbount network buffer to an appropriate size. + */ + private void resizeResponseBB() { + ByteBuffer bb = ByteBuffer.allocate(netBBSize); + inNetBB.flip(); + bb.put(inNetBB); + inNetBB = bb; + } + + /* + * Writes bb to the SocketChannel. + *

      + * Returns true when the ByteBuffer has no remaining data. + */ + private boolean tryFlush(ByteBuffer bb) throws IOException { + super.write(bb); + return !bb.hasRemaining(); + } + + /* + * Perform any handshaking processing. + *

      + * This variant is for Servers without SelectionKeys (e.g. + * blocking). + */ + boolean doHandshake() throws IOException { + return doHandshake(null); + } + + /* + * Perform any handshaking processing. + *

      + * If a SelectionKey is passed, register for selectable + * operations. + *

      + * In the blocking case, our caller will keep calling us until + * we finish the handshake. Our reads/writes will block as expected. + *

      + * In the non-blocking case, we just received the selection notification + * that this channel is ready for whatever the operation is, so give + * it a try. + *

      + * return: + * true when handshake is done. + * false while handshake is in progress + */ + boolean doHandshake(SelectionKey sk) throws IOException { + + SSLEngineResult result; + + if (initialHSComplete) { + return initialHSComplete; + } + + /* + * Flush out the outgoing buffer, if there's anything left in + * it. + */ + if (outNetBB.hasRemaining()) { + + if (!tryFlush(outNetBB)) { + return false; + } + + // See if we need to switch from write to read mode. + + switch (initialHSStatus) { + + /* + * Is this the last buffer? + */ + case FINISHED: + initialHSComplete = true; + // Fall-through to reregister need for a Read. + + case NEED_UNWRAP: + if (sk != null) { + sk.interestOps(SelectionKey.OP_READ); + } + break; + } + + return initialHSComplete; + } + + + switch (initialHSStatus) { + + case NEED_UNWRAP: + if (sc.read(inNetBB) == -1) { + sslEngine.closeInbound(); + return initialHSComplete; + } + +needIO: + while (initialHSStatus == HandshakeStatus.NEED_UNWRAP) { + resizeRequestBB(); // expected room for unwrap + inNetBB.flip(); + result = sslEngine.unwrap(inNetBB, requestBB); + inNetBB.compact(); + + initialHSStatus = result.getHandshakeStatus(); + + switch (result.getStatus()) { + + case OK: + switch (initialHSStatus) { + case NOT_HANDSHAKING: + throw new IOException( + "Not handshaking during initial handshake"); + + case NEED_TASK: + initialHSStatus = doTasks(); + break; + + case FINISHED: + initialHSComplete = true; + break needIO; + } + + break; + + case BUFFER_UNDERFLOW: + // Resize buffer if needed. + netBBSize = sslEngine.getSession().getPacketBufferSize(); + if (netBBSize > inNetBB.capacity()) { + resizeResponseBB(); + } + + /* + * Need to go reread the Channel for more data. + */ + if (sk != null) { + sk.interestOps(SelectionKey.OP_READ); + } + break needIO; + + case BUFFER_OVERFLOW: + // Reset the application buffer size. + appBBSize = + sslEngine.getSession().getApplicationBufferSize(); + break; + + default: //CLOSED: + throw new IOException("Received" + result.getStatus() + + "during initial handshaking"); + } + } // "needIO" block. + + /* + * Just transitioned from read to write. + */ + if (initialHSStatus != HandshakeStatus.NEED_WRAP) { + break; + } + + // Fall through and fill the write buffers. + + case NEED_WRAP: + /* + * The flush above guarantees the out buffer to be empty + */ + outNetBB.clear(); + result = sslEngine.wrap(hsBB, outNetBB); + outNetBB.flip(); + + initialHSStatus = result.getHandshakeStatus(); + + switch (result.getStatus()) { + case OK: + + if (initialHSStatus == HandshakeStatus.NEED_TASK) { + initialHSStatus = doTasks(); + } + + if (sk != null) { + sk.interestOps(SelectionKey.OP_WRITE); + } + + break; + + default: // BUFFER_OVERFLOW/BUFFER_UNDERFLOW/CLOSED: + throw new IOException("Received" + result.getStatus() + + "during initial handshaking"); + } + break; + + default: // NOT_HANDSHAKING/NEED_TASK/FINISHED + throw new RuntimeException("Invalid Handshaking State" + + initialHSStatus); + } // switch + + return initialHSComplete; + } + + /* + * Do all the outstanding handshake tasks in the current Thread. + */ + private SSLEngineResult.HandshakeStatus doTasks() { + + Runnable runnable; + + /* + * We could run this in a separate thread, but + * do in the current for now. + */ + while ((runnable = sslEngine.getDelegatedTask()) != null) { + runnable.run(); + } + return sslEngine.getHandshakeStatus(); + } + + /* + * Read the channel for more information, then unwrap the + * (hopefully application) data we get. + *

      + * If we run out of data, we'll return to our caller (possibly using + * a Selector) to get notification that more is available. + *

      + * Each call to this method will perform at most one underlying read(). + */ + int read() throws IOException { + SSLEngineResult result; + + if (!initialHSComplete) { + throw new IllegalStateException(); + } + + int pos = requestBB.position(); + + if (sc.read(inNetBB) == -1) { + sslEngine.closeInbound(); // probably throws exception + return -1; + } + + do { + resizeRequestBB(); // expected room for unwrap + inNetBB.flip(); + result = sslEngine.unwrap(inNetBB, requestBB); + inNetBB.compact(); + + /* + * Could check here for a renegotation, but we're only + * doing a simple read/write, and won't have enough state + * transitions to do a complete handshake, so ignore that + * possibility. + */ + switch (result.getStatus()) { + + case BUFFER_OVERFLOW: + // Reset the application buffer size. + appBBSize = sslEngine.getSession().getApplicationBufferSize(); + break; + + case BUFFER_UNDERFLOW: + // Resize buffer if needed. + netBBSize = sslEngine.getSession().getPacketBufferSize(); + if (netBBSize > inNetBB.capacity()) { + resizeResponseBB(); + + break; // break, next read will support larger buffer. + } + case OK: + if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + doTasks(); + } + break; + + default: + throw new IOException("sslEngine error during data read: " + + result.getStatus()); + } + } while ((inNetBB.position() != 0) && + result.getStatus() != Status.BUFFER_UNDERFLOW); + + return (requestBB.position() - pos); + } + + /* + * Try to write out as much as possible from the src buffer. + */ + int write(ByteBuffer src) throws IOException { + + if (!initialHSComplete) { + throw new IllegalStateException(); + } + + return doWrite(src); + } + + /* + * Try to flush out any existing outbound data, then try to wrap + * anything new contained in the src buffer. + *

      + * Return the number of bytes actually consumed from the buffer, + * but the data may actually be still sitting in the output buffer, + * waiting to be flushed. + */ + private int doWrite(ByteBuffer src) throws IOException { + int retValue = 0; + + if (outNetBB.hasRemaining() && !tryFlush(outNetBB)) { + return retValue; + } + + /* + * The data buffer is empty, we can reuse the entire buffer. + */ + outNetBB.clear(); + + SSLEngineResult result = sslEngine.wrap(src, outNetBB); + retValue = result.bytesConsumed(); + + outNetBB.flip(); + + switch (result.getStatus()) { + + case OK: + if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + doTasks(); + } + break; + + default: + throw new IOException("sslEngine error during data write: " + + result.getStatus()); + } + + /* + * Try to flush the data, regardless of whether or not + * it's been selected. Odds of a write buffer being full + * is less than a read buffer being empty. + */ + if (outNetBB.hasRemaining()) { + tryFlush(outNetBB); + } + + return retValue; + } + + /* + * Perform a FileChannel.TransferTo on the socket channel. + *

      + * We have to copy the data into an intermediary app ByteBuffer + * first, then send it through the SSLEngine. + *

      + * We return the number of bytes actually read out of the + * filechannel. However, the data may actually be stuck + * in the fileChannelBB or the outNetBB. The caller + * is responsible for making sure to call dataFlush() + * before shutting down. + */ + long transferTo(FileChannel fc, long pos, long len) throws IOException { + + if (!initialHSComplete) { + throw new IllegalStateException(); + } + + if (fileChannelBB == null) { + fileChannelBB = ByteBuffer.allocate(appBBSize); + fileChannelBB.limit(0); + } + + fileChannelBB.compact(); + int fileRead = fc.read(fileChannelBB); + fileChannelBB.flip(); + + /* + * We ignore the return value here, we return the + * number of bytes actually consumed from the the file. + * We'll flush the output buffer before we start shutting down. + */ + doWrite(fileChannelBB); + + return fileRead; + } + + /* + * Flush any remaining data. + *

      + * Return true when the fileChannelBB and outNetBB are empty. + */ + boolean dataFlush() throws IOException { + boolean fileFlushed = true; + + if ((fileChannelBB != null) && fileChannelBB.hasRemaining()) { + doWrite(fileChannelBB); + fileFlushed = !fileChannelBB.hasRemaining(); + } else if (outNetBB.hasRemaining()) { + tryFlush(outNetBB); + } + + return (fileFlushed && !outNetBB.hasRemaining()); + } + + /* + * Begin the shutdown process. + *

      + * Close out the SSLEngine if not already done so, then + * wrap our outgoing close_notify message and try to send it on. + *

      + * Return true when we're done passing the shutdown messsages. + */ + boolean shutdown() throws IOException { + + if (!shutdown) { + sslEngine.closeOutbound(); + shutdown = true; + } + + if (outNetBB.hasRemaining() && tryFlush(outNetBB)) { + return false; + } + + /* + * By RFC 2616, we can "fire and forget" our close_notify + * message, so that's what we'll do here. + */ + outNetBB.clear(); + SSLEngineResult result = sslEngine.wrap(hsBB, outNetBB); + if (result.getStatus() != Status.CLOSED) { + throw new SSLException("Improper close state"); + } + outNetBB.flip(); + + /* + * We won't wait for a select here, but if this doesn't work, + * we'll cycle back through on the next select. + */ + if (outNetBB.hasRemaining()) { + tryFlush(outNetBB); + } + + return (!outNetBB.hasRemaining() && + (result.getHandshakeStatus() != HandshakeStatus.NEED_WRAP)); + } + + /* + * close() is not overridden + */ +} diff --git a/runtime/sample/nio/server/Content.java b/runtime/sample/nio/server/Content.java new file mode 100644 index 0000000..52e06fa --- /dev/null +++ b/runtime/sample/nio/server/Content.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +/** + * An Sendable interface extension that adds additional + * methods for additional information, such as Files + * or Strings. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +interface Content extends Sendable { + + String type(); + + // Returns -1 until prepare() invoked + long length(); + +} diff --git a/runtime/sample/nio/server/Dispatcher.java b/runtime/sample/nio/server/Dispatcher.java new file mode 100644 index 0000000..9474c12 --- /dev/null +++ b/runtime/sample/nio/server/Dispatcher.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; + +/** + * Base class for the Dispatchers. + *

      + * Servers use these to obtain ready status, and then to dispatch jobs. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +interface Dispatcher extends Runnable { + + void register(SelectableChannel ch, int ops, Handler h) + throws IOException; + +} diff --git a/runtime/sample/nio/server/Dispatcher1.java b/runtime/sample/nio/server/Dispatcher1.java new file mode 100644 index 0000000..533e4b8 --- /dev/null +++ b/runtime/sample/nio/server/Dispatcher1.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; +import java.util.*; + +/** + * A single-threaded dispatcher. + *

      + * When a SelectionKey is ready, it dispatches the job in this + * thread. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class Dispatcher1 implements Dispatcher { + + private Selector sel; + + Dispatcher1() throws IOException { + sel = Selector.open(); + } + + // Doesn't really need to be runnable + public void run() { + for (;;) { + try { + dispatch(); + } catch (IOException x) { + x.printStackTrace(); + } + } + } + + private void dispatch() throws IOException { + sel.select(); + for (Iterator i = sel.selectedKeys().iterator(); i.hasNext(); ) { + SelectionKey sk = (SelectionKey)i.next(); + i.remove(); + Handler h = (Handler)sk.attachment(); + h.handle(sk); + } + } + + public void register(SelectableChannel ch, int ops, Handler h) + throws IOException { + ch.register(sel, ops, h); + } +} diff --git a/runtime/sample/nio/server/DispatcherN.java b/runtime/sample/nio/server/DispatcherN.java new file mode 100644 index 0000000..7b601b0 --- /dev/null +++ b/runtime/sample/nio/server/DispatcherN.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; +import java.util.*; + +/** + * A Multi-threaded dispatcher. + *

      + * In this example, one thread does accepts, and the second + * does read/writes. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class DispatcherN implements Dispatcher { + + private Selector sel; + + DispatcherN() throws IOException { + sel = Selector.open(); + } + + public void run() { + for (;;) { + try { + dispatch(); + } catch (IOException x) { + x.printStackTrace(); + } + } + } + + private Object gate = new Object(); + + private void dispatch() throws IOException { + sel.select(); + for (Iterator i = sel.selectedKeys().iterator(); i.hasNext(); ) { + SelectionKey sk = (SelectionKey)i.next(); + i.remove(); + Handler h = (Handler)sk.attachment(); + h.handle(sk); + } + synchronized (gate) { } + } + + public void register(SelectableChannel ch, int ops, Handler h) + throws IOException { + synchronized (gate) { + sel.wakeup(); + ch.register(sel, ops, h); + } + } + +} diff --git a/runtime/sample/nio/server/FileContent.java b/runtime/sample/nio/server/FileContent.java new file mode 100644 index 0000000..82c44a9 --- /dev/null +++ b/runtime/sample/nio/server/FileContent.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.net.*; +import java.nio.channels.*; +import java.nio.charset.*; + +/** + * A Content type that provides for transferring files. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class FileContent implements Content { + + private static File ROOT = new File("root"); + + private File fn; + + FileContent(URI uri) { + fn = new File(ROOT, + uri.getPath() + .replace('/', + File.separatorChar)); + } + + private String type = null; + + public String type() { + if (type != null) + return type; + String nm = fn.getName(); + if (nm.endsWith(".html")) + type = "text/html; charset=iso-8859-1"; + else if ((nm.indexOf('.') < 0) || nm.endsWith(".txt")) + type = "text/plain; charset=iso-8859-1"; + else + type = "application/octet-stream"; + return type; + } + + private FileChannel fc = null; + private long length = -1; + private long position = -1; // NB only; >= 0 if transferring + + public long length() { + return length; + } + + public void prepare() throws IOException { + if (fc == null) + fc = new RandomAccessFile(fn, "r").getChannel(); + length = fc.size(); + position = 0; // NB only + } + + public boolean send(ChannelIO cio) throws IOException { + if (fc == null) + throw new IllegalStateException(); + if (position < 0) // NB only + throw new IllegalStateException(); + + /* + * Short-circuit if we're already done. + */ + if (position >= length) { + return false; + } + + position += cio.transferTo(fc, position, length - position); + return (position < length); + } + + public void release() throws IOException { + if (fc != null) { + fc.close(); + fc = null; + } + } +} diff --git a/runtime/sample/nio/server/Handler.java b/runtime/sample/nio/server/Handler.java new file mode 100644 index 0000000..110feb7 --- /dev/null +++ b/runtime/sample/nio/server/Handler.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.channels.*; + +/** + * Base class for the Handlers. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +interface Handler { + + void handle(SelectionKey sk) throws IOException; + +} diff --git a/runtime/sample/nio/server/MalformedRequestException.java b/runtime/sample/nio/server/MalformedRequestException.java new file mode 100644 index 0000000..89b0db6 --- /dev/null +++ b/runtime/sample/nio/server/MalformedRequestException.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +/** + * Exception class used when a request can't be properly parsed. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class MalformedRequestException extends Exception { + + MalformedRequestException() { } + + MalformedRequestException(String msg) { + super(msg); + } + + MalformedRequestException(Exception x) { + super(x); + } +} diff --git a/runtime/sample/nio/server/N1.java b/runtime/sample/nio/server/N1.java new file mode 100644 index 0000000..d02bc93 --- /dev/null +++ b/runtime/sample/nio/server/N1.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.nio.channels.*; + +/** + * A non-blocking/single-threaded server. All accept() and + * read()/write() operations are performed by a single thread, but only + * after being selected for those operations by a Selector. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public class N1 extends Server { + + N1(int port, int backlog, boolean secure) throws Exception { + super(port, backlog, secure); + ssc.configureBlocking(false); + } + + void runServer() throws Exception { + Dispatcher d = new Dispatcher1(); + d.register(ssc, SelectionKey.OP_ACCEPT, + new AcceptHandler(ssc, d, sslContext)); + d.run(); + } +} diff --git a/runtime/sample/nio/server/N2.java b/runtime/sample/nio/server/N2.java new file mode 100644 index 0000000..2a21612 --- /dev/null +++ b/runtime/sample/nio/server/N2.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +/** + * A non-blocking/dual-threaded which performs accept()s in one thread, + * and services requests in a second. Both threads use select(). + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public class N2 extends Server { + + N2(int port, int backlog, boolean secure) throws Exception { + super(port, backlog, secure); + } + + void runServer() throws Exception { + Dispatcher d = new DispatcherN(); + Acceptor a = new Acceptor(ssc, d, sslContext); + new Thread(a).start(); + d.run(); + } +} diff --git a/runtime/sample/nio/server/README.txt b/runtime/sample/nio/server/README.txt new file mode 100644 index 0000000..aa803e8 --- /dev/null +++ b/runtime/sample/nio/server/README.txt @@ -0,0 +1,279 @@ + A Simple NIO-based HTTP/HTTPS Server Example + + +INTRODUCTION +============ +This directory contains a simple HTTP/HTTPS server. HTTP/HTTPS are two +common network protocols that provide for data transfer, and are more +fully described in RFC 2616 and RFC 2818 (Available at +http://www.ietf.org ). HTTPS is essentially HTTP after the connection +has been secured with SSL/TLS. TLS is the successor to SSL, and is +described in RFC 2246. + +This server was written to demonstrate some of the functionality new to +the Java 2 platform. The demo is not meant to be a full tutorial, and +assumes the reader has some familiarity with the subject matter. + +In particular, it shows: + + New I/O (java.nio, java.nio.channels, java.util.regex, java.nio.charset) + + Introduced in version 1.4 of the platform, NIO was designed to + overcome some of the scalability limitations found in the + existing blocking java.net.* API's, and to address other + concepts such as Regular Expression parsing and Character + Sets. + + This server demonstrates: + + ByteBuffer + Blocking and Non-Blocking I/O + SocketChannel + ServerSocketChannel + Selector + CharacterSet + Pattern matching using Regular Expressions + + JSSE (javax.net.ssl) + + Introduced in version 1.4 of the platform, JSSE provides + network security using SSL/TLS for java.net.Socket-based + traffic. In version 1.5, the SSLEngine API was introduced + which separates the SSL/TLS functionality from the underlying + I/O model. By making this separation, applications can adapt + I/O and compute strategies to best fit their circumstances. + + This server demonstrates: + + Using SSLEngine to create a HTTPS server + Creating simple key material for use with HTTPS + + Concurrency Library (java.util.concurrent) + + Introduced in version 1.5 of the platform, the concurrency + library provides a mechanism which decouples task submission + from the mechanics of how each task will be run. + + This server demonstrates: + + A ThreadPool with a fixed number of threads, which is + based on the number of available processors. + + +SETUP +===== + +The server must be built on version 1.5 (or later) of the platform. +Invoking the following should be sufficient: + + % mkdir build + % javac -source 1.5 -target 1.5 -d build *.java + +The following creates the document root: + + % mkdir root + +All documents should be placed in this directory. + +For HTTPS, the server authenticates itself to clients by using simple +Public Key Infrastructure (PKI) credentials in the form of +X509Certificates. You must create the server's credentials before +attempting to run the server in "-secure" mode. The server is +currently hardcoded to look for its credentials in a file called +"testkeys". + +In this example, we'll create credentials for a fictional widget web +site owned by the ubiquitous "Xyzzy, Inc.". When you run this in your +own environment, replace "widgets.xyzzy.com" with the hostname of your +server. + +The easiest way to create the SSL/TLS credentials is to use the +java keytool, by doing the following: + + ( represents your end-of-line key) + + % keytool -genkey -keyalg rsa -keystore testkeys -alias widgets + Enter keystore password: passphrase + What is your first and last name? + [Unknown]: widgets.xyzzy.com + What is the name of your organizational unit? + [Unknown]: Consumer Widgets Group + What is the name of your organization? + [Unknown]: Xyzzy, Inc. + What is the name of your City or Locality? + [Unknown]: Arcata + What is the name of your State or Province? + [Unknown]: CA + What is the two-letter country code for this unit? + [Unknown]: US + Is CN=widgets.xyzzy.com, OU=Consumer Widgets Group, O="Xyzzy, Inc.", + L=Arcata, ST=CA, C=US correct? + [no]: yes + + Enter key password for + (RETURN if same as keystore password): + +This directory also contain a very simple URL reader (URLDumper), which +connects to a specified URL and places all output into a specified file. + + +SERVER EXECUTION +================ + + % java -classpath build Server N1 + + Usage: Server [options] + type: + B1 Blocking/Single-threaded Server + BN Blocking/Multi-threaded Server + BP Blocking/Pooled-thread Server + N1 Nonblocking/Single-threaded Server + N2 Nonblocking/Dual-threaded Server + + options: + -port port port number + default: 8000 + -backlog backlog backlog + default: 1024 + -secure encrypt with SSL/TLS + default is insecure + +"http://" URLs should be used with insecure mode, and +"https://" for secure mode. + +The "B*" servers use classic blocking I/O: in other words, calls to +read()/write() will not return until the I/O operation has completed. The +"N*" servers use non-blocking mode and Selectors to determine which +Channels are ready to perform I/O. + +B1: A single-threaded server which completely services each + connection before moving to the next. + +B2: A multi-threaded server which creates a new thread for each + connection. This is not efficient for large numbers of + connections. + +BP: A multi-threaded server which creates a pool of threads for use + by the server. The Thread pool decides how to schedule those + threads. + +N1: A single-threaded server. All accept() and read()/write() + operations are performed by a single thread, but only after + being selected for those operations by a Selector. + +N2: A dual-threaded server which performs accept()s in one thread, and + services requests in a second. Both threads use select(). + + +CLIENT EXECUTION +================ +You can test the server using any standard browser such as Internet +Explorer or Mozilla, but since the browser will not trust the +credentials you just created, you may need to accept the credentials +via the browser's pop-up dialog box. + +Alternatively, to use the certificates using the simple included JSSE +client URLDumper, export the server certificate into a new truststore, +and then run the application using the new truststore. + + % keytool -export -keystore testkeys -alias widgets -file widgets.cer + Enter keystore password: passphrase + Certificate stored in file + + % keytool -import -keystore trustCerts -alias widgetServer \ + -file widgets.cer + Enter keystore password: passphrase + Owner: CN=widgets.xyzzy.com, OU=Consumer, O="xyzzy, inc.", L=Arcata, + ST=CA, C=US + Issuer: CN=widgets.xyzzy.com, OU=Consumer, O="xyzzy, inc.", + L=Arcata, ST=CA, C=US + Serial number: 4086cc7a + Valid from: Wed Apr 21 12:33:14 PDT 2004 until: Tue Jul 20 12:33:14 + PDT 2004 + Certificate fingerprints: + MD5: 39:71:42:CD:BF:0D:A9:8C:FB:8B:4A:CD:F8:6D:19:1F + SHA1: 69:5D:38:E9:F4:6C:E5:A7:4C:EA:45:8E:FB:3E:F3:9A:84:01:6F:22 + Trust this certificate? [no]: yes + Certificate was added to keystore + + % java -classpath build -Djavax.net.ssl.trustStore=trustCerts \ + -Djavax.net.ssl.TrustStorePassword=passphrase \ + URLDumper https://widgets.xyzzy.com:8000/ outputFile + +NOTE: The server must be run with "-secure" in order to receive +"https://" URLs. + +WARNING: This is just a simple example for code exposition, you should +spend more time understanding PKI security concerns. + + +SOURCE CODE OVERVIEW +==================== + +The main class is Server, which handles program startup, and is +subclassed by the "B*" and "N*" server classes. + +Following a successful accept(), the "B*" variants each create a +RequestServicer object to perform the actual request/reply operations. The +primary differences between the different "B*" servers is how the +RequestServicer is actually run: + + B1: RequestServicer.run() is directly called. + BN: A new thread is started, and the thread calls RequestServicer.run(). + BP: A ThreadPool is created, and the pool framework is given Runnable + tasks to complete. + +In the "N*" variations, a Dispatcher object is created, which is +responsible for performing the select, and then issuing the +corresponding handler: + + N1: A single thread is used for all accept()/read()/write() operations + N2: Similar to N1, but a separate thread is used for the accept() + operations. + +In all cases, once the connection has been accepted, a ChannelIO object +is created to handle all I/O. In the insecure case, the corresponding +SocketChannel methods are directly called. However in the secure case, +more manipulations are needed to first secure the channel, then +encrypt/decrypt the data, and finally properly send any shutdown +messages. ChannelIOSecure extends ChannelIO, and provides the secure +variants of the corresponding ChannelIO calls. + +RequestServicer and RequestHandler are the main drivers for the +blocking and non-blocking variants, respectively. They are responsible +for: + + Performing any initial handshaking + + Reading the request data + All data is stored in a local buffer in the ChannelIO + structure. + + Parsing the request + The request data is obtained from the ChannelIO object, and + is processed by Request class, which represents the + parsed URI address. + + Locating/preparing/sending the data or reporting error conditions. + A Reply object is created which represents the entire object to send, + including the HTTP/HTTPS headers. + + Shutdown/closing the channel. + + +CLOSING THOUGHTS +================ +This example represents a simple server: it is not production quality. +It was primarily meant to demonstrate the new APIs in versions 1.4 and +1.5 of the platform. + +This example could certainly be expanded to address other areas of +concern: for example, assigning multiple threads to handle the selected +Channels, or delegating SSLEngine tasks to multiple threads. There are +so many ways to implement compute and I/O strategies, we encourage you +to experiment and find what works best for your situation. + +To steal a phrase from many textbooks: + + "It is left as an exercise for the reader..." + diff --git a/runtime/sample/nio/server/Reply.java b/runtime/sample/nio/server/Reply.java new file mode 100644 index 0000000..c128ee8 --- /dev/null +++ b/runtime/sample/nio/server/Reply.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + +/** + * An object used for sending Content to the requestor. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class Reply implements Sendable { + + /** + * A helper class which define the HTTP response codes + */ + static class Code { + + private int number; + private String reason; + private Code(int i, String r) { number = i; reason = r; } + public String toString() { return number + " " + reason; } + + static Code OK = new Code(200, "OK"); + static Code BAD_REQUEST = new Code(400, "Bad Request"); + static Code NOT_FOUND = new Code(404, "Not Found"); + static Code METHOD_NOT_ALLOWED = new Code(405, "Method Not Allowed"); + + } + + private Code code; + private Content content; + private boolean headersOnly; + + Reply(Code rc, Content c) { + this(rc, c, null); + } + + Reply(Code rc, Content c, Request.Action head) { + code = rc; + content = c; + headersOnly = (head == Request.Action.HEAD); + } + + private static String CRLF = "\r\n"; + private static Charset ascii = Charset.forName("US-ASCII"); + + private ByteBuffer hbb = null; + + private ByteBuffer headers() { + CharBuffer cb = CharBuffer.allocate(1024); + for (;;) { + try { + cb.put("HTTP/1.0 ").put(code.toString()).put(CRLF); + cb.put("Server: niossl/0.1").put(CRLF); + cb.put("Content-type: ").put(content.type()).put(CRLF); + cb.put("Content-length: ") + .put(Long.toString(content.length())).put(CRLF); + cb.put(CRLF); + break; + } catch (BufferOverflowException x) { + assert(cb.capacity() < (1 << 16)); + cb = CharBuffer.allocate(cb.capacity() * 2); + continue; + } + } + cb.flip(); + return ascii.encode(cb); + } + + public void prepare() throws IOException { + content.prepare(); + hbb = headers(); + } + + public boolean send(ChannelIO cio) throws IOException { + + if (hbb == null) + throw new IllegalStateException(); + + if (hbb.hasRemaining()) { + if (cio.write(hbb) <= 0) + return true; + } + + if (!headersOnly) { + if (content.send(cio)) + return true; + } + + if (!cio.dataFlush()) + return true; + + return false; + } + + public void release() throws IOException { + content.release(); + } +} diff --git a/runtime/sample/nio/server/Request.java b/runtime/sample/nio/server/Request.java new file mode 100644 index 0000000..fa36d1e --- /dev/null +++ b/runtime/sample/nio/server/Request.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.net.*; +import java.nio.*; +import java.nio.charset.*; +import java.util.regex.*; + +/** + * An encapsulation of the request received. + *

      + * The static method parse() is responsible for creating this + * object. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class Request { + + /** + * A helper class for parsing HTTP command actions. + */ + static class Action { + + private String name; + private Action(String name) { this.name = name; } + public String toString() { return name; } + + static Action GET = new Action("GET"); + static Action PUT = new Action("PUT"); + static Action POST = new Action("POST"); + static Action HEAD = new Action("HEAD"); + + static Action parse(String s) { + if (s.equals("GET")) + return GET; + if (s.equals("PUT")) + return PUT; + if (s.equals("POST")) + return POST; + if (s.equals("HEAD")) + return HEAD; + throw new IllegalArgumentException(s); + } + } + + private Action action; + private String version; + private URI uri; + + Action action() { return action; } + String version() { return version; } + URI uri() { return uri; } + + private Request(Action a, String v, URI u) { + action = a; + version = v; + uri = u; + } + + public String toString() { + return (action + " " + version + " " + uri); + } + + static boolean isComplete(ByteBuffer bb) { + int p = bb.position() - 4; + if (p < 0) + return false; + return (((bb.get(p + 0) == '\r') && + (bb.get(p + 1) == '\n') && + (bb.get(p + 2) == '\r') && + (bb.get(p + 3) == '\n'))); + } + + private static Charset ascii = Charset.forName("US-ASCII"); + + /* + * The expected message format is first compiled into a pattern, + * and is then compared against the inbound character buffer to + * determine if there is a match. This convienently tokenizes + * our request into usable pieces. + * + * This uses Matcher "expression capture groups" to tokenize + * requests like: + * + * GET /dir/file HTTP/1.1 + * Host: hostname + * + * into: + * + * group[1] = "GET" + * group[2] = "/dir/file" + * group[3] = "1.1" + * group[4] = "hostname" + * + * The text in between the parens are used to captured the regexp text. + */ + private static Pattern requestPattern + = Pattern.compile("\\A([A-Z]+) +([^ ]+) +HTTP/([0-9\\.]+)$" + + ".*^Host: ([^ ]+)$.*\r\n\r\n\\z", + Pattern.MULTILINE | Pattern.DOTALL); + + static Request parse(ByteBuffer bb) throws MalformedRequestException { + + CharBuffer cb = ascii.decode(bb); + Matcher m = requestPattern.matcher(cb); + if (!m.matches()) + throw new MalformedRequestException(); + Action a; + try { + a = Action.parse(m.group(1)); + } catch (IllegalArgumentException x) { + throw new MalformedRequestException(); + } + URI u; + try { + u = new URI("http://" + + m.group(4) + + m.group(2)); + } catch (URISyntaxException x) { + throw new MalformedRequestException(); + } + return new Request(a, m.group(3), u); + } +} diff --git a/runtime/sample/nio/server/RequestHandler.java b/runtime/sample/nio/server/RequestHandler.java new file mode 100644 index 0000000..91d2bda --- /dev/null +++ b/runtime/sample/nio/server/RequestHandler.java @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; +import java.nio.channels.*; + +/** + * Primary driver class used by non-blocking Servers to receive, + * prepare, send, and shutdown requests. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class RequestHandler implements Handler { + + private ChannelIO cio; + private ByteBuffer rbb = null; + + private boolean requestReceived = false; + private Request request = null; + private Reply reply = null; + + private static int created = 0; + + RequestHandler(ChannelIO cio) { + this.cio = cio; + + // Simple heartbeat to let user know we're alive. + synchronized (RequestHandler.class) { + created++; + if ((created % 50) == 0) { + System.out.println("."); + created = 0; + } else { + System.out.print("."); + } + } + } + + // Returns true when request is complete + // May expand rbb if more room required + // + private boolean receive(SelectionKey sk) throws IOException { + ByteBuffer tmp = null; + + if (requestReceived) { + return true; + } + + if (!cio.doHandshake(sk)) { + return false; + } + + if ((cio.read() < 0) || Request.isComplete(cio.getReadBuf())) { + rbb = cio.getReadBuf(); + return (requestReceived = true); + } + return false; + } + + // When parse is successfull, saves request and returns true + // + private boolean parse() throws IOException { + try { + request = Request.parse(rbb); + return true; + } catch (MalformedRequestException x) { + reply = new Reply(Reply.Code.BAD_REQUEST, + new StringContent(x)); + } + return false; + } + + // Ensures that reply field is non-null + // + private void build() throws IOException { + Request.Action action = request.action(); + if ((action != Request.Action.GET) && + (action != Request.Action.HEAD)) { + reply = new Reply(Reply.Code.METHOD_NOT_ALLOWED, + new StringContent(request.toString())); + } + reply = new Reply(Reply.Code.OK, + new FileContent(request.uri()), action); + } + + public void handle(SelectionKey sk) throws IOException { + try { + + if (request == null) { + if (!receive(sk)) + return; + rbb.flip(); + if (parse()) + build(); + try { + reply.prepare(); + } catch (IOException x) { + reply.release(); + reply = new Reply(Reply.Code.NOT_FOUND, + new StringContent(x)); + reply.prepare(); + } + if (send()) { + // More bytes remain to be written + sk.interestOps(SelectionKey.OP_WRITE); + } else { + // Reply completely written; we're done + if (cio.shutdown()) { + cio.close(); + reply.release(); + } + } + } else { + if (!send()) { // Should be rp.send() + if (cio.shutdown()) { + cio.close(); + reply.release(); + } + } + } + } catch (IOException x) { + String m = x.getMessage(); + if (!m.equals("Broken pipe") && + !m.equals("Connection reset by peer")) { + System.err.println("RequestHandler: " + x.toString()); + } + + try { + /* + * We had a failure here, so we'll try to be nice + * before closing down and send off a close_notify, + * but if we can't get the message off with one try, + * we'll just shutdown. + */ + cio.shutdown(); + } catch (IOException e) { + // ignore + } + + cio.close(); + if (reply != null) { + reply.release(); + } + } + + } + + private boolean send() throws IOException { + try { + return reply.send(cio); + } catch (IOException x) { + if (x.getMessage().startsWith("Resource temporarily")) { + System.err.println("## RTA"); + return true; + } + throw x; + } + } +} diff --git a/runtime/sample/nio/server/RequestServicer.java b/runtime/sample/nio/server/RequestServicer.java new file mode 100644 index 0000000..88d40b5 --- /dev/null +++ b/runtime/sample/nio/server/RequestServicer.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; + +/** + * Primary driver class used by blocking Servers to receive, + * prepare, send, and shutdown requests. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class RequestServicer implements Runnable { + + private ChannelIO cio; + + private static int created = 0; + + RequestServicer(ChannelIO cio) { + this.cio = cio; + + // Simple heartbeat to let user know we're alive. + synchronized (RequestServicer.class) { + created++; + if ((created % 50) == 0) { + System.out.println("."); + created = 0; + } else { + System.out.print("."); + } + } + } + + private void service() throws IOException { + Reply rp = null; + try { + ByteBuffer rbb = receive(); // Receive + Request rq = null; + try { // Parse + rq = Request.parse(rbb); + } catch (MalformedRequestException x) { + rp = new Reply(Reply.Code.BAD_REQUEST, + new StringContent(x)); + } + if (rp == null) rp = build(rq); // Build + do {} while (rp.send(cio)); // Send + do {} while (!cio.shutdown()); + cio.close(); + rp.release(); + } catch (IOException x) { + String m = x.getMessage(); + if (!m.equals("Broken pipe") && + !m.equals("Connection reset by peer")) { + System.err.println("RequestHandler: " + x.toString()); + } + + try { + /* + * We had a failure here, so we'll try to be nice + * before closing down and send off a close_notify, + * but if we can't get the message off with one try, + * we'll just shutdown. + */ + cio.shutdown(); + } catch (IOException e) { + // ignore + } + + cio.close(); + if (rp != null) { + rp.release(); + } + } + } + + public void run() { + try { + service(); + } catch (IOException x) { + x.printStackTrace(); + } + } + + ByteBuffer receive() throws IOException { + + do {} while (!cio.doHandshake()); + + for (;;) { + int read = cio.read(); + ByteBuffer bb = cio.getReadBuf(); + if ((read < 0) || (Request.isComplete(bb))) { + bb.flip(); + return bb; + } + } + } + + Reply build(Request rq) throws IOException { + + Reply rp = null; + Request.Action action = rq.action(); + if ((action != Request.Action.GET) && + (action != Request.Action.HEAD)) + rp = new Reply(Reply.Code.METHOD_NOT_ALLOWED, + new StringContent(rq.toString())); + else + rp = new Reply(Reply.Code.OK, + new FileContent(rq.uri()), action); + try { + rp.prepare(); + } catch (IOException x) { + rp.release(); + rp = new Reply(Reply.Code.NOT_FOUND, + new StringContent(x)); + rp.prepare(); + } + return rp; + } +} diff --git a/runtime/sample/nio/server/Sendable.java b/runtime/sample/nio/server/Sendable.java new file mode 100644 index 0000000..44ac848 --- /dev/null +++ b/runtime/sample/nio/server/Sendable.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; + +/** + * Method definitions used for preparing, sending, and release + * content. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +interface Sendable { + + void prepare() throws IOException; + + // Sends (some) content to the given channel. + // Returns true if more bytes remain to be written. + // Throws IllegalStateException if not prepared. + // + boolean send(ChannelIO cio) throws IOException; + + void release() throws IOException; +} diff --git a/runtime/sample/nio/server/Server.java b/runtime/sample/nio/server/Server.java new file mode 100644 index 0000000..1ac6421 --- /dev/null +++ b/runtime/sample/nio/server/Server.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.net.*; +import java.nio.channels.*; +import java.security.*; +import javax.net.ssl.*; + +/** + * The main server base class. + *

      + * This class is responsible for setting up most of the server state + * before the actual server subclasses take over. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +public abstract class Server { + + ServerSocketChannel ssc; + SSLContext sslContext = null; + + static private int PORT = 8000; + static private int BACKLOG = 1024; + static private boolean SECURE = false; + + Server(int port, int backlog, + boolean secure) throws Exception { + + if (secure) { + createSSLContext(); + } + + ssc = ServerSocketChannel.open(); + ssc.socket().setReuseAddress(true); + ssc.socket().bind(new InetSocketAddress(port), backlog); + } + + /* + * If this is a secure server, we now setup the SSLContext we'll + * use for creating the SSLEngines throughout the lifetime of + * this process. + */ + private void createSSLContext() throws Exception { + + char[] passphrase = "passphrase".toCharArray(); + + KeyStore ks = KeyStore.getInstance("JKS"); + ks.load(new FileInputStream("testkeys"), passphrase); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, passphrase); + + TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + tmf.init(ks); + + sslContext = SSLContext.getInstance("TLS"); + sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } + + abstract void runServer() throws Exception; + + static private void usage() { + System.out.println( + "Usage: Server [options]\n" + + " type:\n" + + " B1 Blocking/Single-threaded Server\n" + + " BN Blocking/Multi-threaded Server\n" + + " BP Blocking/Pooled-Thread Server\n" + + " N1 Nonblocking/Single-threaded Server\n" + + " N2 Nonblocking/Dual-threaded Server\n" + + "\n" + + " options:\n" + + " -port port port number\n" + + " default: " + PORT + "\n" + + " -backlog backlog backlog\n" + + " default: " + BACKLOG + "\n" + + " -secure encrypt with SSL/TLS"); + System.exit(1); + } + + /* + * Parse the arguments, decide what type of server to run, + * see if there are any defaults to change. + */ + static private Server createServer(String args[]) throws Exception { + if (args.length < 1) { + usage(); + } + + int port = PORT; + int backlog = BACKLOG; + boolean secure = SECURE; + + for (int i = 1; i < args.length; i++) { + if (args[i].equals("-port")) { + checkArgs(i, args.length); + port = Integer.valueOf(args[++i]); + } else if (args[i].equals("-backlog")) { + checkArgs(i, args.length); + backlog = Integer.valueOf(args[++i]); + } else if (args[i].equals("-secure")) { + secure = true; + } else { + usage(); + } + } + + Server server = null; + + if (args[0].equals("B1")) { + server = new B1(port, backlog, secure); + } else if (args[0].equals("BN")) { + server = new BN(port, backlog, secure); + } else if (args[0].equals("BP")) { + server = new BP(port, backlog, secure); + } else if (args[0].equals("N1")) { + server = new N1(port, backlog, secure); + } else if (args[0].equals("N2")) { + server = new N2(port, backlog, secure); + } + + return server; + } + + static private void checkArgs(int i, int len) { + if ((i + 1) >= len) { + usage(); + } + } + + static public void main(String args[]) throws Exception { + Server server = createServer(args); + + if (server == null) { + usage(); + } + + System.out.println("Server started."); + server.runServer(); + } +} diff --git a/runtime/sample/nio/server/StringContent.java b/runtime/sample/nio/server/StringContent.java new file mode 100644 index 0000000..267b338 --- /dev/null +++ b/runtime/sample/nio/server/StringContent.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + +/** + * A Content type that provides for transferring Strings. + * + * @author Mark Reinhold + * @author Brad R. Wetmore + */ +class StringContent implements Content { + + private static Charset ascii = Charset.forName("US-ASCII"); + + private String type; // MIME type + private String content; + + StringContent(CharSequence c, String t) { + content = c.toString(); + if (!content.endsWith("\n")) + content += "\n"; + type = t + "; charset=iso-8859-1"; + } + + StringContent(CharSequence c) { + this(c, "text/plain"); + } + + StringContent(Exception x) { + StringWriter sw = new StringWriter(); + x.printStackTrace(new PrintWriter(sw)); + type = "text/plain; charset=iso-8859-1"; + content = sw.toString(); + } + + public String type() { + return type; + } + + private ByteBuffer bb = null; + + private void encode() { + if (bb == null) + bb = ascii.encode(CharBuffer.wrap(content)); + } + + public long length() { + encode(); + return bb.remaining(); + } + + public void prepare() { + encode(); + bb.rewind(); + } + + public boolean send(ChannelIO cio) throws IOException { + if (bb == null) + throw new IllegalStateException(); + cio.write(bb); + + return bb.hasRemaining(); + } + + public void release() throws IOException { + } +} diff --git a/runtime/sample/nio/server/URLDumper.java b/runtime/sample/nio/server/URLDumper.java new file mode 100644 index 0000000..30166e7 --- /dev/null +++ b/runtime/sample/nio/server/URLDumper.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +import java.io.*; +import java.net.*; + +/** + * A simple example to illustrate using a URL to access a resource + * and then store the result to a File. + *

      + * Any type of URL can be used: http, https, ftp, etc. + * + * @author Brad R. Wetmore + * @author Mark Reinhold + */ +public class URLDumper { + public static void main(String[] args) throws Exception { + + if (args.length != 2) { + System.out.println("Usage: URLDumper "); + System.exit(1); + } + + String location = args[0]; + String file = args[1]; + + URL url = new URL(location); + FileOutputStream fos = new FileOutputStream(file); + + byte [] bytes = new byte [4096]; + + InputStream is = url.openStream(); + + int read; + + while ((read = is.read(bytes)) != -1) { + fos.write(bytes, 0, read); + } + + is.close(); + fos.close(); + } +} diff --git a/runtime/sample/scripting/scriptpad/README.txt b/runtime/sample/scripting/scriptpad/README.txt new file mode 100644 index 0000000..ab4bd5f --- /dev/null +++ b/runtime/sample/scripting/scriptpad/README.txt @@ -0,0 +1,122 @@ +Scriptpad Sample + +* Introduction + +Scriptpad is a notepad like editor to open/edit/save and run +script (JavaScript) files. This sample demonstrates the use of +javax.script (JSR-223) API and JavaScript engine that is bundled +with JDK 6. + +Scriptpad sample demonstrates how to use Javascript to use Java +classes and objects to perform various tasks such as to modify, +customize Swing GUI or to connect to a running application and +monitor it using JMX (Java Management Extensions) API. + +* How to run Scriptpad? + +Scriptpad can be run with the following command: + + java -jar ./build/scriptpad.jar + +(be sure to use the correct version of java). You can +open/edit/save scripts using menu items under "File" menu. +To run currently edited script, you can use "Tools->Run" menu. + +For example, you may enter + + alert("hello, world"); + +in the editor and run the same with "Tools->Run" menu. +You will see an alert box with the message "hello, world". + +In addition to being a simple script editor/runner, scriptpad +can be used to connect to a JMX MBean server ("Tools->JMX Connect" +menu). User can specify JMX hostname and port. After connecting, +user can use "monitoring and management" script functions defined +in "mm.js" (see below). + +* Scriptpad Sources + +com.sun.demo.scriptpad.Main class is the entry point of this +sample. This class creates ScriptEngine and evaluates few +JavaScript "files" -- which are stored as resources (please +refer to src/resources/*.js). Actual code for the scriptpad's +main functionality lives in these JavaScript files. + +1. conc.js + -- simple concurrency utilities for JavaScript + +2. gui.js + -- simple GUI utilities for JavaScript + +3. mm.js + -- Monitoring and Management utilities for JavaScript + +4. scriptpad.js + -- This creates main "notepad"-like GUI for open/edit/save + and run script files + +5. Main.js + -- This script file can be used under "jrunscript" tool. + jrunscript is an experimental tool shipped with JDK (under + $JDK_HOME/bin directory). The scriptpad application can be + run by the following commands: + + cd ./src/resources + $JDK_HOME/bin/jrunscript -f Main.js -f - + + +* Extending Scriptpad: + +It is possible to extend scriptpad using scripts. There is a global +object called "application". This object has 2 fields and a method. + + Fields of the application object: + + frame -> JFrame of the scriptpad + editor -> editor pane of the scriptpad + + Method of the application object: + + addTool -> adds a menu item under "Tools" menu + + Example script to add "Tools->Hello" menu item: + + application.addTool("Hello", + function() { alert("hello, world"); }); + +After running the above script, you can click Tools->Hello menu item +and you'll see an alert box. + +Scriptpad customization may also be done by defining a file named +"scriptpad.js" under your home directory,. If this file is found, +scriptpad loads this file just after initializating everything. +In your initialization file, you can additional script functions +by "load" function. + +* Script Samples: + +On clicking the menu items under "Examples" menu, scriptpad shows +built-in examples in the editor. Also, there are few script samples +under the ./src/scripts directory. + +* Monitoring and Management with Scriptpad: + +(1) Start the application with the JMX agent - here's an example of + how the Java2D demo is started + + java -Dcom.sun.management.jmxremote.port=1090 \ + -Dcom.sun.management.jmxremote.ssl=false \ + -Dcom.sun.management.jmxremote.authenticate=false \ + -jar $JDK_HOME/demo/jfc/Font2DTest/Font2DTest.jar + +(2) Start scriptpad and click on "Tools->JMX Connect" menu. + In the prompt, enter "localhost:1090" to connect to the above + program. + +After connecting to a MBeanServer (using "Tools->JMX Connect"), +you can run any script that uses functions defined in "mm.js". +For example, it is possible to load and run management scripts that +are part of JConsole script shell plugin under the directory: + + $JDK_HOME/demo/scripting/jconsole-plugin/src/scripts diff --git a/runtime/sample/scripting/scriptpad/build.properties b/runtime/sample/scripting/scriptpad/build.properties new file mode 100644 index 0000000..efcd591 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/build.properties @@ -0,0 +1,22 @@ +main.dir=. + +src.dir=${main.dir}/src + +build.dir=build +classes.dir=${build.dir}/classes +jar=${build.dir}/scriptpad.jar +javadoc.dir=${build.dir}/javadoc + +build.sysclasspath=ignore +# E.g.: cp=lib/x.jar:lib/y.jar +cp= +extra.run.cp= + +main.class=com.sun.sample.scriptpad.Main + +run.cp=${cp}:${classes.dir}:${extra.run.cp} + +debug=true +deprecation=false + +nbjdk.home=${basedir}/../../.. diff --git a/runtime/sample/scripting/scriptpad/build.xml b/runtime/sample/scripting/scriptpad/build.xml new file mode 100644 index 0000000..5f203d5 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/build.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set property 'main.class' (e.g. in build.properties) + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtime/sample/scripting/scriptpad/nbproject/file-targets.xml b/runtime/sample/scripting/scriptpad/nbproject/file-targets.xml new file mode 100644 index 0000000..0904977 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/nbproject/file-targets.xml @@ -0,0 +1,46 @@ + + + + + + + + + + Must set property 'includes' + + + + + + + diff --git a/runtime/sample/scripting/scriptpad/nbproject/jdk.xml b/runtime/sample/scripting/scriptpad/nbproject/jdk.xml new file mode 100644 index 0000000..2b85b77 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/nbproject/jdk.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtime/sample/scripting/scriptpad/nbproject/netbeans-targets.xml b/runtime/sample/scripting/scriptpad/nbproject/netbeans-targets.xml new file mode 100644 index 0000000..b53c34d --- /dev/null +++ b/runtime/sample/scripting/scriptpad/nbproject/netbeans-targets.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtime/sample/scripting/scriptpad/nbproject/project.xml b/runtime/sample/scripting/scriptpad/nbproject/project.xml new file mode 100644 index 0000000..32135c7 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/nbproject/project.xml @@ -0,0 +1,173 @@ + + + + + + org.netbeans.modules.ant.freeform + + + Scriptpad + + user.build.properties + build.properties + ${nbjdk.home}/jre/lib/rt.jar + + + + + ${main.dir} + + + + java + ${src.dir} + + + ${build.dir} + + + + + jar + + + clean + + + clean + jar + + + run + + + + show-javadoc + + + + debug + + + + compile-selected + + includes + ${src.dir} + \.java$ + relative-path + + , + + + + + run + + main.class + ${src.dir} + \.java$ + java-name + + + + + + + + debug + + main.class + ${src.dir} + \.java$ + java-name + + + + + + + + debug-fix + + class + ${src.dir} + \.java$ + relative-path-noext + + + + + + + + jar + ${jar} + jar + clean + + + + + + ${src.dir} + + + ${main.dir}/README.txt + + + + + + + + + + + + + + + + + ${src.dir} + ${cp} + ${run.cp} + ${nbjdk.bootclasspath} + ${classes.dir} + ${jar} + ${javadoc.dir} + 1.5 + + + + diff --git a/runtime/sample/scripting/scriptpad/src/META-INF/manifest.mf b/runtime/sample/scripting/scriptpad/src/META-INF/manifest.mf new file mode 100644 index 0000000..76eda30 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/META-INF/manifest.mf @@ -0,0 +1,2 @@ +Main-Class: com.sun.sample.scriptpad.Main + diff --git a/runtime/sample/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java b/runtime/sample/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java new file mode 100644 index 0000000..aaeb58d --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/com/sun/sample/scriptpad/Main.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + + +package com.sun.sample.scriptpad; + +import javax.script.*; +import java.io.*; + +/** + * This is the entry point of "Scriptpad" sample. This class creates + * ScriptEngine and evaluates few JavaScript "files" -- which are stored + * as resources (please refer to src/resources/*.js). Actual code for the + * scriptpad's main functionality lives in these JavaScript files. + */ +public class Main { + public static void main(String[] args) throws Exception { + + // create a ScriptEngineManager + ScriptEngineManager m = new ScriptEngineManager(); + // get an instance of JavaScript script engine + ScriptEngine engine = m.getEngineByName("js"); + + // expose the current script engine as a global variable + engine.put("engine", engine); + + // evaluate few scripts that are bundled in "resources" + eval(engine, "conc.js"); + eval(engine, "gui.js"); + eval(engine, "scriptpad.js"); + eval(engine, "mm.js"); + } + + private static void eval(ScriptEngine engine, String name) + throws Exception { + /* + * This class is compiled into a jar file. The jar file + * contains few scripts under /resources URL. + */ + InputStream is = Main.class.getResourceAsStream("/resources/" + name); + // current script file name for better error messages + engine.put(ScriptEngine.FILENAME, name); + // evaluate the script in the InputStream + engine.eval(new InputStreamReader(is)); + } +} diff --git a/runtime/sample/scripting/scriptpad/src/resources/Main.js b/runtime/sample/scripting/scriptpad/src/resources/Main.js new file mode 100644 index 0000000..a1c332d --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/resources/Main.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script can be loaded in jrunscript to start scriptpad. + * + * jrunscript -f Main.js -f - + */ + +load("conc.js"); +load("gui.js"); +load("scriptpad.js"); +load("mm.js"); diff --git a/runtime/sample/scripting/scriptpad/src/resources/conc.js b/runtime/sample/scripting/scriptpad/src/resources/conc.js new file mode 100644 index 0000000..aaca49a --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/resources/conc.js @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * Concurrency utilities for JavaScript. These are based on + * java.lang and java.util.concurrent API. The following functions + * provide a simpler API for scripts. Instead of directly using java.lang + * and java.util.concurrent classes, scripts can use functions and + * objects exported from here. + */ + +// shortcut for j.u.c lock classes +var Lock = java.util.concurrent.locks.ReentrantLock; +var RWLock = java.util.concurrent.locks.ReentrantReadWriteLock; + +// check if there is a build in sync function, define one if missing +if (typeof sync === "undefined") { + var sync = function(func, obj) { + if (arguments.length < 1 || arguments.length > 2 ) { + throw "sync(function [,object]) parameter count mismatch"; + } + + var syncobj = (arguments.length == 2 ? obj : this); + + if (!syncobj._syncLock) { + syncobj._syncLock = new Lock(); + } + + return function() { + syncobj._syncLock.lock(); + try { + func.apply(null, arguments); + } finally { + syncobj._syncLock.unlock(); + } + }; + }; + sync.docString = "synchronize a function, optionally on an object"; +} + +/** + * Wrapper for java.lang.Object.wait + * + * can be called only within a sync method + */ +function wait(object) { + var objClazz = java.lang.Class.forName('java.lang.Object'); + var waitMethod = objClazz.getMethod('wait', null); + waitMethod.invoke(object, null); +} +wait.docString = "convenient wrapper for java.lang.Object.wait method"; + +/** + * Wrapper for java.lang.Object.notify + * + * can be called only within a sync method + */ +function notify(object) { + var objClazz = java.lang.Class.forName('java.lang.Object'); + var notifyMethod = objClazz.getMethod('notify', null); + notifyMethod.invoke(object, null); +} +notify.docString = "convenient wrapper for java.lang.Object.notify method"; + +/** + * Wrapper for java.lang.Object.notifyAll + * + * can be called only within a sync method + */ +function notifyAll(object) { + var objClazz = java.lang.Class.forName('java.lang.Object'); + var notifyAllMethod = objClazz.getMethod('notifyAll', null); + notifyAllMethod.invoke(object, null); +} +notifyAll.docString = "convenient wrapper for java.lang.Object.notifyAll method"; + +/** + * Creates a java.lang.Runnable from a given script + * function. + */ +Function.prototype.runnable = function() { + var args = arguments; + var func = this; + return new java.lang.Runnable() { + run: function() { + func.apply(null, args); + } + } +}; + +/** + * Executes the function on a new Java Thread. + */ +Function.prototype.thread = function() { + var t = new java.lang.Thread(this.runnable.apply(this, arguments)); + t.start(); + return t; +}; + +/** + * Executes the function on a new Java daemon Thread. + */ +Function.prototype.daemon = function() { + var t = new java.lang.Thread(this.runnable.apply(this, arguments)); + t.setDaemon(true); + t.start(); + return t; +}; + +/** + * Creates a java.util.concurrent.Callable from a given script + * function. + */ +Function.prototype.callable = function() { + var args = arguments; + var func = this; + return new java.util.concurrent.Callable() { + call: function() { return func.apply(null, args); } + } +}; + +/** + * Registers the script function so that it will be called exit. + */ +Function.prototype.atexit = function () { + var args = arguments; + java.lang.Runtime.getRuntime().addShutdownHook( + new java.lang.Thread(this.runnable.apply(this, args))); +}; + +/** + * Executes the function asynchronously. + * + * @return a java.util.concurrent.FutureTask + */ +Function.prototype.future = (function() { + // default executor for future + var juc = java.util.concurrent; + var theExecutor = juc.Executors.newSingleThreadExecutor(); + // clean-up the default executor at exit + (function() { theExecutor.shutdown(); }).atexit(); + return function() { + return theExecutor.submit(this.callable.apply(this, arguments)); + }; +})(); + +/** + * Executes a function after acquiring given lock. On return, + * (normal or exceptional), lock is released. + * + * @param lock lock that is locked and unlocked + */ +Function.prototype.sync = function (lock) { + if (arguments.length == 0) { + throw "lock is missing"; + } + var res = new Array(arguments.length - 1); + for (var i = 0; i < res.length; i++) { + res[i] = arguments[i + 1]; + } + lock.lock(); + try { + this.apply(null, res); + } finally { + lock.unlock(); + } +}; + +/** + * Causes current thread to sleep for specified + * number of milliseconds + * + * @param interval in milliseconds + */ +function sleep(interval) { + java.lang.Thread.sleep(interval); +} +sleep.docString = "wrapper for java.lang.Thread.sleep method"; + +/** + * Schedules a task to be executed once in N milliseconds specified. + * + * @param callback function or expression to evaluate + * @param interval in milliseconds to sleep + * @return timeout ID (which is nothing but Thread instance) + */ +function setTimeout(callback, interval) { + if (! (callback instanceof Function)) { + callback = new Function(callback); + } + + // start a new thread that sleeps given time + // and calls callback in an infinite loop + return (function() { + try { + sleep(interval); + } catch (x) { } + callback(); + }).daemon(); +} +setTimeout.docString = "calls given callback once after specified interval"; + +/** + * Cancels a timeout set earlier. + * @param tid timeout ID returned from setTimeout + */ +function clearTimeout(tid) { + // we just interrupt the timer thread + tid.interrupt(); +} +clearTimeout.docString = "interrupt a setTimeout timer"; + +/** + * Schedules a task to be executed once in + * every N milliseconds specified. + * + * @param callback function or expression to evaluate + * @param interval in milliseconds to sleep + * @return timeout ID (which is nothing but Thread instance) + */ +function setInterval(callback, interval) { + if (! (callback instanceof Function)) { + callback = new Function(callback); + } + + // start a new thread that sleeps given time + // and calls callback in an infinite loop + return (function() { + while (true) { + try { + sleep(interval); + } catch (x) { + break; + } + callback(); + } + }).daemon(); +} +setInterval.docString = "calls given callback every specified interval"; + +/** + * Cancels a timeout set earlier. + * @param tid timeout ID returned from setTimeout + */ +function clearInterval(tid) { + // we just interrupt the timer thread + tid.interrupt(); +} +clearInterval.docString = "interrupt a setInterval timer"; + +/** + * Simple access to thread local storage. + * + * Script sample: + * + * __thread.x = 44; + * function f() { + * __thread.x = 'hello'; + * print(__thread.x); + * } + * f.thread(); // prints 'hello' + * print(__thread.x); // prints 44 in main thread + */ +var __thread = (function () { + var map = new Object(); + return new JSAdapter({ + __has__: function(name) { + return map[name] != undefined; + }, + __get__: function(name) { + if (map[name] != undefined) { + return map[name].get(); + } else { + return undefined; + } + }, + __put__: sync(function(name, value) { + if (map[name] == undefined) { + var tmp = new java.lang.ThreadLocal(); + tmp.set(value); + map[name] = tmp; + } else { + map[name].set(value); + } + }), + __delete__: function(name) { + if (map[name] != undefined) { + map[name].set(null); + } + } + }); +})(); + diff --git a/runtime/sample/scripting/scriptpad/src/resources/gui.js b/runtime/sample/scripting/scriptpad/src/resources/gui.js new file mode 100644 index 0000000..d62b92f --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/resources/gui.js @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * Few user interface utilities. + */ + +if (this.window === undefined) { + this.window = null; +} + +/** + * Swing invokeLater - invokes given function in AWT event thread + */ +Function.prototype.invokeLater = function() { + var SwingUtilities = javax.swing.SwingUtilities; + var func = this; + var args = arguments; + SwingUtilities.invokeLater(new java.lang.Runnable() { + run: function() { + func.apply(func, args); + } + }); +}; + +/** + * Swing invokeAndWait - invokes given function in AWT event thread + * and waits for it's completion + */ +Function.prototype.invokeAndWait = function() { + var SwingUtilities = javax.swing.SwingUtilities; + var func = this; + var args = arguments; + SwingUtilities.invokeAndWait(new java.lang.Runnable() { + run: function() { + func.apply(func, args); + } + }); +}; + +/** + * Am I running in AWT event dispatcher thread? + */ +function isEventThread() { + var SwingUtilities = javax.swing.SwingUtilities; + return SwingUtilities.isEventDispatchThread(); +} +isEventThread.docString = "returns whether the current thread is GUI thread"; + +/** + * Opens a file dialog box + * + * @param curDir current directory [optional] + * @param save flag tells whether this is a save dialog or not + * @return selected file or else null + */ +function fileDialog(curDir, save) { + var result; + function _fileDialog() { + if (curDir == undefined) { + curDir = new java.io.File("."); + } + + var JFileChooser = javax.swing.JFileChooser; + var dialog = new JFileChooser(curDir); + var res = save ? dialog.showSaveDialog(window): + dialog.showOpenDialog(window); + + if (res == JFileChooser.APPROVE_OPTION) { + result = dialog.getSelectedFile(); + } else { + result = null; + } + } + + if (isEventThread()) { + _fileDialog(); + } else { + _fileDialog.invokeAndWait(); + } + + return result; +} +fileDialog.docString = "show a file dialog box"; + +/** + * Opens a color chooser dialog box + * + * @param title of the dialog box [optional] + * @param color default color [optional] + * @return chosen color or default color + */ +function colorDialog(title, color) { + var result; + + function _colorDialog() { + if (title == undefined) { + title = "Choose Color"; + } + + if (color == undefined) { + color = java.awt.Color.BLACK; + } + + var chooser = new javax.swing.JColorChooser(); + var res = chooser.showDialog(window, title, color); + result = res ? res : color; + } + + if (isEventThread()) { + _colorDialog(); + } else { + _colorDialog.invokeAndWait(); + } + + return result; +} +colorDialog.docString = "shows a color chooser dialog box"; + +/** + * Shows a message box + * + * @param msg message to be shown + * @param title title of message box [optional] + * @param msgType type of message box [constants in JOptionPane] + */ +function msgBox(msg, title, msgType) { + function _msgBox() { + var JOptionPane = javax.swing.JOptionPane; + if (msg === undefined) msg = "undefined"; + if (msg === null) msg = "null"; + if (title == undefined) title = msg; + if (msgType == undefined) msgType = JOptionPane.INFORMATION_MESSAGE; + JOptionPane.showMessageDialog(window, msg, title, msgType); + } + + if (isEventThread()) { + _msgBox(); + } else { + _msgBox.invokeAndWait(); + } +} +msgBox.docString = "shows MessageBox to the user"; + +/** + * Shows an information alert box + * + * @param msg message to be shown + * @param title title of message box [optional] + */ +function alert(msg, title) { + var JOptionPane = javax.swing.JOptionPane; + msgBox(msg, title, JOptionPane.INFORMATION_MESSAGE); +} +alert.docString = "shows an alert message box to the user"; + +/** + * Shows an error alert box + * + * @param msg message to be shown + * @param title title of message box [optional] + */ +function error(msg, title) { + var JOptionPane = javax.swing.JOptionPane; + msgBox(msg, title, JOptionPane.ERROR_MESSAGE); +} +error.docString = "shows an error message box to the user"; + +/** + * Shows a warning alert box + * + * @param msg message to be shown + * @param title title of message box [optional] + */ +function warn(msg, title) { + var JOptionPane = javax.swing.JOptionPane; + msgBox(msg, title, JOptionPane.WARNING_MESSAGE); +} +warn.docString = "shows a warning message box to the user"; + +/** + * Shows a prompt dialog box + * + * @param question question to be asked + * @param answer default answer suggested [optional] + * @return answer given by user + */ +function prompt(question, answer) { + var result; + function _prompt() { + var JOptionPane = javax.swing.JOptionPane; + if (answer == undefined) answer = ""; + result = JOptionPane.showInputDialog(window, question, answer); + } + + if (isEventThread()) { + _prompt(); + } else { + _prompt.invokeAndWait(); + } + + return result; +} +prompt.docString = "shows a prompt box to the user and returns the answer"; + +/** + * Shows a confirmation dialog box + * + * @param msg message to be shown + * @param title title of message box [optional] + * @return boolean (yes->true, no->false) + */ +function confirm(msg, title) { + var result; + var JOptionPane = javax.swing.JOptionPane; + + function _confirm() { + if (title == undefined) title = msg; + var optionType = JOptionPane.YES_NO_OPTION; + result = JOptionPane.showConfirmDialog(window, msg, title, optionType); + } + + if (isEventThread()) { + _confirm(); + } else { + _confirm.invokeAndWait(); + } + + return result == JOptionPane.YES_OPTION; +} +confirm.docString = "shows a confirmation message box to the user"; + +/** + * Exit the process after confirmation from user + * + * @param exitCode return code to OS [optional] + */ +function exit(exitCode) { + if (exitCode == undefined) exitCode = 0; + if (confirm("Do you really want to exit?")) { + java.lang.System.exit(exitCode); + } +} +exit.docString = "exits jconsole"; + +// synonym to exit +var quit = exit; + +// if echo function is not defined, define it as synonym +// for println function +if (this.echo == undefined) { + function echo(str) { + println(str); + } +} + diff --git a/runtime/sample/scripting/scriptpad/src/resources/mm.js b/runtime/sample/scripting/scriptpad/src/resources/mm.js new file mode 100644 index 0000000..07efad2 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/resources/mm.js @@ -0,0 +1,339 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This is a collection of utilities for Monitoring + * and management API. + * + * File dependency: + * conc.js -> for concurrency utilities + */ + +// At any time, we maintain atmost one MBeanServer +// connection. And so, we store the same as a global +// variable. +var mmConnection = null; + +function jmxConnect(hostport) { + if (mmConnection != null) { + // close the existing connection + try { + mmConnection.close(); + } catch (e) { + } + } + + var JMXServiceURL = javax.management.remote.JMXServiceURL; + var JMXConnectorFactory = javax.management.remote.JMXConnectorFactory; + + var urlPath = "/jndi/rmi://" + hostport + "/jmxrmi"; + var url = new JMXServiceURL("rmi", "", 0, urlPath); + var jmxc = JMXConnectorFactory.connect(url); + // note that the "mmConnection" is a global variable! + mmConnection = jmxc.getMBeanServerConnection(); +} +jmxConnect.docString = "connects to the given host, port (specified as name:port)"; + +function mbeanConnection() { + if (mmConnection == null) { + throw "Not connected to MBeanServer yet!"; + } + + return mmConnection; +} +mbeanConnection.docString = "returns the current MBeanServer connection"; + +/** + * Returns a platform MXBean proxy for given MXBean name and interface class + */ +function newPlatformMXBeanProxy(name, intf) { + var factory = java.lang.management.ManagementFactory; + return factory.newPlatformMXBeanProxy(mbeanConnection(), name, intf); +} +newPlatformMXBeanProxy.docString = "returns a proxy for a platform MXBean"; + +/** + * Wraps a string to ObjectName if needed. + */ +function objectName(objName) { + var ObjectName = Packages.javax.management.ObjectName; + if (objName instanceof ObjectName) { + return objName; + } else { + return new ObjectName(objName); + } +} +objectName.docString = "creates JMX ObjectName for a given String"; + +/** + * Creates a new (M&M) Attribute object + * + * @param name name of the attribute + * @param value value of the attribute + */ +function attribute(name, value) { + var Attribute = Packages.javax.management.Attribute; + return new Attribute(name, value); +} +attribute.docString = "returns a new JMX Attribute using name and value given"; + +/** + * Returns MBeanInfo for given ObjectName. Strings are accepted. + */ +function mbeanInfo(objName) { + objName = objectName(objName); + return mbeanConnection().getMBeanInfo(objName); +} +mbeanInfo.docString = "returns MBeanInfo of a given ObjectName"; + +/** + * Returns ObjectInstance for a given ObjectName. + */ +function objectInstance(objName) { + objName = objectName(objName); + return mbeanConnection().objectInstance(objectName); +} +objectInstance.docString = "returns ObjectInstance for a given ObjectName"; + +/** + * Queries with given ObjectName and QueryExp. + * QueryExp may be null. + * + * @return set of ObjectNames. + */ +function queryNames(objName, query) { + objName = objectName(objName); + if (query == undefined) query = null; + return mbeanConnection().queryNames(objName, query); +} +queryNames.docString = "returns QueryNames using given ObjectName and optional query"; + +/** + * Queries with given ObjectName and QueryExp. + * QueryExp may be null. + * + * @return set of ObjectInstances. + */ +function queryMBeans(objName, query) { + objName = objectName(objName); + if (query == undefined) query = null; + return mbeanConnection().queryMBeans(objName, query); +} +queryMBeans.docString = "return MBeans using given ObjectName and optional query"; + +// wraps a script array as java.lang.Object[] +function objectArray(array) { + return Java.to(array, "java.lang.Object[]"); +} + +// wraps a script (string) array as java.lang.String[] +function stringArray(array) { + return Java.to(array, "java.lang.String[]"); +} + +// script array to Java List +function toAttrList(array) { + var AttributeList = Packages.javax.management.AttributeList; + if (array instanceof AttributeList) { + return array; + } + var list = new AttributeList(array.length); + for (var index = 0; index < array.length; index++) { + list.add(array[index]); + } + return list; +} + +// Java Collection (Iterable) to script array +function toArray(collection) { + if (collection instanceof Array) { + return collection; + } + var itr = collection.iterator(); + var array = new Array(); + while (itr.hasNext()) { + array[array.length] = itr.next(); + } + return array; +} + +// gets MBean attributes +function getMBeanAttributes(objName, attributeNames) { + objName = objectName(objName); + return mbeanConnection().getAttributes(objName,stringArray(attributeNames)); +} +getMBeanAttributes.docString = "returns specified Attributes of given ObjectName"; + +// gets MBean attribute +function getMBeanAttribute(objName, attrName) { + objName = objectName(objName); + return mbeanConnection().getAttribute(objName, attrName); +} +getMBeanAttribute.docString = "returns a single Attribute of given ObjectName"; + +// sets MBean attributes +function setMBeanAttributes(objName, attrList) { + objName = objectName(objName); + attrList = toAttrList(attrList); + return mbeanConnection().setAttributes(objName, attrList); +} +setMBeanAttributes.docString = "sets specified Attributes of given ObjectName"; + +// sets MBean attribute +function setMBeanAttribute(objName, attrName, attrValue) { + var Attribute = Packages.javax.management.Attribute; + objName = objectName(objName); + mbeanConnection().setAttribute(objName, new Attribute(attrName, attrValue)); +} +setMBeanAttribute.docString = "sets a single Attribute of given ObjectName"; + +// invokes an operation on given MBean +function invokeMBean(objName, operation, params, signature) { + objName = objectName(objName); + params = objectArray(params); + signature = stringArray(signature); + return mbeanConnection().invoke(objName, operation, params, signature); +} +invokeMBean.docString = "invokes MBean operation on given ObjectName"; + +/** + * Wraps a MBean specified by ObjectName as a convenient + * script object -- so that setting/getting MBean attributes + * and invoking MBean method can be done with natural syntax. + * + * @param objName ObjectName of the MBean + * @param async asynchornous mode [optional, default is false] + * @return script wrapper for MBean + * + * With async mode, all field, operation access is async. Results + * will be of type FutureTask. When you need value, call 'get' on it. + */ +function mbean(objName, async) { + var index; + objName = objectName(objName); + var info = mbeanInfo(objName); + var attrs = info.attributes; + var attrMap = new Object; + for (index in attrs) { + attrMap[attrs[index].name] = attrs[index]; + } + var opers = info.operations; + var operMap = new Object; + for (index in opers) { + operMap[opers[index].name] = opers[index]; + } + + function isAttribute(name) { + return name in attrMap; + } + + function isOperation(name) { + return name in operMap; + } + + return new JSAdapter() { + __has__: function (name) { + return isAttribute(name) || isOperation(name); + }, + __get__: function (name) { + if (isAttribute(name)) { + if (async) { + return getMBeanAttribute.future(objName, name); + } else { + return getMBeanAttribute(objName, name); + } + } else { + return undefined; + } + }, + __call__: function(name) { + if (isOperation(name)) { + var oper = operMap[name]; + + var params = []; + for (var j = 1; j < arguments.length; j++) { + params[j-1]= arguments[j]; + } + + var sigs = oper.signature; + + var sigNames = new Array(sigs.length); + for (var index in sigs) { + sigNames[index] = sigs[index].getType(); + } + + if (async) { + return invokeMBean.future(objName, name, params, sigNames); + } else { + return invokeMBean(objName, name, params, sigNames); + } + } else { + return undefined; + } + }, + __put__: function (name, value) { + if (isAttribute(name)) { + if (async) { + setMBeanAttribute.future(objName, name, value); + } else { + setMBeanAttribute(objName, name, value); + } + } else { + return undefined; + } + } + }; +} +mbean.docString = "returns a conveninent script wrapper for a MBean of given ObjectName"; + +if (this.application != undefined) { + this.application.addTool("JMX Connect", + // connect to a JMX MBean Server + function () { + var url = prompt("Connect to JMX server (host:port)"); + if (url != null) { + try { + jmxConnect(url); + alert("connected!"); + } catch (e) { + error(e, "Can not connect to " + url); + } + } + }); +} diff --git a/runtime/sample/scripting/scriptpad/src/resources/scriptpad.js b/runtime/sample/scripting/scriptpad/src/resources/scriptpad.js new file mode 100644 index 0000000..807d05e --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/resources/scriptpad.js @@ -0,0 +1,662 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script creates a simple Notepad-like interface, which + * serves as a simple script editor, runner. + * + * File dependency: + * + * gui.js -> for basic GUI functions + */ + +/* + * globalThis is used for actionHelpGlobals() and showFrame(). + */ +var globalThis = this; + +/* + * JavaImporter helps in avoiding pollution of JavaScript + * global namespace. We can import multiple Java packages + * with this and use the JavaImporter object with "with" + * statement. + */ +var guiPkgs = new JavaImporter(java.awt, java.awt.event, + javax.swing, javax.swing.undo, + javax.swing.event, javax.swing.text); + +// main entry point of the scriptpad application +var main = function() { + function createEditor() { + var c = new guiPkgs.JTextArea(); + c.setDragEnabled(true); + c.setFont(new guiPkgs.Font("monospaced", guiPkgs.Font.PLAIN, 12)); + return c; + } + + /*const*/ var titleSuffix = "- Scriptpad"; + /*const*/ var defaultTitle = "Untitled" + titleSuffix; + + // Scriptpad's main frame + var frame; + // Scriptpad's main editor + var editor; + + // To track the current file name + var curFileName = null; + + // To track whether the current document + // has been modified or not + var docChanged = false; + + // check and alert user for unsaved + // but modified document + function checkDocChanged() { + if (docChanged) { + // ignore zero-content untitled document + if (curFileName == null && + editor.document.length == 0) { + return; + } + + if (confirm("Do you want to save the changes?", + "The document has changed")) { + actionSave(); + } + } + } + + // set a document listener to track + // whether that is modified or not + function setDocListener() { + var doc = editor.getDocument(); + docChanged = false; + doc.addDocumentListener( new guiPkgs.DocumentListener() { + equals: function(o) { + return this === o; }, + toString: function() { + return "doc listener"; }, + changeUpdate: function() { + docChanged = true; }, + insertUpdate: function() { + docChanged = true; }, + removeUpdate: function() { + docChanged = true; } + }); + } + + // menu action functions + + // "File" menu + + // create a "new" document + function actionNew() { + checkDocChanged(); + curFileName = null; + editor.setDocument(new guiPkgs.PlainDocument()); + setDocListener(); + frame.setTitle(defaultTitle); + editor.revalidate(); + } + + // open an existing file + function actionOpen() { + checkDocChanged(); + var f = fileDialog(); + if (f == null) { + return; + } + + if (f.isFile() && f.canRead()) { + frame.setTitle(f.getName() + titleSuffix); + editor.setDocument(new guiPkgs.PlainDocument()); + var progress = new guiPkgs.JProgressBar(); + progress.setMinimum(0); + progress.setMaximum(f.length()); + var doc = editor.getDocument(); + var inp = new java.io.FileReader(f); + var buff = java.lang.reflect.Array.newInstance( + java.lang.Character.TYPE, 4096); + var nch; + while ((nch = inp.read(buff, 0, buff.length)) != -1) { + doc.insertString(doc.getLength(), + new java.lang.String(buff, 0, nch), null); + progress.setValue(progress.getValue() + nch); + } + inp.close(); + curFileName = f.getAbsolutePath(); + setDocListener(); + } else { + error("Can not open file: " + f, + "Error opening file: " + f); + } + } + + // open script from a URL + function actionOpenURL() { + checkDocChanged(); + var url = prompt("Address:"); + if (url == null) { + return; + } + + try { + var u = new java.net.URL(url); + editor.setDocument(new guiPkgs.PlainDocument()); + frame.setTitle(url + titleSuffix); + var progress = new guiPkgs.JProgressBar(); + progress.setMinimum(0); + progress.setIndeterminate(true); + var doc = editor.getDocument(); + var inp = new java.io.InputStreamReader(u.openStream()); + var buff = java.lang.reflect.Array.newInstance( + java.lang.Character.TYPE, 4096); + var nch; + while ((nch = inp.read(buff, 0, buff.length)) != -1) { + doc.insertString(doc.getLength(), + new java.lang.String(buff, 0, nch), null); + progress.setValue(progress.getValue() + nch); + } + curFileName = null; + setDocListener(); + } catch (e) { + error("Error opening URL: " + e, + "Can not open URL: " + url); + } + } + + // factored out "save" function used by + // save, save as menu actions + function save(file) { + var doc = editor.getDocument(); + frame.setTitle(file.getName() + titleSuffix); + curFileName = file; + var progress = new guiPkgs.JProgressBar(); + progress.setMinimum(0); + progress.setMaximum(file.length()); + var out = new java.io.FileWriter(file); + var text = new guiPkgs.Segment(); + text.setPartialReturn(true); + var charsLeft = doc.getLength(); + var offset = 0; + var min; + + while (charsLeft > 0) { + doc.getText(offset, Math.min(4096, charsLeft), text); + out.write(text.array, text.offset, text.count); + charsLeft -= text.count; + offset += text.count; + progress.setValue(offset); + java.lang.Thread.sleep(10); + } + + out.flush(); + out.close(); + docChanged = false; + } + + // file-save as menu + function actionSaveAs() { + var ret = fileDialog(null, true); + if (ret == null) { + return; + } + save(ret); + } + + // file-save menu + function actionSave() { + if (curFileName) { + save(new java.io.File(curFileName)); + } else { + actionSaveAs(); + } + } + + // exit from scriptpad + function actionExit() { + checkDocChanged(); + java.lang.System.exit(0); + } + + // "Edit" menu + + // cut the currently selected text + function actionCut() { + editor.cut(); + } + + // copy the currently selected text to clipboard + function actionCopy() { + editor.copy(); + } + + // paste clipboard content to document + function actionPaste() { + editor.paste(); + } + + // select all the text in editor + function actionSelectAll() { + editor.selectAll(); + } + + // "Tools" menu + + // run the current document as JavaScript + function actionRun() { + var doc = editor.getDocument(); + var script = doc.getText(0, doc.getLength()); + var oldFile = engine.get(javax.script.ScriptEngine.FILENAME); + try { + if (engine == undefined) { + var m = new javax.script.ScriptEngineManager(); + engine = m.getEngineByName("nashorn"); + } + engine.put(javax.script.ScriptEngine.FILENAME, frame.title); + engine.eval(script, context); + } catch (e) { + error(e, "Script Error"); + e.printStackTrace(); + } finally { + engine.put(javax.script.ScriptEngine.FILENAME, oldFile); + } + } + + // "Examples" menu + + // show given script as new document + function showScript(title, str) { + actionNew(); + frame.setTitle("Example - " + title + titleSuffix); + var doc = editor.document; + doc.insertString(0, str, null); + } + + // "hello world" + function actionHello() { + showScript(actionEval.title, + "alert('Hello, world');"); + } + actionHello.title = "Hello, World"; + + // eval the "hello world"! + function actionEval() { + showScript(actionEval.title, + "eval(\"alert('Hello, world')\");"); + } + actionEval.title = "Eval"; + + // show how to access Java static methods + function actionJavaStatic() { + showScript(arguments.callee.title, + "// Just use Java syntax\n" + + "var props = java.lang.System.getProperties();\n" + + "alert(props.get('os.name'));"); + } + actionJavaStatic.title = "Java Static Calls"; + + // show how to access Java classes, methods + function actionJavaAccess() { + showScript(arguments.callee.title, + "// just use new JavaClass();\n" + + "var fr = new javax.swing.JFrame();\n" + + "// call all public methods as in Java\n" + + "fr.setTitle('hello');\n" + + "fr.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n" + + "fr.setSize(200, 200);\n" + + "fr.setVisible(true);"); + } + actionJavaAccess.title = "Java Object Access"; + + // show how to use Java bean conventions + function actionJavaBean() { + showScript(arguments.callee.title, + "var fr = new javax.swing.JFrame();\n" + + "fr.setSize(200, 200);\n" + + "// access public get/set methods as fields\n" + + "fr.defaultCloseOperation = javax.swing.WindowConstants.DISPOSE_ON_CLOSE;\n" + + "fr.title = 'hello';\n" + + "fr.visible = true;"); + } + actionJavaBean.title = "Java Beans"; + + // show how to implement Java interface + function actionJavaInterface() { + showScript(arguments.callee.title, + "// use Java anonymizer class-like syntax!\n" + + "var r = new java.lang.Runnable() {\n" + + " run: function() {\n" + + " alert('hello');\n" + + " }\n" + + " };\n" + + "// use the above Runnable to create a Thread\n" + + "new java.lang.Thread(r).start();\n" + + "// For simple one method interfaces, just pass script function\n" + + "new java.lang.Thread(function() { alert('world'); }).start();"); + } + actionJavaInterface.title = "Java Interfaces"; + + // show how to import Java classes, packages + function actionJavaImport() { + showScript(arguments.callee.title, + "// use Java-like import *...\n" + + "// importPackage(java.io);\n" + + "// or import a specific class\n" + + "// importClass(java.io.File);\n" + + "// or better - import just within a scope!\n" + + "var ioPkgs = JavaImporter(java.io);\n" + + "with (ioPkgs) { alert(new File('.').absolutePath); }"); + } + actionJavaImport.title = "Java Import"; + + // "Help" menu + + /* + * Shows a one liner help message for each + * global function. Note that this function + * depends on docString meta-data for each + * function. + */ + function actionHelpGlobals() { + var names = new java.util.ArrayList(); + for (var i in globalThis) { + var func = globalThis[i]; + if (typeof(func) == "function" && + ("docString" in func)) { + names.add(i); + } + } + java.util.Collections.sort(names); + var helpDoc = new java.lang.StringBuffer(); + helpDoc.append(""); + var itr = names.iterator(); + while (itr.hasNext()) { + var name = itr.next(); + helpDoc.append(""); + } + helpDoc.append("
      "); + helpDoc.append(name); + helpDoc.append(""); + helpDoc.append(globalThis[name].docString); + helpDoc.append("
      "); + + var helpEditor = new guiPkgs.JEditorPane(); + helpEditor.setContentType("text/html"); + helpEditor.setEditable(false); + helpEditor.setText(helpDoc.toString()); + + var scroller = new guiPkgs.JScrollPane(); + var port = scroller.getViewport(); + port.add(helpEditor); + + var helpFrame = new guiPkgs.JFrame("Help - Global Functions"); + helpFrame.getContentPane().add("Center", scroller); + helpFrame.setDefaultCloseOperation(guiPkgs.WindowConstants.DISPOSE_ON_CLOSE); + helpFrame.pack(); + helpFrame.setSize(500, 600); + helpFrame.setVisible(true); + } + + // show a simple about message for scriptpad + function actionAbout() { + alert("Scriptpad\nVersion 1.1", "Scriptpad"); + } + + /* + * This data is used to construct menu bar. + * This way adding a menu is easier. Just add + * top level menu or add an item to an existing + * menu. "action" should be a function that is + * called back on clicking the correponding menu. + */ + var menuData = [ + { + menu: "File", + items: [ + { name: "New", action: actionNew , accel: guiPkgs.KeyEvent.VK_N }, + { name: "Open...", action: actionOpen, accel: guiPkgs.KeyEvent.VK_O }, + { name: "Open URL...", action: actionOpenURL, accel: guiPkgs.KeyEvent.VK_U }, + { name: "Save", action: actionSave, accel: guiPkgs.KeyEvent.VK_S }, + { name: "Save As...", action: actionSaveAs }, + { name: "-" }, + { name: "Exit", action: actionExit, accel: guiPkgs.KeyEvent.VK_Q } + ] + }, + + { + menu: "Edit", + items: [ + { name: "Cut", action: actionCut, accel: guiPkgs.KeyEvent.VK_X }, + { name: "Copy", action: actionCopy, accel: guiPkgs.KeyEvent.VK_C }, + { name: "Paste", action: actionPaste, accel: guiPkgs.KeyEvent.VK_V }, + { name: "-" }, + { name: "Select All", action: actionSelectAll, accel: guiPkgs.KeyEvent.VK_A } + ] + }, + + { + menu: "Tools", + items: [ + { name: "Run", action: actionRun, accel: guiPkgs.KeyEvent.VK_R } + ] + }, + + { + menu: "Examples", + items: [ + { name: actionHello.title, action: actionHello }, + { name: actionEval.title, action: actionEval }, + { name: actionJavaStatic.title, action: actionJavaStatic }, + { name: actionJavaAccess.title, action: actionJavaAccess }, + { name: actionJavaBean.title, action: actionJavaBean }, + { name: actionJavaInterface.title, action: actionJavaInterface }, + { name: actionJavaImport.title, action: actionJavaImport } + ] + }, + + { + menu: "Help", + items: [ + { name: "Global Functions", action: actionHelpGlobals }, + { name: "-" }, + { name: "About Scriptpad", action: actionAbout } + ] + } + ]; + + function setMenuAccelerator(mi, accel) { + var keyStroke = guiPkgs.KeyStroke.getKeyStroke(accel, + guiPkgs.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false); + mi.setAccelerator(keyStroke); + } + + // create a menubar using the above menu data + function createMenubar() { + var mb = new guiPkgs.JMenuBar(); + for (var m in menuData) { + var items = menuData[m].items; + var menu = new guiPkgs.JMenu(menuData[m].menu); + + for (var i in items) { + if (items[i].name.equals("-")) { + menu.addSeparator(); + } else { + var mi = new guiPkgs.JMenuItem(items[i].name); + var action = items[i].action; + mi.addActionListener(action); + var accel = items[i].accel; + if (accel) { + setMenuAccelerator(mi, accel); + } + menu.add(mi); + } + } + + mb.add(menu); + } + + return mb; + } + + // function to add a new menu item under "Tools" menu + function addTool(menuItem, action, accel) { + if (typeof(action) != "function") { + return; + } + + var toolsIndex = -1; + // find the index of the "Tools" menu + for (var i in menuData) { + if (menuData[i].menu.equals("Tools")) { + toolsIndex = i; + break; + } + } + if (toolsIndex == -1) { + return; + } + var toolsMenu = frame.getJMenuBar().getMenu(toolsIndex); + var mi = new guiPkgs.JMenuItem(menuItem); + mi.addActionListener(action); + if (accel) { + setMenuAccelerator(mi, accel); + } + toolsMenu.add(mi); + } + + // create Scriptpad frame + function createFrame() { + frame = new guiPkgs.JFrame(); + frame.setTitle(defaultTitle); + frame.setBackground(guiPkgs.Color.lightGray); + frame.getContentPane().setLayout(new guiPkgs.BorderLayout()); + + // create notepad panel + var notepad = new guiPkgs.JPanel(); + notepad.setBorder(guiPkgs.BorderFactory.createEtchedBorder()); + notepad.setLayout(new guiPkgs.BorderLayout()); + + // create editor + editor = createEditor(); + var scroller = new guiPkgs.JScrollPane(); + var port = scroller.getViewport(); + port.add(editor); + + // add editor to notepad panel + var panel = new guiPkgs.JPanel(); + panel.setLayout(new guiPkgs.BorderLayout()); + panel.add("Center", scroller); + notepad.add("Center", panel); + + // add notepad panel to frame + frame.getContentPane().add("Center", notepad); + + // set menu bar to frame and show the frame + frame.setJMenuBar(createMenubar()); + frame.setDefaultCloseOperation(guiPkgs.JFrame.EXIT_ON_CLOSE); + frame.pack(); + frame.setSize(500, 600); + } + + // show Scriptpad frame + function showFrame() { + // set global variable by the name "window" + globalThis.window = frame; + + // open new document + actionNew(); + + frame.setVisible(true); + } + + // create and show Scriptpad frame + createFrame(); + showFrame(); + + /* + * Application object has two fields "frame", "editor" + * which are current JFrame and editor and a method + * called "addTool" to add new menu item to "Tools" menu. + */ + return { + frame: frame, + editor: editor, + addTool: addTool + }; +}; + +/* + * Call the main and store Application object + * in a global variable named "application". + */ +var application = main(); + +if (this.load == undefined) { + function load(file) { + var ioPkgs = new JavaImporter(java.io); + with (ioPkgs) { + var stream = new FileInputStream(file); + var bstream = new BufferedInputStream(stream); + var reader = new BufferedReader(new InputStreamReader(bstream)); + var oldFilename = engine.get(engine.FILENAME); + engine.put(engine.FILENAME, file); + try { + engine.eval(reader, context); + } finally { + engine.put(engine.FILENAME, oldFilename); + } + stream.close(); + } + } + load.docString = "loads the given script file"; +} + +/* + * Load user specific init file under home dir, if found. + */ +function loadUserInit() { + var home = java.lang.System.getProperty("user.home"); + var f = new java.io.File(home, "scriptpad.js"); + if (f.exists()) { + engine.eval(new java.io.FileReader(f)); + } +} + +loadUserInit(); diff --git a/runtime/sample/scripting/scriptpad/src/scripts/README.txt b/runtime/sample/scripting/scriptpad/src/scripts/README.txt new file mode 100644 index 0000000..72e162d --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/README.txt @@ -0,0 +1,52 @@ +Sample scripts: + +(1) browse.js + + -- Open and run this script in scriptpad. You will see + Tools->Browse menu. Using this you can start your + desktop default browser with the given URL. + +(2) insertfile.js + + -- Open and run this script in scriptpad. You will see + "Tools->Insert File..." menu. Using this you can start + insert content of a selected file into currently + edited document + +(3) linewrap.js + + -- Open and run this script in scriptpad. You will see + "Tools->Line Wrap" menu. Using this you can toggle + the line wrapping mode of the editor + +(4) mail.js + + -- Open and run this script in scriptpad. You will see + Tools->Mail menu. Using this you can start your + desktop default mail client with the given "To" mail id. + +(5) memmonitor.js + + -- This is a simple Monitoring & Management script. To use this, + you need an application to monitor. You can use memory.bat + or memory.sh in the current directory to start an application + that will be monitored. After that please follow these steps: + + 1. Start the target application using memory.sh or memory.bat + 2. Start scriptpad + 3. Use "Tools->JMX Connect" menu and specify "localhost:1090" + to connect + 4. Open "memmonitor.js" and run it (using "Tools->Run") + in scriptpad + 5. A new "Tools-Memory Monitor" menu appears. Use this menu + and specify 4 and 500 as threshold and interval values. + 6. In the target application shell (where memory.bat/.sh was + started), enter an integer value and press "enter". + 7. You'll see an alert box from scriptpad -- alerting you for + memory threshold exceeded! + +(6) textcolor.js + + -- Open and run this script in scriptpad. You will see + "Tools->Selected Text Color..." menu. Using this you + change the color of "selected text" in the editor. diff --git a/runtime/sample/scripting/scriptpad/src/scripts/browse.js b/runtime/sample/scripting/scriptpad/src/scripts/browse.js new file mode 100644 index 0000000..fbe50e1 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/browse.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This function uses new Swing Desktop API in JDK 6. + * To use this with scriptpad, open this in scriptpad + * and use "Tools->Run Script" menu. + */ +function browse() { + var desktop = null; + // Before more Desktop API is used, first check + // whether the API is supported by this particular + // virtual machine (VM) on this particular host. + if (java.awt.Desktop.isDesktopSupported()) { + desktop = java.awt.Desktop.getDesktop(); + } else { + alert("no desktop support"); + return; + } + + if (desktop.isSupported(java.awt.Desktop.Action.BROWSE)) { + var url = prompt("Address:"); + if (url != null) { + desktop.browse(new java.net.URI(url)); + } + } else { + alert("no browser support"); + } +} + +if (this.application != undefined) { + // add "Browse" menu item under "Tools" menu + this.application.addTool("Browse", browse); +} diff --git a/runtime/sample/scripting/scriptpad/src/scripts/insertfile.js b/runtime/sample/scripting/scriptpad/src/scripts/insertfile.js new file mode 100644 index 0000000..07a7ac2 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/insertfile.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script adds "Insert File" mode menu item to "Tools" menu. + * When selected, this menu shows a file dialog box and inserts + * contents of the selected file into current document (at the + * current caret position). + */ +if (this.application) { + application.addTool("Insert File...", + function() { + var file = fileDialog(); + + if (file) { + var reader = new java.io.FileReader(file); + var arr = java.lang.reflect.Array.newInstance( + java.lang.Character.TYPE, 8*1024); // 8K at a time + var buf = new java.lang.StringBuffer(); + var numChars; + + while ((numChars = reader.read(arr, 0, arr.length)) > 0) { + buf.append(arr, 0, numChars); + } + + var pos = application.editor.caretPosition; + var doc = application.editor.document; + + doc.insertString(pos, buf.toString(), null); + } + }); +} diff --git a/runtime/sample/scripting/scriptpad/src/scripts/linewrap.js b/runtime/sample/scripting/scriptpad/src/scripts/linewrap.js new file mode 100644 index 0000000..989473a --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/linewrap.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script adds "Line Wrap" mode menu item to "Tools" menu. + * When selected, this menu toggles the current word wrap mode + * of the editor. + */ + +function toggleLineWrap() { + var wrap = application.editor.lineWrap; + application.editor.lineWrap = !wrap; +} + +application.addTool("Line Wrap", toggleLineWrap); diff --git a/runtime/sample/scripting/scriptpad/src/scripts/mail.js b/runtime/sample/scripting/scriptpad/src/scripts/mail.js new file mode 100644 index 0000000..cabe5c4 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/mail.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This function uses new Swing Desktop API in JDK 6. + * To use this with scriptpad, open this in scriptpad + * and use "Tools->Run Script" menu. + */ +function mail() { + var desktop = null; + // Before more Desktop API is used, first check + // whether the API is supported by this particular + // virtual machine (VM) on this particular host. + if (java.awt.Desktop.isDesktopSupported()) { + desktop = java.awt.Desktop.getDesktop(); + } else { + alert("no desktop support"); + return; + } + + if (desktop.isSupported(java.awt.Desktop.Action.MAIL)) { + var mailTo = prompt("Mail To:"); + if (mailTo != null) { + desktop.mail(new java.net.URI("mailto", mailTo, null)); + } + } +} + +if (this.application != undefined) { + // add "Mail" menu item under "Tools" menu + this.application.addTool("Mail", mail); +} diff --git a/runtime/sample/scripting/scriptpad/src/scripts/memmonitor.js b/runtime/sample/scripting/scriptpad/src/scripts/memmonitor.js new file mode 100644 index 0000000..0744e30 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/memmonitor.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +// this checker function runs asynchronously +function memoryChecker(memoryBean, threshold, interval) { + while (true) { + var memUsage = memoryBean.HeapMemoryUsage; + var usage = memUsage.get("used") / (1024 * 1024); + + println("usage: " + usage); + + if (usage > threshold) { + alert("Hey! heap usage threshold exceeded!"); + // after first alert just return. + return; + } + + java.lang.Thread.sleep(interval); + } +} + +// add "Tools->Memory Monitor" menu item +if (this.application != undefined) { + this.application.addTool("Memory Monitor", + function () { + // show threshold box with default of 50 MB + var threshold = prompt("Threshold (mb)", 50); + + // show interval box with default of 1000 millisec. + var interval = prompt("Sample Interval (ms):", 1000); + var memoryBean = mbean("java.lang:type=Memory"); + + // ".future" makes the function to be called + // asynchronously in a separate thread. + memoryChecker.future(memoryBean, threshold, interval); + }); +} diff --git a/runtime/sample/scripting/scriptpad/src/scripts/memory.bat b/runtime/sample/scripting/scriptpad/src/scripts/memory.bat new file mode 100644 index 0000000..9478c09 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/memory.bat @@ -0,0 +1,35 @@ +@echo off +REM +REM Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. +REM +REM Redistribution and use in source and binary forms, with or without +REM modification, are permitted provided that the following conditions +REM are met: +REM +REM - Redistributions of source code must retain the above copyright +REM notice, this list of conditions and the following disclaimer. +REM +REM - Redistributions in binary form must reproduce the above copyright +REM notice, this list of conditions and the following disclaimer in the +REM documentation and/or other materials provided with the distribution. +REM +REM - Neither the name of Oracle nor the names of its +REM contributors may be used to endorse or promote products derived +REM from this software without specific prior written permission. +REM +REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +REM IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +REM THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +REM PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +REM CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +REM EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +REM PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +REM PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +REM LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +REM NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +REM + + +jrunscript -J-Dcom.sun.management.jmxremote.port=1090 -J-Dcom.sun.management.jmxremote.ssl=false -J-Dcom.sun.management.jmxremote.authenticate=false memory.js + diff --git a/runtime/sample/scripting/scriptpad/src/scripts/memory.js b/runtime/sample/scripting/scriptpad/src/scripts/memory.js new file mode 100644 index 0000000..b8252fb --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/memory.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script serves as a simple "monitored application". + * Start this script using memory.bat or memory.sh in the + * current directory. + */ + +java.lang.System.out.print("Enter a number and press enter:"); +var input = java.lang.System["in"].read(); + +// allocate an integer array of "big enough" size! +var a = java.lang.reflect.Array.newInstance( + java.lang.Integer.TYPE, input * 1024 * 1024); + +// sleep some time... +java.lang.Thread.sleep(10*60*1000); diff --git a/runtime/sample/scripting/scriptpad/src/scripts/memory.sh b/runtime/sample/scripting/scriptpad/src/scripts/memory.sh new file mode 100644 index 0000000..6a1ece6 --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/memory.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# - Neither the name of Oracle nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +jrunscript -J-Dcom.sun.management.jmxremote.port=1090 -J-Dcom.sun.management.jmxremote.ssl=false -J-Dcom.sun.management.jmxremote.authenticate=false memory.js diff --git a/runtime/sample/scripting/scriptpad/src/scripts/textcolor.js b/runtime/sample/scripting/scriptpad/src/scripts/textcolor.js new file mode 100644 index 0000000..b9d86cc --- /dev/null +++ b/runtime/sample/scripting/scriptpad/src/scripts/textcolor.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation and proper error handling, might not be present in + * this sample code. + */ + +/* + * This script adds "Selected Text Color" menu item to "Tools" menu. + * When selected, this menu changes the "selected text" color. + */ +if (this.application) { + application.addTool("Selected Text Color...", + function() { + var color = application.editor.selectedTextColor; + color = colorDialog("Selected Text Color", color); + application.editor.selectedTextColor = color; + }); +} diff --git a/runtime/sample/try-with-resources/index.html b/runtime/sample/try-with-resources/index.html new file mode 100644 index 0000000..27b2961 --- /dev/null +++ b/runtime/sample/try-with-resources/index.html @@ -0,0 +1,36 @@ + + + + + Try-with-Resources Feature Demo + + +

      Try-with-Resources Feature Demo

      + +

      + This demo shows how to use the try-with-resources feature introduced in JDK7. +

      + +
        +
      • Custom AutoCloseable.

        + +

        + Shows how to use a custom resource with the try-with-resources construct. + For more information, see the source file. +

        + Source: src/CustomAutoCloseableSample.java + +
      • Unzip

        + +

        + Extracts archived files. For more information, see the source file. +

        + Source: src/Unzip.java +
      • ZipCat

        + +

        Prints data about a specified file from an archive. For more information, see the source file.

        + Source: src/ZipCat.java + +
      + + \ No newline at end of file diff --git a/runtime/sample/try-with-resources/src/CustomAutoCloseableSample.java b/runtime/sample/try-with-resources/src/CustomAutoCloseableSample.java new file mode 100644 index 0000000..9bbe09a --- /dev/null +++ b/runtime/sample/try-with-resources/src/CustomAutoCloseableSample.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * This sample demonstrates the ability to create custom resource that + * implements the {@code AutoCloseable} interface. This resource can be used in + * the try-with-resources construct. + */ +public class CustomAutoCloseableSample { + + /** + * The main method for the CustomAutoCloseableSample program. + * + * @param args is not used. + */ + public static void main(String[] args) { + /* + * TeeStream will be closed automatically after the try block. + */ + try (TeeStream teeStream = new TeeStream(System.out, Paths.get("out.txt")); + PrintStream out = new PrintStream(teeStream)) { + out.print("Hello, world"); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + /** + * Passes the output through to the specified output stream while copying it into a file. + * The TeeStream functionality is similar to the Unix tee utility. + * TeeStream implements AutoCloseable interface. See OutputStream for details. + */ + public static class TeeStream extends OutputStream { + + private final OutputStream fileStream; + private final OutputStream outputStream; + + /** + * Creates a TeeStream. + * + * @param outputStream an output stream. + * @param outputFile an path to file. + * @throws IOException If an I/O error occurs. + */ + public TeeStream(OutputStream outputStream, Path outputFile) throws IOException { + this.fileStream = new BufferedOutputStream(Files.newOutputStream(outputFile)); + this.outputStream = outputStream; + } + + /** + * Writes the specified byte to the specified output stream + * and copies it to the file. + * + * @param b the byte to be written. + * @throws IOException If an I/O error occurs. + */ + @Override + public void write(int b) throws IOException { + fileStream.write(b); + outputStream.write(b); + } + + /** + * Flushes this output stream and forces any buffered output bytes + * to be written out. + * The flush method of TeeStream flushes + * the specified output stream and the file output stream. + * + * @throws IOException if an I/O error occurs. + */ + @Override + public void flush() throws IOException { + outputStream.flush(); + fileStream.flush(); + } + + /** + * Closes underlying streams and resources. + * The external output stream won't be closed. + * This method is the member of AutoCloseable interface and + * it will be invoked automatically after the try-with-resources block. + * + * @throws IOException If an I/O error occurs. + */ + @Override + public void close() throws IOException { + try (OutputStream file = fileStream) { + flush(); + } + } + } +} diff --git a/runtime/sample/try-with-resources/src/Unzip.java b/runtime/sample/try-with-resources/src/Unzip.java new file mode 100644 index 0000000..d75eba5 --- /dev/null +++ b/runtime/sample/try-with-resources/src/Unzip.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.*; + +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +/** + * Extract (unzip) a file to the current directory. + */ +public class Unzip { + + /** + * The main method for the Unzip program. Run the program with an empty + * argument list to see possible arguments. + * + * @param args the argument list for {@code Unzip}. + */ + public static void main(String[] args) { + if (args.length != 1) { + System.out.println("Usage: Unzip zipfile"); + } + final Path destDir = Paths.get("."); + /* + * Create AutoCloseable FileSystem. It will be closed automatically + * after the try block. + */ + try (FileSystem zipFileSystem = FileSystems.newFileSystem(Paths.get(args[0]), null)) { + + Path top = zipFileSystem.getPath("/"); + Files.walk(top).skip(1).forEach(file -> { + Path target = destDir.resolve(top.relativize(file).toString()); + System.out.println("Extracting " + target); + try { + Files.copy(file, target, REPLACE_EXISTING); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + } catch (UncheckedIOException | IOException e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/runtime/sample/try-with-resources/src/ZipCat.java b/runtime/sample/try-with-resources/src/ZipCat.java new file mode 100644 index 0000000..4bbf513 --- /dev/null +++ b/runtime/sample/try-with-resources/src/ZipCat.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This source code is provided to illustrate the usage of a given feature + * or technique and has been deliberately simplified. Additional steps + * required for a production-quality application, such as security checks, + * input validation, and proper error handling, might not be present in + * this sample code. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Prints data of the specified file to standard output from a zip archive. + */ +public class ZipCat { + + /** + * The main method for the ZipCat program. Run the program with an empty + * argument list to see possible arguments. + * + * @param args the argument list for ZipCat + */ + public static void main(String[] args) { + if (args.length != 2) { + System.out.println("Usage: ZipCat zipfile fileToPrint"); + } + /* + * Creates AutoCloseable FileSystem and BufferedReader. + * They will be closed automatically after the try block. + * If reader initialization fails, then zipFileSystem will be closed + * automatically. + */ + try (FileSystem zipFileSystem + = FileSystems.newFileSystem(Paths.get(args[0]),null); + InputStream input + = Files.newInputStream(zipFileSystem.getPath(args[1]))) { + byte[] buffer = new byte[1024]; + int len; + while ((len = input.read(buffer)) != -1) { + System.out.write(buffer, 0, len); + } + + } catch (IOException e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/runtime/src.zip b/runtime/src.zip new file mode 100644 index 0000000..8df3b00 Binary files /dev/null and b/runtime/src.zip differ diff --git a/src/main/java/GraphBuilder/GraphBuilder.java b/src/main/java/GraphBuilder/GraphBuilder.java new file mode 100644 index 0000000..1d56537 --- /dev/null +++ b/src/main/java/GraphBuilder/GraphBuilder.java @@ -0,0 +1,923 @@ +package GraphBuilder; + +import GraphBuilder.json_representations.JCell; +import GraphBuilder.json_representations.JPort; +import GraphBuilder.json_representations.JsonFile; +import GraphBuilder.json_representations.Module; +import MinecraftGraph.*; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.stream.JsonReader; +import minecrafthdl.MHDLException; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; + + +//main class +//json file->javaObject->Vertex->graph +public class GraphBuilder { + private static ArrayList ports_names=new ArrayList(); + private static ArrayList cells_names=new ArrayList(); + private static ArrayList ports=new ArrayList(); + private static ArrayList cells=new ArrayList(); + + private static ArrayList inputs=new ArrayList(); + private static ArrayList outputs=new ArrayList(); + private static ArrayList gates=new ArrayList(); + + static int test_i = 1; + + static int high_low_nets = Integer.MAX_VALUE; + static int cell_ids = 0; + static HashMap from_net = new HashMap(); + static HashMap> to_net = new HashMap>(); + + public static int putInToNet(int i, Vertex v, Graph g){ + ArrayList l = to_net.get(i); + + if (i == 0) { + high_low_nets--; + Function f = new Function(cell_ids++, FunctionType.LOW, 0); + from_net.put(high_low_nets, f); + to_net.put(high_low_nets, new ArrayList()); + to_net.get(high_low_nets).add(v); + g.addVertex(f); + return high_low_nets; + } else if (i == 1){ + high_low_nets--; + Function f = new Function(cell_ids++, FunctionType.HIGH, 0); + from_net.put(high_low_nets, f); + to_net.put(high_low_nets, new ArrayList()); + to_net.get(high_low_nets).add(v); + g.addVertex(f); + return high_low_nets; + } else { + if (l == null) to_net.put(i, new ArrayList()); + to_net.get(i).add(v); + return i; + } + + } + + public static int putInFromNet(int i, Vertex v){ + Vertex vr = from_net.get(i); + + if (vr != null) throw new MHDLException("TWO OUTPUTS ON SAME NET"); + from_net.put(i, v); + return i; + } + + public static Graph buildGraph(String path){ + high_low_nets = Integer.MAX_VALUE; + + Gson gson= new com.google.gson.Gson(); + JsonFile jf = null; + try { + FileReader fr = new FileReader(path); + JsonReader jreader = new JsonReader(fr); + jreader.setLenient(true); + jf = gson.fromJson(jreader, JsonFile.class); + fr.close(); + jreader.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + jf.postInit(); + + Graph g = new Graph(); + + Module m = jf.modules.values().iterator().next(); + + from_net = new HashMap(); + to_net = new HashMap>(); + + for (String p_name : m.ports.keySet()){ + JPort p = m.ports.get(p_name); + + In_output io; + + if (p.direction.equals("input")){ + + io = new In_output(p.bits.size(), VertexType.INPUT, p_name); + + for (int i : p.bits){ + putInFromNet(i, io); + } + + } else { + + io = new In_output(p.bits.size(), VertexType.OUTPUT, p_name); + + for (int i : p.bits){ + putInToNet(i, io, g); + } + + } + + g.addVertex(io); + } + + cell_ids = 0; + + for (String c_name : m.cells.keySet()){ + JCell c = m.cells.get(c_name); + + FunctionType f_type = resolveType(c.type); + + Function f; + + if (f_type == FunctionType.MUX){ + f = new MuxVertex(cell_ids++, f_type, c.numInputs()); + } else { + f = new Function(cell_ids++, f_type, c.numInputs()); + } + + for (String conn_name : c.connections.keySet()){ + String direction = c.port_directions.get(conn_name); + ArrayList conn_nets = c.connections.get(conn_name); + + int conn_net = -1; + + if (direction.equals("input")){ + for (int i : conn_nets){ + conn_net = putInToNet(i, f, g); + } + } else { + for (int i : conn_nets){ + conn_net = putInFromNet(i, f); + } + } + + if (f_type == FunctionType.MUX){ + if (conn_name.equals("S")){ + ((MuxVertex) f).s_net_num = conn_net; + } else if (conn_name.equals(("A"))) { + ((MuxVertex) f).a_net_num = conn_net; + } else if (conn_name.equals(("B"))) { + ((MuxVertex) f).b_net_num = conn_net; + } + } + } + + g.addVertex(f); + } + + for (int i : to_net.keySet()){ + for (Vertex v : to_net.get(i)){ + Vertex from = from_net.get(i); + if (from == null){ + throw new MHDLException("NET HAS NO FROM VERTEX"); + } + + if (v.type == VertexType.FUNCTION){ + Function f = ((Function) v); + if (((Function) v).func_type == FunctionType.MUX){ + MuxVertex mux = ((MuxVertex) f); + + if (i == mux.a_net_num){ + mux.a_vertex = from; + } else if (i == mux.b_net_num){ + mux.b_vertex = from; + } else if (i == mux.s_net_num){ + mux.s_vertex = from; + } + } + } + + g.addEdge(from, v); + } + } + + return g; + } + + + public static Graph buildxGraph(String path){ + + ArrayList ports_names=new ArrayList(); + ArrayList cells_names=new ArrayList(); + ArrayList ports=new ArrayList(); + ArrayList cells=new ArrayList(); + + ArrayList inputs=new ArrayList(); + ArrayList outputs=new ArrayList(); + ArrayList gates=new ArrayList(); + + test_i = 1; + System.out.println(test_i++); //1 + + + //create jsononjects + Gson gson= new com.google.gson.Gson(); + JsonFile jf = null; + try { + FileReader fr = new FileReader(path); + JsonReader jreader = new JsonReader(fr); + jreader.setLenient(true); + jf = gson.fromJson(jreader, JsonFile.class); + fr.close(); + jreader.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + System.out.println(test_i++); //2 + + + jf.postInit(); + + Module m = jf.modules.values().iterator().next(); + + if (m == null) return null; + + //read all ports names and create port objects + + for(String s: m.ports.keySet()){ + JPort p = m.ports.get(s); + Port port=new Port(s, p.direction, p.bits); + ports.add(port); + + + } + + System.out.println(test_i++); //3 + + + int j=1; //count to assign ids to gates + + for(String s: m.cells.keySet()){ + + JCell c = m.cells.get(s); + + ArrayList conn_list = new ArrayList(); + + for(JPort p : c.ports.values()){ + + conn_list.add(new Connection(p.direction, p.bits, p.name)); + + + + } + + + + Cell cell=new Cell(j, c.type, conn_list ); + + cells.add(cell); + j++; + } + + System.out.println(test_i++); //4 + + Graph graph=new Graph(); + + //add inputs to graph vertices + for(Port p: ports){ + if(p.direction.equals("input")){ + In_output in=new In_output(p.bits.size(), VertexType.INPUT, p.name); + inputs.add(in); + graph.addVertex(in); + } + else{ + outputs.add(new In_output(p.bits.size(), VertexType.OUTPUT, p.name)); + } + + + } + + System.out.println(test_i++); //5 + + + //add all cells + for(Cell c:cells){ + + Function v = null; + + FunctionType type = resolveType((c.type)); + if (type == FunctionType.MUX){ + Connection c_sel = c.getConn("S"); + + if (c_sel == null) { + throw new MHDLException("MUX MUST HAVE S INPUT"); + } + + v = new MuxVertex(c.id, type, c.inputs.size()); + } else { + v=new Function(c.id, resolveType(c.type), c.inputs.size()); + } + + gates.add(v); + graph.addVertex(v); + } + + System.out.println(test_i++); //6 + + + for(In_output v:outputs){ + graph.addVertex(v); + } + + System.out.println(test_i++); //7 + + + //resolve connections + for(Port port:ports){ + + for(Port toCom:ports){ + if(!port.equals(toCom)){ + int conn_count=areConnected(port.bits, toCom.bits); + if(port.direction.equals("input")&&toCom.direction.equals("output")&&conn_count>0){ + for(int h=0; h0){ + for(int h=0; h0){ + for(int h=0; h0){ + + for(int h=0; h0) + graph.addEdge(getVertex(graph, cell), getVertex(graph, c)); + } + + } + + } + + + System.out.println(test_i++); //9 + + optimizeGraph(graph); + System.out.println(test_i++); //10 + + return graph; + } + +// public static Graph buildxGraph(String path){ +// +// File file=new File(path); +// //Three string builder for the three json blocks: cells, ports, netnames +// StringBuilder sb1=new StringBuilder(); +// StringBuilder sb2=new StringBuilder(); +// StringBuilder sb3=new StringBuilder(); +// +// FileReader reader; +// BufferedReader b_r; +// +// String portsBlock=""; +// String cellsBlock=""; +// String netnamesBlock=""; +// +// String pattern = "[:{\"\\s]"; +// +// try { +// reader = new FileReader(file); +// b_r=new BufferedReader(reader); +// +// //skip first four lines +// b_r.readLine(); +// b_r.readLine(); +// b_r.readLine(); +// b_r.readLine(); +// +// int port_braces=1; +// String line=b_r.readLine(); +// +// sb1.append("{"); +// +// while(port_braces!=0){ +// sb1.append(line); +// line=b_r.readLine(); +// +// if(line.contains("{")){ +// ports_names.add(line.replaceAll(pattern, "")); +// port_braces++; +// } +// else if (line.contains("}")){port_braces--;} +// } +// sb1.append("}"); +// sb1.append("}"); +// portsBlock=sb1.toString(); +// +// //read gates block in the json file +// int cells_braces=1; +// line=b_r.readLine(); +// sb2.append("{"); +// +// while(cells_braces!= 0){ +// +// sb2.append(line); +// line=b_r.readLine(); +// +// if(line.contains("{")){ +// cells_braces++; +// if(cells_braces==2){ +// cells_names.add(line.replace(": {", "").replaceAll("[\"\\s]", "")); +// } +// } +// else if (line.contains("}")){cells_braces--;} +// +// +// +// } +// +// sb2.append("}"); +// sb2.append("}"); +// cellsBlock=sb2.toString(); +// +// +// +// }catch (FileNotFoundException e) { +// e.printStackTrace(); +// } catch (IOException f) { +// f.printStackTrace(); +// } +// +// //create jsononjects +// Gson gson= new com.google.gson.Gson(); +// System.out.println(portsBlock); +// +// JsonObject ports_obj=gson.fromJson(portsBlock, JsonElement.class).getAsJsonObject().get("ports").getAsJsonObject(); +// +// +// +// //read all ports names and create port objects +// +// for(String s: ports_names){ +// JsonObject js=ports_obj.get(s).getAsJsonObject(); +// Port port=new Port(s, js.get("direction").getAsString(), js.get("bits").getAsJsonArray()); +// ports.add(port); +// +// +// } +// +// JsonObject cells_obj=gson.fromJson(cellsBlock, JsonElement.class).getAsJsonObject().get("cells").getAsJsonObject(); +// +// +// int j=1; //count to assign ids to gates +// +// for(String c: cells_names){ +// +// JsonObject js_c=cells_obj.get(c).getAsJsonObject(); +// JsonObject param_obj=js_c.get("parameters").getAsJsonObject(); +// JsonObject conn_obj=js_c.get("connections").getAsJsonObject(); +// JsonObject dir_obj=js_c.get("port_directions").getAsJsonObject(); +// +// +// String[] param=param_obj.toString().replaceAll("[{]", "").split(","); +// String[] port_dir=conn_obj.toString().replaceAll("[{]", "").split(","); +// String[] conn=dir_obj.toString().replaceAll("[{]", "").split(","); +// ArrayList conn_list=new ArrayList<>(); +// +// for(int k=0; k0){ +// for(int h=0; h0){ +// for(int h=0; h0){ +// for(int h=0; h0){ +// +// for(int h=0; h0) +// graph.addEdge(getVertex(graph, cell), getVertex(graph, c)); +// } +// +// } +// +// } +// +// optimizeGraph(graph); +// return graph; +// } +// + private static void optimizeGraph(Graph graph){ + //iterate through all the nodes of the graph + //if or or and gate check outputs + //if all outputs are of the same type + //remove lower level and reconnect its inputs with the higher level + //got back + ArrayList verToRemove=new ArrayList(); + for(Vertex v: graph.getVertices()){ + System.out.println("vertex for"); + + //check if vertex is a gate + if(v.getType()==VertexType.FUNCTION){ + //check if gate type is and, or + Function f=(Function)v; + + FunctionType f_t=f.getFunc_Type(); + if(f_t==FunctionType.AND||f_t==FunctionType.OR){ + if(canMerge(f)){ + for(Vertex s:f.getNext()){ + System.out.println("vertex inner for"); + + graph.mergeVertices(f, s); + verToRemove.add(f); + } + + } + + } + } + + } + + for(Vertex t:verToRemove){ + System.out.println("vertex inner 2 for"); + + graph.removeVertex(t); + } + } + + private static boolean canMerge(Function v){ + for(Vertex x:v.getNext()){ + if(x.getType()!=VertexType.FUNCTION){ + return false; + + } + Function f=(Function)x; + if(f.getFunc_Type()!=v.getFunc_Type()){ + return false; + } + } + + return true; + + } + + + //getting vertices + + private static Vertex getVertex(Graph g, Port p){ + + for(Vertex v:g.getVertices()){ + + if(v.getID().equals(p.name)){ + return v; + } + + } + return null; + + } + + private static Vertex getVertex(Graph g, Cell p){ + + for(Vertex v:g.getVertices()){ + + if(v.getID().equals(String.valueOf(p.id))){ + return v; + } + + } + return null; + + } + + //checks if signals, gates are connected + private static int areConnected(ArrayList bits, ArrayList inputs2){ + + int count=0; + + for(Integer x: bits){ + for(Integer y: inputs2){ + if(x==y){ + count++; + } + + } + + } + return count; + + + } + + + + + private static int num_of_inputs(JsonObject j_o){ + int num=0; + char[] connection=j_o.get("connections").toString().toCharArray(); + for(char c: connection){ + if(c==':') num++; + } + return num-1; + } + + + + + private static FunctionType resolveType(String type){ + + //make sure that all string included + + if(type.contains("and")||type.contains("AND")){ + return FunctionType.AND; + + }else if(type.contains("MUX")||type.contains("mux")){ + return FunctionType.MUX; + }else if(type.contains("XOR")||type.contains("xor")){ + return FunctionType.XOR; + + }else if(type.contains("or")||type.contains("OR")){ + return FunctionType.OR; + + }else if(type.contains("dlatch_p")||type.contains("DLATCH_P")) { + return FunctionType.D_LATCH; + + }else if(type.contains("not")||type.contains("NOT")){ + return FunctionType.INV; + + }else{ + throw new MHDLException("Unknown Cell:" + type); + } + + + + } + +} + + + class Port{ + String name; + String direction; + ArrayList bits=new ArrayList(); + + public Port(String n, String d, ArrayList b){ + name=n; + direction=d; + bits=b; + } + + } + + class Cell{ + int id; + String type; + ArrayList connections=new ArrayList(); + + ArrayList inputs=new ArrayList(); + ArrayList outputs=new ArrayList(); + + public Cell(int i, String t, ArrayList cns){ + id=i; + type=t; + connections=cns; + + + for(Connection c:connections){ + if(c.direction.equals("input")){ + for(int j=0; j arr, String name){ + this.name = name; + direction=d; + IDs= new int[arr.size()]; + for(int j=0; j bits=new ArrayList<>(); +// +// public Port(String n, String d, JsonArray b){ +// name=n; +// direction=d; +// +// +// for(int i=0; i connections=new ArrayList<>(); +// +// ArrayList inputs=new ArrayList(); +// ArrayList outputs=new ArrayList<>(); +// +// public Cell(int i, String t, ArrayList cns){ +// id=i; +// type=t; +// connections=cns; +// +// +// for(Connection c:connections){ +// if(c.direction.equals("input")){ +// for(int j=0; j port_directions; + public HashMap> connections; + + public HashMap ports = new HashMap(); + + @Override + public ArrayList getNets() { + return null; + } + + public void posInit(){ + for (String p : port_directions.keySet()){ + ports.put(p, new JPort(p, port_directions.get(p), connections.get(p))); + } + + + } + + public int numInputs(){ + int conns = 0; + for (String dir: port_directions.values()){ + if (dir.equals("input")) conns += 1; + } + return conns; + } + + public void print(int tabs) { + System.out.println(JsonFile.tabs(tabs) + "type: " + type); + System.out.println(JsonFile.tabs(tabs) + "Ports: " + type); + + for (String p : ports.keySet()){ + System.out.println(JsonFile.tabs(tabs + 1) + p); + ports.get(p).print(tabs + 1); + } + } +} diff --git a/src/main/java/GraphBuilder/json_representations/JPort.java b/src/main/java/GraphBuilder/json_representations/JPort.java new file mode 100644 index 0000000..1e57902 --- /dev/null +++ b/src/main/java/GraphBuilder/json_representations/JPort.java @@ -0,0 +1,35 @@ +package GraphBuilder.json_representations; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 4/3/2017 - 19:39 + */ + +public class JPort extends Node { + public String name; + public String direction; + public ArrayList bits; + + public JPort(String name, String direction, ArrayList bits) { + this.name = name; + this.direction = direction; + this.bits = bits; + } + + @Override + public ArrayList getNets() { + return null; + } + + public void print(int tabs) { + System.out.println(JsonFile.tabs(tabs) + "direction: " + direction); + System.out.println(JsonFile.tabs(tabs) + "bits:"); + for(int i : bits){ + System.out.println(JsonFile.tabs(tabs + 1) + i); + + } + + } + +} diff --git a/src/main/java/GraphBuilder/json_representations/JsonFile.java b/src/main/java/GraphBuilder/json_representations/JsonFile.java new file mode 100644 index 0000000..665b381 --- /dev/null +++ b/src/main/java/GraphBuilder/json_representations/JsonFile.java @@ -0,0 +1,32 @@ +package GraphBuilder.json_representations; + +import java.util.HashMap; + +/** + * Created by Francis O'Brien - 4/3/2017 - 19:41 + */ + +public class JsonFile { + + public HashMap modules; + + public void print(){ + for (Module m : modules.values()){ + m.print(); + } + } + + public static String tabs(int tabs) { + String str = ""; + for (int i = 0; i < tabs; i++){ + str += "\t"; + } + return str; + } + + public void postInit(){ + for (Module m : modules.values()){ + m.postInit(); + } + } +} diff --git a/src/main/java/GraphBuilder/json_representations/JsonParseTest.java b/src/main/java/GraphBuilder/json_representations/JsonParseTest.java new file mode 100644 index 0000000..4b8f531 --- /dev/null +++ b/src/main/java/GraphBuilder/json_representations/JsonParseTest.java @@ -0,0 +1,24 @@ +package GraphBuilder.json_representations; + +/** + * Created by Francis O'Brien - 4/3/2017 - 19:48 + */ + +public class JsonParseTest { + + public static void main(String[] args) { +// try { +// +// Gson gson = new Gson(); +// JsonReader reader = new JsonReader(new FileReader("./run/verilog_designs/adder.json")); +// JsonFile jf = gson.fromJson(reader, JsonFile.class); +// jf.postInit(); +// jf.print(); +// +// } catch (FileNotFoundException e) { +// e.printStackTrace(); +// } + GraphBuilder.GraphBuilder.buildGraph("./run/verilog_designs/test.json").print(); + } + +} diff --git a/src/main/java/GraphBuilder/json_representations/Module.java b/src/main/java/GraphBuilder/json_representations/Module.java new file mode 100644 index 0000000..457c1b4 --- /dev/null +++ b/src/main/java/GraphBuilder/json_representations/Module.java @@ -0,0 +1,31 @@ +package GraphBuilder.json_representations; + +import java.util.HashMap; + +/** + * Created by Francis O'Brien - 4/3/2017 - 19:47 + */ + +public class Module { + + public HashMap ports; + public HashMap cells; + + public void print() { + System.out.println("PORTS:"); + for (String p : ports.keySet()){ + System.out.println("\t" + p); + ports.get(p).print(2); + } + + System.out.println("Cells:"); + for (String c : cells.keySet()){ + System.out.println("\t" + c); + cells.get(c).print(2); + } + } + + public void postInit(){ + for (JCell c : cells.values()) c.posInit(); + } +} diff --git a/src/main/java/GraphBuilder/json_representations/Node.java b/src/main/java/GraphBuilder/json_representations/Node.java new file mode 100644 index 0000000..3455457 --- /dev/null +++ b/src/main/java/GraphBuilder/json_representations/Node.java @@ -0,0 +1,14 @@ +package GraphBuilder.json_representations; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 4/3/2017 - 19:39 + */ + +abstract public class Node { + + abstract public ArrayList getNets(); + + +} diff --git a/src/main/java/MinecraftGraph/Function.java b/src/main/java/MinecraftGraph/Function.java new file mode 100644 index 0000000..d1558b8 --- /dev/null +++ b/src/main/java/MinecraftGraph/Function.java @@ -0,0 +1,42 @@ +package MinecraftGraph; + +public class Function extends Vertex { + public FunctionType func_type; + protected int id; + + public Function(int i, FunctionType f_t, int x){ + + super.type=VertexType.FUNCTION; + super.bits_n=x; + id=i; + this.func_type=f_t; + } + + + public FunctionType getFunc_Type(){ + return this.func_type; + + } + + + + @Override + public void addToNext(Vertex v){ + super.addToNext(v); + } + + @Override + public void addToBefore(Vertex v){ + super.addToBefore(v); + } + + @Override + public String getID(){ + return String.valueOf(id); + + } + + public int get_num_inputs() { + return this.bits_n; + } +} diff --git a/src/main/java/MinecraftGraph/FunctionType.java b/src/main/java/MinecraftGraph/FunctionType.java new file mode 100644 index 0000000..d6437d3 --- /dev/null +++ b/src/main/java/MinecraftGraph/FunctionType.java @@ -0,0 +1,5 @@ +package MinecraftGraph; + +public enum FunctionType { + OR,XOR, AND, INV, MUX, RELAY, IO, HIGH, LOW, D_LATCH, Input, Output; +} diff --git a/src/main/java/MinecraftGraph/Graph.java b/src/main/java/MinecraftGraph/Graph.java new file mode 100644 index 0000000..c50599a --- /dev/null +++ b/src/main/java/MinecraftGraph/Graph.java @@ -0,0 +1,81 @@ +package MinecraftGraph; + +import java.util.ArrayList; + +public class Graph { + + //only input vertices + private ArrayList vertices; + + public Graph(){ + vertices=new ArrayList(); + } + + + public void addVertex(Vertex v){ + vertices.add(v); + } + + + public void addEdge(Vertex v1, Vertex v2){ + + if (v2.type == VertexType.FUNCTION){ + Function f = (Function) v2; + if (f.func_type == FunctionType.MUX){ + MuxVertex m = (MuxVertex) f; + + } + } + + v1.addToNext(v2); + v2.addToBefore(v1); + + + } + + + public void removeEdge(Vertex v1, Vertex v2){ + v1.removeNext(v2); + v2.removeBefore(v1); + } + + public void removeVertex(Vertex v){ + //remove v from all neighbors + + for(Vertex ver: vertices){ + ver.removeNext(v); + ver.removeBefore(v); + } + //remove v from vertices list + vertices.remove(v); + + } + + //This function takes the inputs to the first vertex v1 and adds them to v2 + public void mergeVertices(Vertex v1, Vertex v2){ + + + //v1 is to be merged(source) + for(Vertex v: v1.getBefore()){ + v2.addToBefore(v); + v.addToNext(v2); + } + + + + } + + public ArrayList getVertices(){ + + return vertices; + + } + + public void print(){ + System.out.println(this.vertices.size()); + + for (Vertex v : this.vertices){ + v.print(); + } + } +} diff --git a/src/main/java/MinecraftGraph/In_output.java b/src/main/java/MinecraftGraph/In_output.java new file mode 100644 index 0000000..c31c2bf --- /dev/null +++ b/src/main/java/MinecraftGraph/In_output.java @@ -0,0 +1,21 @@ +package MinecraftGraph; + +public class In_output extends Vertex{ + private String name; + + public In_output(int num, VertexType v_t, String n){ + + super.bits_n=num; + super.type=v_t; + this.name=n; + + } + + @Override + public String getID(){ + return name; + + } + + +} diff --git a/src/main/java/MinecraftGraph/MuxVertex.java b/src/main/java/MinecraftGraph/MuxVertex.java new file mode 100644 index 0000000..da96680 --- /dev/null +++ b/src/main/java/MinecraftGraph/MuxVertex.java @@ -0,0 +1,28 @@ +package MinecraftGraph; + +/** + * Created by Francis O'Brien - 4/4/2017 - 17:12 + */ + +public class MuxVertex extends Function { + + public Vertex s_vertex, a_vertex, b_vertex; + public int s_net_num, a_net_num, b_net_num = -1; //a (s = 0); b (s = 1) + + public MuxVertex(int i, FunctionType f_t, int x) { + super(i, f_t, x); + } + + @Override + public String getID() { + return String.valueOf(id); + } + + @Override + public void handleRelay(Vertex v, Vertex relay) { + super.handleRelay(v, relay); + if (v == a_vertex) this.a_vertex = relay; + else if (v == b_vertex) this.b_vertex = relay; + else if (v == s_vertex) this.s_vertex = relay; + } +} diff --git a/src/main/java/MinecraftGraph/Vertex.java b/src/main/java/MinecraftGraph/Vertex.java new file mode 100644 index 0000000..6351dc6 --- /dev/null +++ b/src/main/java/MinecraftGraph/Vertex.java @@ -0,0 +1,77 @@ +package MinecraftGraph; + +import java.util.ArrayList; + +public abstract class Vertex { + + public VertexType type; + protected int bits_n; + private int counter=0; + private ArrayList next=new ArrayList(); + private ArrayList before=new ArrayList(); + + + + + public VertexType getType(){ + return this.type; + } + + public boolean canAdd(){ + if(bits_n==counter){ + return false; + } + else{ + return true; + } + } + + + public abstract String getID(); + + + + public void addToNext(Vertex v){ + counter++; + this.next.add(v); + } + public ArrayList getNext(){ + return this.next; + } + + public void removeNext(Vertex v){ + next.remove(v); + } + + public void addToBefore(Vertex v){ + this.before.add(v); + } + public ArrayList getBefore(){ + return this.before; + } + + public void removeBefore(Vertex v){ + before.remove(v); + } + + + public void print(){ + if (this.type == VertexType.FUNCTION){ + System.out.println(((Function) this).func_type); + } else { + System.out.println(this.type); + } + + for (Vertex v : this.next){ + if (v.type == VertexType.FUNCTION){ + System.out.println("\t:" + ((Function) v).func_type); + } else { + System.out.println("\t" + v.type); + } + } + }; + + public void handleRelay(Vertex v, Vertex relay) { + + } +} diff --git a/src/main/java/MinecraftGraph/VertexType.java b/src/main/java/MinecraftGraph/VertexType.java new file mode 100644 index 0000000..8e56a0d --- /dev/null +++ b/src/main/java/MinecraftGraph/VertexType.java @@ -0,0 +1,5 @@ +package MinecraftGraph; + +public enum VertexType { + INPUT, OUTPUT, FUNCTION; +} diff --git a/src/main/java/minecrafthdl/ClientProxy.java b/src/main/java/minecrafthdl/ClientProxy.java new file mode 100644 index 0000000..e56275b --- /dev/null +++ b/src/main/java/minecrafthdl/ClientProxy.java @@ -0,0 +1,29 @@ +package minecrafthdl; + +import minecrafthdl.client.render.blocks.BlockRenderRegister; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +/** + * Created by Francis on 10/5/2016. + */ +public class ClientProxy extends CommonProxy { + + @Override + public void preInit(FMLPreInitializationEvent e) { + super.preInit(e); + } + + @Override + public void init(FMLInitializationEvent e) { + super.init(e); + BlockRenderRegister.registerBlockRenderer(); + } + + @Override + public void postInit(FMLPostInitializationEvent e) { + super.postInit(e); + } + +} diff --git a/src/main/java/minecrafthdl/CommonProxy.java b/src/main/java/minecrafthdl/CommonProxy.java new file mode 100644 index 0000000..f20f0ab --- /dev/null +++ b/src/main/java/minecrafthdl/CommonProxy.java @@ -0,0 +1,26 @@ +package minecrafthdl; + +import minecrafthdl.block.ModBlocks; +import minecrafthdl.gui.MinecraftHDLGuiHandler; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.network.NetworkRegistry; + +/** + * Created by Francis on 10/5/2016. + */ +public class CommonProxy { + + public void preInit(FMLPreInitializationEvent e) { + ModBlocks.createBlocks(); + } + + public void init(FMLInitializationEvent e) { + NetworkRegistry.INSTANCE.registerGuiHandler(MinecraftHDL.instance, new MinecraftHDLGuiHandler()); + } + + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/minecrafthdl/Demo.java b/src/main/java/minecrafthdl/Demo.java new file mode 100644 index 0000000..b9026bc --- /dev/null +++ b/src/main/java/minecrafthdl/Demo.java @@ -0,0 +1,82 @@ +package minecrafthdl; + +import MinecraftGraph.*; + +/** + * Created by Francis on 11/27/2016. + */ +public class Demo { + + public static Graph create4bitmuxgraph(){ + Graph mux = new Graph(); + + + + Vertex i = new In_output(1, VertexType.INPUT, "i"); + Vertex j = new In_output(1, VertexType.INPUT, "j"); + + mux.addVertex(i); + mux.addVertex(j); + + Vertex not_1 = new Function(1, FunctionType.INV, 1); + Vertex not_2 = new Function(1, FunctionType.INV, 1); + + mux.addVertex(not_1); + mux.addVertex(not_2); + + Vertex a = new In_output(1, VertexType.INPUT, "a"); + Vertex b = new In_output(1, VertexType.INPUT, "b"); + Vertex c = new In_output(1, VertexType.INPUT, "c"); + Vertex d = new In_output(1, VertexType.INPUT, "d"); + + mux.addVertex(a); + mux.addVertex(b); + mux.addVertex(c); + mux.addVertex(d); + + Vertex and_1 = new Function(1, FunctionType.AND, 3); + Vertex and_2 = new Function(1, FunctionType.AND, 3); + Vertex and_3 = new Function(1, FunctionType.AND, 3); + Vertex and_4 = new Function(1, FunctionType.AND, 3); + Vertex or_1 = new Function(1, FunctionType.OR, 4); + + mux.addVertex(and_1); + mux.addVertex(and_2); + mux.addVertex(and_3); + mux.addVertex(and_4); + mux.addVertex(or_1); + + Vertex o = new In_output(1, VertexType.OUTPUT, "o"); + + mux.addVertex(o); + + + mux.addEdge(i, not_1); + mux.addEdge(j, not_2); + + mux.addEdge(i, and_2); + mux.addEdge(i, and_4); + mux.addEdge(not_1, and_1); + mux.addEdge(not_1, and_3); + + mux.addEdge(j, and_3); + mux.addEdge(j, and_4); + mux.addEdge(not_2, and_1); + mux.addEdge(not_2, and_2); + + mux.addEdge(a, and_1); + mux.addEdge(b, and_2); + mux.addEdge(c, and_3); + mux.addEdge(d, and_4); + + mux.addEdge(and_1, or_1); + mux.addEdge(and_2, or_1); + mux.addEdge(and_3, or_1); + mux.addEdge(and_4, or_1); + + mux.addEdge(or_1, o); + + return mux; + } + +} diff --git a/src/main/java/minecrafthdl/MHDLException.java b/src/main/java/minecrafthdl/MHDLException.java new file mode 100644 index 0000000..b6895ba --- /dev/null +++ b/src/main/java/minecrafthdl/MHDLException.java @@ -0,0 +1,9 @@ +package minecrafthdl; + +public class MHDLException extends RuntimeException { + + public MHDLException(String message){ + super(message); + } + +} diff --git a/src/main/java/minecrafthdl/MinecraftHDL.java b/src/main/java/minecrafthdl/MinecraftHDL.java new file mode 100644 index 0000000..0c745b4 --- /dev/null +++ b/src/main/java/minecrafthdl/MinecraftHDL.java @@ -0,0 +1,52 @@ +package minecrafthdl; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; + +@Mod(modid = MinecraftHDL.MODID, name = MinecraftHDL.MODNAME, version = MinecraftHDL.VERSION) +public class MinecraftHDL +{ + public static final String MODID = "minecrafthdl"; + public static final String MODNAME = "Minecraft HDL"; + public static final String VERSION = "1.0"; + + @SidedProxy(clientSide="minecrafthdl.ClientProxy", serverSide="minecrafthdl.ServerProxy") + public static CommonProxy proxy; + + @Mod.Instance + public static MinecraftHDL instance = new MinecraftHDL(); + + @EventHandler + public void preInit(FMLPreInitializationEvent e) { + proxy.preInit(e); + } + + @EventHandler + public void init(FMLInitializationEvent e) + { + proxy.init(e); + // some example code + MinecraftForge.EVENT_BUS.register(this); + + } + + @EventHandler + public void postInit(FMLPostInitializationEvent e) { + proxy.postInit(e); + } + +// @SubscribeEvent +// public void onPlayerTick(TickEvent.PlayerTickEvent tick) +// { +// FMLLog.getLogger().log(Level.INFO, "Player Tick"); +// } +} diff --git a/src/main/java/minecrafthdl/ServerProxy.java b/src/main/java/minecrafthdl/ServerProxy.java new file mode 100644 index 0000000..83dae9d --- /dev/null +++ b/src/main/java/minecrafthdl/ServerProxy.java @@ -0,0 +1,27 @@ +package minecrafthdl; + +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +/** + * Created by Francis on 10/5/2016. + */ +public class ServerProxy extends CommonProxy { + + @Override + public void preInit(FMLPreInitializationEvent e) { + super.preInit(e); + } + + @Override + public void init(FMLInitializationEvent e) { + super.init(e); + } + + @Override + public void postInit(FMLPostInitializationEvent e) { + super.postInit(e); + } + +} diff --git a/src/main/java/minecrafthdl/Utils.java b/src/main/java/minecrafthdl/Utils.java new file mode 100644 index 0000000..0e6655a --- /dev/null +++ b/src/main/java/minecrafthdl/Utils.java @@ -0,0 +1,46 @@ +package minecrafthdl; + +import minecrafthdl.synthesis.CircuitTest; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.client.Minecraft; + +/** + * Created by Francis on 10/28/2016. + */ +public class Utils { + + public static IProperty getPropertyByName(Block block, String name){ + for (IProperty prop : block.getBlockState().getProperties()){ + if (prop.getName().equals(name)){ + return prop; + } + } + return null; + } + + public static void printProperties(Block block){ + for (IProperty prop : block.getBlockState().getProperties()){ + System.out.println(prop.getName()); + System.out.println(prop.getAllowedValues()); + + } + } + + public static void printCircuit(CircuitTest circuit){ + for (int y = 0; y < circuit.getSizeY(); y++) { + for (int x = 0; x < circuit.getSizeX(); x++) { + for (int z = 0; z < circuit.getSizeZ(); z++) { + System.out.print(circuit.getState(x, y, z)); + } + System.out.print("\n"); + } + System.out.print("\n\n"); + } + } + + public static void print (String msg) { + Minecraft.getMinecraft().thePlayer.sendChatMessage(msg); + } + +} diff --git a/src/main/java/minecrafthdl/block/BasicBlock.java b/src/main/java/minecrafthdl/block/BasicBlock.java new file mode 100644 index 0000000..ad584f1 --- /dev/null +++ b/src/main/java/minecrafthdl/block/BasicBlock.java @@ -0,0 +1,28 @@ +package minecrafthdl.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +/** + * Created by Francis on 10/5/2016. + */ +public class BasicBlock extends Block { + + public BasicBlock(String unlocalizedName, Material material, float hardness, float resistance) { + super(material); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(CreativeTabs.MISC); + this.setHardness(hardness); + this.setResistance(resistance); + } + + public BasicBlock(String unlocalizedName, float hardness, float resistance) { + this(unlocalizedName, Material.ROCK, hardness, resistance); + } + + public BasicBlock(String unlocalizedName) { + this(unlocalizedName, 2.0f, 10.0f); + } + +} diff --git a/src/main/java/minecrafthdl/block/ModBlocks.java b/src/main/java/minecrafthdl/block/ModBlocks.java new file mode 100644 index 0000000..e6e928a --- /dev/null +++ b/src/main/java/minecrafthdl/block/ModBlocks.java @@ -0,0 +1,17 @@ +package minecrafthdl.block; + +import minecrafthdl.block.blocks.Synthesizer; +import net.minecraft.block.Block; +import net.minecraftforge.fml.common.registry.GameRegistry; + +/** + * Created by Francis on 10/5/2016. + */ +public final class ModBlocks { + + public static Block synthesizer; + + public static void createBlocks() { + GameRegistry.registerBlock(synthesizer = new Synthesizer("synthesizer"), "synthesizer"); + } +} diff --git a/src/main/java/minecrafthdl/block/blocks/Synthesizer.java b/src/main/java/minecrafthdl/block/blocks/Synthesizer.java new file mode 100644 index 0000000..2b55af0 --- /dev/null +++ b/src/main/java/minecrafthdl/block/blocks/Synthesizer.java @@ -0,0 +1,151 @@ +package minecrafthdl.block.blocks; + +import GraphBuilder.GraphBuilder; +import minecrafthdl.MHDLException; +import minecrafthdl.MinecraftHDL; +import minecrafthdl.block.BasicBlock; +import minecrafthdl.gui.MinecraftHDLGuiHandler; +import minecrafthdl.synthesis.Circuit; +import minecrafthdl.synthesis.IntermediateCircuit; +import minecrafthdl.synthesis.LogicGates; +import net.minecraft.block.Block; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import org.lwjgl.Sys; +import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.Random; + +/** + * Created by Francis on 10/28/2016. + */ +public class Synthesizer extends BasicBlock { + + public static String file_to_gen; + public static int check_threshold = 100; + + public static final PropertyBool TRIGGERED = PropertyBool.create("triggered"); + + private int check_counter = 0; + private boolean to_check = false; + private Circuit c_check = null; + private BlockPos p_check = null; + + public Synthesizer(String unlocalizedName) { + super(unlocalizedName); + this.setDefaultState(this.blockState.getBaseState().withProperty(TRIGGERED, false)); + this.setTickRandomly(true); + System.out.println("hello"); + } + + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ){ + if (worldIn.isRemote){ + playerIn.openGui(MinecraftHDL.instance, MinecraftHDLGuiHandler.SYNTHESISER_GUI_ID, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ); + } + + return true; + } + + @SuppressWarnings("deprecation") + @Override + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { + if(!worldIn.isRemote) { + if(!state.getValue(TRIGGERED)){ + if (worldIn.getRedstonePower(pos.north(), EnumFacing.NORTH) > 0) { + //Negative Z is receiving power + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, true)); + + if (Synthesizer.file_to_gen != null){ + synth_gen(worldIn, pos); + + } + }else if (worldIn.getRedstonePower(pos.east(), EnumFacing.EAST) > 0) { + //Negative X is receiving power + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, true)); + + if (Synthesizer.file_to_gen != null){ + synth_gen(worldIn, pos); + + } + + }else if (worldIn.getRedstonePower(pos.south(), EnumFacing.SOUTH) > 0) { + //Positive Z is receiving power + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, true)); + + if (Synthesizer.file_to_gen != null){ + synth_gen(worldIn, pos); + + } + }else if (worldIn.getRedstonePower(pos.west(), EnumFacing.WEST) > 0) { + //Positive X is receiving power + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, true)); + + if (Synthesizer.file_to_gen != null){ + synth_gen(worldIn, pos); + } + }else if (worldIn.getRedstonePower(pos.up(), EnumFacing.UP) > 0) { + //Positive Y is receiving power + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, true)); + LogicGates.XOR().placeInWorld(worldIn, pos, EnumFacing.NORTH); + }else if (worldIn.getRedstonePower(pos.down(), EnumFacing.DOWN) > 0) { + //Negative Y is receiving power + } else { + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, false)); + } + } else { + if (!worldIn.isBlockPowered(pos)) { + worldIn.setBlockState(pos, state.withProperty(TRIGGERED, false)); + } + } + + worldIn.notifyNeighborsOfStateChange(pos, this); + } + } + + private void synth_gen(World worldIn, BlockPos pos){ + try { + + IntermediateCircuit ic = new IntermediateCircuit(); + ic.loadGraph(GraphBuilder.buildGraph(Synthesizer.file_to_gen)); + ic.buildGates(); + ic.routeChannels(); + this.c_check = ic.genCircuit(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("placing base"); + c_check.placeInWorld(worldIn, pos, EnumFacing.NORTH); + this.to_check = true; + this.p_check = pos; + + } catch (Exception e){ + Minecraft.getMinecraft().thePlayer.sendChatMessage(e.getMessage()); + e.printStackTrace(); + } + } + + @Override + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, TRIGGERED); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return this.getDefaultState().withProperty(TRIGGERED, (meta) > 0); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(TRIGGERED) ? 1 : 0; + } + +} diff --git a/src/main/java/minecrafthdl/client/render/blocks/BlockRenderRegister.java b/src/main/java/minecrafthdl/client/render/blocks/BlockRenderRegister.java new file mode 100644 index 0000000..88d1de1 --- /dev/null +++ b/src/main/java/minecrafthdl/client/render/blocks/BlockRenderRegister.java @@ -0,0 +1,22 @@ +package minecrafthdl.client.render.blocks; + +import minecrafthdl.MinecraftHDL; +import minecrafthdl.block.ModBlocks; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.item.Item; + +/** + * Created by Francis on 10/28/2016. + */ +public class BlockRenderRegister { + public static void registerBlockRenderer() { + reg(ModBlocks.synthesizer); + } + + public static void reg(Block block) { + Minecraft.getMinecraft().getRenderItem().getItemModelMesher() + .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(MinecraftHDL.MODID + ":" + block.getUnlocalizedName().substring(5), "inventory")); + } +} diff --git a/src/main/java/minecrafthdl/gui/MinecraftHDLGuiHandler.java b/src/main/java/minecrafthdl/gui/MinecraftHDLGuiHandler.java new file mode 100644 index 0000000..f269de8 --- /dev/null +++ b/src/main/java/minecrafthdl/gui/MinecraftHDLGuiHandler.java @@ -0,0 +1,26 @@ +package minecrafthdl.gui; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.IGuiHandler; + +/** + * Created by Francis on 3/25/2017. + */ +public class MinecraftHDLGuiHandler implements IGuiHandler { + + public static final int SYNTHESISER_GUI_ID = 0; + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + if (ID == SYNTHESISER_GUI_ID) + return new SynthesiserGUI(world, x, y, z); + return null; + } + +} diff --git a/src/main/java/minecrafthdl/gui/SynthesiserGUI.java b/src/main/java/minecrafthdl/gui/SynthesiserGUI.java new file mode 100644 index 0000000..e7e60ba --- /dev/null +++ b/src/main/java/minecrafthdl/gui/SynthesiserGUI.java @@ -0,0 +1,233 @@ +package minecrafthdl.gui; + +import minecrafthdl.block.blocks.Synthesizer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; + +/** + * Created by Francis on 3/25/2017. + */ +public class SynthesiserGUI extends GuiScreen { + + GuiButton synthesize_button, up_button, down_button; + int synth_b_id = 0; + int up_b_id = 1; + int down_b_id = 2; + + String file_directory = "./verilog_designs"; + + ArrayList file_names = new ArrayList(); + int selected_file = -1; + + + int window_width = 256; + int window_height = 256; + + int window_left, window_top, filebox_left, filebox_top, filebox_right, filebox_bottom; + + int line_height = 10; + int padding = 2; + int total_height = line_height + (2 * padding); + + int start_file_index = 0; + + int block_x, block_y, block_z; + World world; + + + public SynthesiserGUI(World world, int x, int y, int z) { + super(); + + this.world = world; + this.block_x = x; + this.block_y = y; + this.block_z = z; + } + + + @Override + public void initGui() { + + + this.window_left = centerObjectTL(this.window_width, this.width); + this.window_top = centerObjectTL(this.window_height, this.height); + + this.filebox_left = window_left + 12; + this.filebox_right = window_left + 150; + this.filebox_top = window_top + 25; + this.filebox_bottom = window_top + 130; + + this.buttonList.add(this.synthesize_button = new GuiButton(this.synth_b_id, this.width / 2 - 50, this.height / 2 + 52, 100, 20, "Generate Design")); + this.buttonList.add(this.up_button = new GuiButton(this.up_b_id , this.filebox_right + 1, this.filebox_top - 1, 20, 20, "^")); + this.buttonList.add(this.down_button = new GuiButton(this.down_b_id, this.filebox_right + 1, this.filebox_bottom - 19, 20, 20, "/")); + + + System.out.println("Win L: " + this.window_left + "\tWin T: " + this.window_top); + + this.synthesize_button.enabled = false; + this.file_names = this.readFileNames(); + } + + private ArrayList readFileNames(){ + ArrayList files = new ArrayList(); + File folder = new File(file_directory); + + if (folder == null) { + folder.mkdir(); + } + + System.out.println("PWD: " + System.getProperty("user.dir")); + + + if (!folder.exists()) { + folder.mkdir(); + Minecraft.getMinecraft().thePlayer.sendChatMessage("Created folder 'verilog_designs'"); + Minecraft.getMinecraft().thePlayer.sendChatMessage("Copy your synthesized JSON files to this directory:"); + Minecraft.getMinecraft().thePlayer.sendChatMessage(System.getProperty("user.dir") + "\\verilog_designs"); + + } else { + for (File f : folder.listFiles()){ + if (f.getName().toLowerCase().endsWith(".json")) { + files.add(f.getName()); + } + } + } + + + + + return files; + } + + private int centerObjectTL(int obj_dimension, int scrn_dimension){ + return (scrn_dimension / 2) - (obj_dimension / 3); + } + + private int centerObjectBR(int obj_dimension, int scrn_dimension){ + return (scrn_dimension / 2) + (obj_dimension / 2); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + this.mc.getTextureManager().bindTexture(new ResourceLocation("minecrafthdl:textures/gui/synthesiser.png")); + this.drawTexturedModalRect(centerObjectTL(this.window_width, this.width), centerObjectTL(this.window_height, this.height), 0, 0, this.window_width, this.window_height); + + this.fontRendererObj.drawString( + "Synthesiser", + (this.width / 2) - (this.fontRendererObj.getStringWidth("Synthesiser") / 2), + (this.height / 2) - 75, + 0 + ); + + this.drawFileNames(); + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + private void drawFileNames(){ + int current_height = this.filebox_top; + int files_shown = 0; + for (int i = this.start_file_index; i < this.file_names.size(); i++) { + if (files_shown == 7) break; + else files_shown++; + String file_name = this.file_names.get(i); + int max_width = this.filebox_right - this.filebox_left - (2 * this.padding); + if (this.fontRendererObj.getStringWidth(file_name) > max_width) { + file_name = this.fontRendererObj.trimStringToWidth(file_name, max_width - this.fontRendererObj.getStringWidth("...")) + "..."; + } + + if (this.selected_file == i){ + + this.drawGradientRect( + this.filebox_left, + current_height, + this.filebox_right, + current_height + this.total_height, + 0xFFFFFFFF, 0xFFFFFFFF + ); + + current_height += this.padding; + + this.fontRendererObj.drawString( + file_name, + this.filebox_left + this.padding, + current_height, + 0x00000000 + ); + + current_height += this.line_height + this.padding; + + } else { + current_height += this.padding; + + this.fontRendererObj.drawString( + file_name, + this.filebox_left + this.padding, + current_height, + 0xFFFFFFFF + ); + + current_height += this.line_height + this.padding; + } + } + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException{ + if(mouseX >= this.filebox_left && mouseX <= this.filebox_right && mouseY >= this.filebox_top && mouseY <= this.filebox_bottom) { + int index = (mouseY - this.filebox_top + (this.start_file_index * this.line_height)) / this.total_height; + if (index < this.file_names.size()){ + this.selected_file = index; + this.synthesize_button.enabled = true; + } else { + this.selected_file = -1; + this.synthesize_button.enabled = false; + } + } + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + @Override + protected void actionPerformed(GuiButton button) throws IOException { + System.out.println("Hi"); + if (button == this.synthesize_button) { + if (this.selected_file < 0) { + this.mc.displayGuiScreen(null); + if (this.mc.currentScreen == null) + this.mc.setIngameFocus(); + } + + Synthesizer.file_to_gen = this.file_directory + "/" + this.file_names.get(this.selected_file); + + this.mc.displayGuiScreen(null); + if (this.mc.currentScreen == null) + this.mc.setIngameFocus(); + } + if (button == this.up_button){ + if (this.start_file_index > 0) this.start_file_index-= 1; + } + if (button == this.down_button){ + if (this.start_file_index + 6 < this.file_names.size() - 1) this.start_file_index += 1; + } + + + + super.actionPerformed(button); + } + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + +} diff --git a/src/main/java/minecrafthdl/synthesis/Circuit.java b/src/main/java/minecrafthdl/synthesis/Circuit.java new file mode 100644 index 0000000..fb2ef7c --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/Circuit.java @@ -0,0 +1,137 @@ +package minecrafthdl.synthesis; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3i; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * Created by Francis on 10/28/2016. + */ +public class Circuit { + + public static boolean TEST = false; + + ArrayList>> blocks; + HashMap te_map = new HashMap(); + + public Circuit(int sizeX, int sizeY, int sizeZ){ + this.blocks = new ArrayList>>(); + for (int x = 0; x < sizeX; x++) { + this.blocks.add(new ArrayList>()); + for (int y = 0; y < sizeY; y++) { + this.blocks.get(x).add(new ArrayList()); + for (int z = 0; z < sizeZ; z++) { + if (!Circuit.TEST) this.blocks.get(x).get(y).add(Blocks.AIR.getDefaultState()); + } + } + } + } + + + + public void setBlock(int x, int y, int z, IBlockState blockstate) { + if (TEST) return; + this.blocks.get(x).get(y).set(z, blockstate); + } + + public void placeInWorld(World worldIn, BlockPos pos, EnumFacing direction) { + int width = blocks.size(); + int height = blocks.get(0).size(); + int length = blocks.get(0).get(0).size(); + + int start_x = pos.getX(); + int start_y = pos.getY(); + int start_z = pos.getZ(); + + if (direction == EnumFacing.NORTH){ + start_z += 2; + } else if (direction == EnumFacing.SOUTH) { + start_z -= length + 1; + } else if (direction == EnumFacing.EAST){ + start_x -= width + 1; + } else if (direction == EnumFacing.WEST) { + start_x -= width + 1; + } + + int y = start_y - 1; + for (int z = start_z - 1; z < start_z + length + 1; z ++){ + for (int x = start_x - 1; x < start_x + width + 1; x++){ + worldIn.setBlockState(new BlockPos(x, y, z), Blocks.WOOL.getDefaultState()); + } + } + + HashMap torches = new HashMap(); + + for (int i = 0; i < width; i++){ + for (int j = 0; j < height; j++) { + for (int k = 0; k < length; k++) { + if (this.getState(i, j, k).getBlock().getDefaultState() == Blocks.REDSTONE_TORCH.getDefaultState()) { + torches.put(new Vec3i(i, j, k), this.getState(i, j, k)); + } else { + BlockPos blk_pos = new BlockPos(start_x + i, start_y + j, start_z + k); + worldIn.setBlockState(blk_pos, this.getState(i, j, k)); + + TileEntity te = this.te_map.get(new Vec3i(i, j, k)); + if (te != null) { + worldIn.setTileEntity(blk_pos, te); + } + } + } + } + } + + for (Map.Entry set : torches.entrySet()){ + worldIn.setBlockState(new BlockPos(start_x + set.getKey().getX(), start_y + set.getKey().getY(), start_z + set.getKey().getZ()), set.getValue()); + } + for (int z = start_z - 1; z < start_z + length + 1; z ++) { + for (int x = start_x - 1; x < start_x + width + 1; x++) { + if (worldIn.getBlockState(new BlockPos(x, y + 1, z)).getBlock() == Blocks.AIR | worldIn.getBlockState(new BlockPos(x, y + 1, z)).getBlock() == Blocks.WOOL) { + worldIn.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState()); + } + } + } + } + + public int getSizeX() { + return this.blocks.size(); + } + + public int getSizeY() { + return this.blocks.get(0).size(); + } + + public int getSizeZ() { + return this.blocks.get(0).get(0).size(); + } + + public IBlockState getState(int x, int y, int z){ + return this.blocks.get(x).get(y).get(z); + } + + public void insertCircuit(int x_offset, int y_offset, int z_offset, Circuit c) { + for (int x = 0; x < c.getSizeX(); x++) { + for (int y = 0; y < c.getSizeY(); y++) { + for (int z = 0; z < c.getSizeZ(); z++) { + this.setBlock(x + x_offset, y + y_offset, z + z_offset, c.getState(x, y, z)); + + TileEntity te = c.te_map.get(new Vec3i(x, y, z)); + if (te != null) { + this.te_map.put(new Vec3i(x + x_offset, y + y_offset, z + z_offset), te); + } + } + } + } + } +} diff --git a/src/main/java/minecrafthdl/synthesis/CircuitTest.java b/src/main/java/minecrafthdl/synthesis/CircuitTest.java new file mode 100644 index 0000000..70a9991 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/CircuitTest.java @@ -0,0 +1,49 @@ +package minecrafthdl.synthesis; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.ArrayList; + +/** + * Created by Francis on 10/28/2016. + */ +public class CircuitTest { + ArrayList>> blocks; + + public CircuitTest(int sizeX, int sizeY, int sizeZ){ + this.blocks = new ArrayList>>(); + for (int x = 0; x < sizeX; x++) { + this.blocks.add(new ArrayList>()); + for (int y = 0; y < sizeY; y++) { + this.blocks.get(x).add(new ArrayList()); + for (int z = 0; z < sizeZ; z++) { + this.blocks.get(x).get(y).add("."); + } + } + } + } + + public void setBlock(int x, int y, int z, String blockstate) { + this.blocks.get(x).get(y).set(z, blockstate); + } + + public int getSizeX() { + return this.blocks.size(); + } + + public int getSizeY() { + return this.blocks.get(0).size(); + } + + public int getSizeZ() { + return this.blocks.get(0).get(0).size(); + } + + public String getState(int x, int y, int z){ + return this.blocks.get(x).get(y).get(z); + } +} diff --git a/src/main/java/minecrafthdl/synthesis/Gate.java b/src/main/java/minecrafthdl/synthesis/Gate.java new file mode 100644 index 0000000..8c034aa --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/Gate.java @@ -0,0 +1,29 @@ +package minecrafthdl.synthesis; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.Vec3d; + +import java.util.HashMap; + +/** + * Created by Francis O'Brien - 3/3/2017 - 9:47 AM + */ + +public class Gate extends Circuit { + + public int num_inputs, num_outputs, input_spacing, output_spacing = 0; + public int[] output_lines; + + public String[] id_txt; + public boolean is_io = false; + + public Gate(int sizeX, int sizeY, int sizeZ, int num_inputs, int num_outputs, int input_spacing, int output_spacing, int[] output_lines) { + super(sizeX, sizeY, sizeZ); + + this.num_inputs = num_inputs; + this.num_outputs = num_outputs; + this.input_spacing = input_spacing; + this.output_spacing = output_spacing; + this.output_lines = output_lines; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/IntermediateCircuit.java b/src/main/java/minecrafthdl/synthesis/IntermediateCircuit.java new file mode 100644 index 0000000..187da8e --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/IntermediateCircuit.java @@ -0,0 +1,311 @@ +package minecrafthdl.synthesis; + +import MinecraftGraph.*; +import minecrafthdl.MHDLException; +import minecrafthdl.Utils; +import minecrafthdl.synthesis.routing.Channel; +import minecrafthdl.synthesis.routing.Net; +import minecrafthdl.synthesis.routing.Router; +import minecrafthdl.synthesis.routing.pins.GatePins; +import minecrafthdl.synthesis.routing.pins.PinsArray; +import minecrafthdl.testing.TestLogicGates; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * Created by Francis on 11/28/2016. + */ +public class IntermediateCircuit { + + public ArrayList> vertex_layers = new ArrayList>(); + public ArrayList> gate_layers = new ArrayList>(); + public ArrayList channels = new ArrayList(); + + + public void loadGraph(Graph graph) { + System.out.println("Graph built"); + + ArrayList finished = new ArrayList(); + ArrayList in_process = new ArrayList(); + ArrayList process_done = new ArrayList(); + ArrayList to_process = new ArrayList(); + + for (Vertex v : graph.getVertices()) { + if (v.getType() == VertexType.INPUT) { + in_process.add(v); + } else if (v.getType() == VertexType.FUNCTION){ + Function f = (Function) v; + if (f.func_type == FunctionType.HIGH || f.func_type == FunctionType.LOW) in_process.add(v); + } + + } + + int layer_num = 0; + + while (in_process.size() > 0){ + int size = in_process.size(); + vertex_layers.add(new ArrayList()); + for (Vertex v : in_process){ + boolean valid = true; + for (Vertex p : v.getBefore()){ + if (!finished.contains(p)) { + valid = false; + break; + } + } + + if (valid){ + vertex_layers.get(layer_num).add(v); + process_done.add(v); + + for (Vertex n : v.getNext()){ + to_process.add(n); + } + } + } + for (Vertex v : process_done){ + in_process.remove(v); + finished.add(v); + } + for (Vertex v : to_process){ + if (!in_process.contains(v)) in_process.add(v); + } + process_done.clear(); + to_process.clear(); + layer_num++; + + } + + ArrayList outputs_not_in_last = new ArrayList(); + + for (ArrayList v_l : this.vertex_layers){ + if (this.vertex_layers.indexOf(v_l) == vertex_layers.size() - 1) break; + ArrayList to_remove = new ArrayList(); + + for (Vertex v : v_l){ + if (v.type == VertexType.OUTPUT) { + outputs_not_in_last.add(v); + to_remove.add(v); + } + } + + for (Vertex v : to_remove){ + v_l.remove(v); + } + } + + ArrayList last_layer = this.vertex_layers.get(this.vertex_layers.size() - 1); + for (Vertex v : outputs_not_in_last){ + last_layer.add(v); + } + + for (int i = 0; i < vertex_layers.size() - 1; i++){ + ArrayList layer = vertex_layers.get(i); + ArrayList next_layer = vertex_layers.get(i+1); + + for (Vertex v : layer){ + ArrayList addToNext = new ArrayList(); + ArrayList removeFromNext = new ArrayList(); + + for (Vertex next : v.getNext()){ + if (!next_layer.contains(next)){ + Vertex relay = new Function(1, FunctionType.RELAY, 1); + + next_layer.add(relay); + + removeFromNext.add(next); + next.removeBefore(v); + + addToNext.add(relay); + relay.addToBefore(v); + + relay.addToNext(next); + next.addToBefore(relay); + + next.handleRelay(v, relay); + } + } + + for (Vertex x : addToNext){ + v.addToNext(x); + } + + for (Vertex x : removeFromNext){ + v.removeNext(x); + } + } + } + + } + + public void printLayers(){ + for (ArrayList layer : vertex_layers){ + for (Vertex v : layer) { + if (v.getType() == VertexType.INPUT){ + System.out.print("I, "); + } + if (v.getType() == VertexType.FUNCTION){ + System.out.print(((Function) v).getFunc_Type() + ", "); + } + if (v.getType() == VertexType.OUTPUT){ + System.out.print("O, "); + } + } + System.out.print("\n"); + } + } + + public void buildGates() { + if (this.vertex_layers.size() == 0) throw new MHDLException("Must load graph before building gates"); + + for (ArrayList v_layer : this.vertex_layers) { + ArrayList this_layer = new ArrayList(); + for (Vertex v : v_layer) { + this_layer.add(genGate(v)); + } + this.gate_layers.add(this_layer); + } + } + + public void routeChannels() { + for (int i = 0; i < vertex_layers.size() - 1; i++){ + ArrayList top_vertices = vertex_layers.get(i); + ArrayList top_gates = gate_layers.get(i); + ArrayList bottom_vertices = vertex_layers.get(i+1); + ArrayList bottom_gates = gate_layers.get(i + 1); + + Router.PinInitRtn rtn = Router.initializePins(top_vertices, top_gates, bottom_vertices, bottom_gates, 1); + + HashMap pin_map = rtn.pin_map; + PinsArray pins_array = rtn.pins_array; + + HashMap nets = Router.initializeNets(top_vertices, bottom_vertices, pin_map); + + this.channels.add(Router.placeNets(nets, pins_array)); + + Net.num_nets = 0; + } + + + } + + public Circuit genCircuit(){ + if (this.gate_layers.size() == 0) throw new MHDLException("Must build gates before generating final circuit"); + + int size_x = 0; + int size_y = 0; + int size_z = 0; + + int[] layers_size_z = new int[this.gate_layers.size()]; + + for (ArrayList layer : this.gate_layers){ + int this_size_x = layer.size() == 0 ? 0 : layer.size() - 1; + int this_size_y = 0; + int this_size_z = 0; + + for (Circuit c : layer){ + this_size_x += c.getSizeX(); + if (c.getSizeY() > this_size_y) this_size_y = c.getSizeY(); + if (c.getSizeZ() > this_size_z) this_size_z = c.getSizeZ(); + } + + if (this_size_x > size_x) size_x = this_size_x; + if (this_size_y > size_y) size_y = this_size_y; + size_z += this_size_z; + + layers_size_z[this.gate_layers.indexOf(layer)] = this_size_z; + } + + if (size_y < 3) size_y = 3; + + for (Channel c : this.channels){ + if (c.sizeX() + 1 > size_x) size_x = c.sizeX() + 1; + size_z += c.sizeZ() + 1; + } + + Circuit circuit = new Circuit(size_x, size_y, size_z); + + int z_offset = 0; + for (int i = 0; i < this.gate_layers.size(); i++) { + int x_offset = 0; + for (Gate g : this.gate_layers.get(i)){ + circuit.insertCircuit(x_offset, 0, z_offset, g); + + if (g.getSizeZ() - 1 < layers_size_z[i]) { + for (int z = g.getSizeZ(); z < layers_size_z[i]; z++){ +// g.setBlock(x_offset, 0, z_offset + z, Blocks.WOOL.getDefaultState()); +// circuit.setBlock(x_offset, 0, z_offset + z, Blocks.WOOL.getDefaultState()); + circuit.setBlock(x_offset, 0, z_offset + z, Blocks.REDSTONE_WIRE.getDefaultState()); +// if (z == layers_size_z[i] - 1) circuit.setBlock(x_offset, 0, z_offset + z, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); +// else circuit.setBlock(x_offset, 0, z_offset + z, Blocks.REDSTONE_WIRE.getDefaultState()); + + } + } + + x_offset += 1 + g.getSizeX(); + } + z_offset += layers_size_z[i]; + + if (i < this.gate_layers.size() - 1) { + Channel c = this.channels.get(i); + circuit.insertCircuit(0, 0, z_offset, c.genChannelCircuit()); + z_offset += c.sizeZ(); + } + } + + return circuit; + } + + private static FunctionType getFunctionType(Vertex v) { + + if (v.getType() == VertexType.FUNCTION) { + return ((Function) v).getFunc_Type(); + } else { + if (v.getType() == VertexType.INPUT) return FunctionType.Input; + else return FunctionType.Output; + } + + } + + + private static Gate genGate(Vertex v) { + if (getFunctionType(v) == FunctionType.AND) { + return Circuit.TEST? TestLogicGates.AND(((Function)v).get_num_inputs()) : LogicGates.AND(((Function)v).get_num_inputs()); + } else if ( getFunctionType(v) == FunctionType.OR){ + return Circuit.TEST? TestLogicGates.OR(((Function)v).get_num_inputs()) : LogicGates.OR(((Function)v).get_num_inputs()); + } else if ( getFunctionType(v) == FunctionType.INV){ + return Circuit.TEST? TestLogicGates.NOT() : LogicGates.NOT(); + } else if ( getFunctionType(v) == FunctionType.RELAY) { + return Circuit.TEST ? TestLogicGates.RELAY() : LogicGates.RELAY(); + }else if ( getFunctionType(v) == FunctionType.XOR){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.XOR(); + }else if ( getFunctionType(v) == FunctionType.MUX){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.MUX(); + } +// else if ( getFunctionType(v )== FunctionType.IO){ +// return Circuit.TEST? TestLogicGates.IO() : LogicGates.IO(); +// } + else if ( getFunctionType(v) == FunctionType.Input){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.Input(v.getID()); + }else if ( getFunctionType(v) == FunctionType.Output){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.Output(v.getID()); + }else if ( getFunctionType(v) == FunctionType.HIGH){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.HIGH(); + }else if ( getFunctionType(v) == FunctionType.LOW){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.LOW(); + }else if ( getFunctionType(v) == FunctionType.D_LATCH){ + return Circuit.TEST? TestLogicGates.IO() : LogicGates.D_LATCH(); + } + else throw new MHDLException("NO SUCH GATE AVAILABLE"); + } + + + public void verify(World worldIn, BlockPos pos) { + + } +} diff --git a/src/main/java/minecrafthdl/synthesis/LogicGates.java b/src/main/java/minecrafthdl/synthesis/LogicGates.java new file mode 100644 index 0000000..46a74ad --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/LogicGates.java @@ -0,0 +1,293 @@ +package minecrafthdl.synthesis; + +import jdk.nashorn.internal.ir.Block; +import minecrafthdl.Demo; +import minecrafthdl.MHDLException; +import minecrafthdl.Utils; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.Vec3i; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentString; + +/** + * Created by Francis on 11/12/2016. + */ +public class LogicGates { + + + public static void main(String[] args) { + IntermediateCircuit ic = new IntermediateCircuit(); + ic.loadGraph(Demo.create4bitmuxgraph()); + ic.printLayers(); + } + + public static Gate Input(String id){ + + Gate gate = new Gate(1, 2, 1, 1, 1, 0, 0, new int[]{0}); + + gate.is_io = true; + String[] id_txt = extractSignText(id); + + TileEntitySign tes = new TileEntitySign(); + + for (int i = 0 ; i < id_txt.length; i++){ + tes.signText[i] = new TextComponentString(id_txt[i]); + } + + gate.te_map.put(new Vec3i(0, 1, 0), tes); + + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 1, 0, Blocks.STANDING_SIGN.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.STANDING_SIGN, "rotation"), 8)); + return gate; + } + + public static Gate Output(String id){ + Gate gate = new Gate(1, 2, 1, 1, 1, 0, 0, new int[]{0}); + + gate.is_io = true; + String[] id_txt = extractSignText(id); + + TileEntitySign tes = new TileEntitySign(); + + for (int i = 0 ; i < id_txt.length; i++){ + tes.signText[i] = new TextComponentString(id_txt[i]); + } + + gate.te_map.put(new Vec3i(0, 1, 0), tes); + + gate.setBlock(0, 0, 0, Blocks.REDSTONE_LAMP.getDefaultState()); + gate.setBlock(0, 1, 0, Blocks.STANDING_SIGN.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.STANDING_SIGN, "rotation"), 0)); + return gate; + } + + private static String[] extractSignText(String id){ + String[] txt = {"", "", ""}; + + int i = 0; + + do { + if (id.length() <= 15){ + txt[i] += id; + break; + } else { + String line = id.substring(0, 15); + id = id.substring(15, id.length()); + txt[i] += line; + i++; + } + + } while (i < 3); + + return txt; + } + + public static Gate NOT(){ + Gate gate = new Gate(1, 1, 3, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 1, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(0, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + return gate; + } + + public static Gate RELAY(){ + Gate gate = new Gate(1, 1, 3, 1, 1, 0, 0, new int[]{0}); + + gate.setBlock(0, 0, 0, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(0, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); +// gate.setBlock(0, 0, 1, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(0, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + + return gate; + } + + public static Gate AND(int inputs) { + if (inputs == 0) throw new MHDLException("Gate cannot have 0 inputs"); + int width; + if (inputs == 1) width = 1; + + else width = (inputs * 2) - 1; + + Gate gate = new Gate(width, 2, 4, inputs, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 2, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(0, 0, 3, Blocks.REDSTONE_WIRE.getDefaultState()); + + for (int i = 0; i < width; i+=2) { + gate.setBlock(i, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(i, 0, 1, Blocks.WOOL.getDefaultState()); + gate.setBlock(i, 1, 0, Blocks.REDSTONE_TORCH.getDefaultState()); + gate.setBlock(i, 1, 1, Blocks.REDSTONE_WIRE.getDefaultState()); + + if (i != width - 1) { + gate.setBlock(i + 1, 0, 1, Blocks.WOOL.getDefaultState()); + if (i == 14) { + gate.setBlock(i + 1, 1, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } else { + gate.setBlock(i + 1, 1, 1, Blocks.REDSTONE_WIRE.getDefaultState()); + } + } + } + + return gate; + } + + + + public static Gate OR(int inputs) { + if (inputs == 0) throw new MHDLException("Gate cannot have 0 inputs"); + int width; + if (inputs == 1) width = 1; + else width = (inputs * 2) - 1; + + Gate gate = new Gate(width, 2, 4, inputs, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 3, Blocks.REDSTONE_WIRE.getDefaultState()); + + for (int i = 0; i < width; i+=2) { + gate.setBlock(i, 0, 0, Blocks.WOOL.getDefaultState()); +// gate.setBlock(i, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + gate.setBlock(i, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + if (i != width - 1) { + if (i == 14) { + gate.setBlock(i + 1, 0, 2, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } else { + gate.setBlock(i + 1, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + } + } + } + return gate; + } + + public static Gate XOR(){ + Gate gate = new Gate(3, 2, 7, 2, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 1, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(0, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(0, 0, 3, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 4, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(0, 0, 5, Blocks.REDSTONE_WIRE.getDefaultState()); + + gate.setBlock(0, 1, 0, Blocks.REDSTONE_TORCH.getDefaultState()); + gate.setBlock(0, 1, 3, Blocks.REDSTONE_WIRE.getDefaultState()); + + gate.setBlock(1, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(1, 1, 0, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(1, 0, 1, Blocks.WOOL.getDefaultState()); + gate.setBlock(1, 1, 1, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(1, 0, 2, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(1, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(1, 0, 5, Blocks.REDSTONE_WIRE.getDefaultState()); + + + gate.setBlock(2, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(2, 0, 1, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(2, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(2, 0, 3, Blocks.WOOL.getDefaultState()); + gate.setBlock(2, 0, 4, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + + gate.setBlock(2, 1, 0, Blocks.REDSTONE_TORCH.getDefaultState()); + gate.setBlock(2, 1, 3, Blocks.REDSTONE_WIRE.getDefaultState()); + + gate.setBlock(0, 0, 6, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + + return gate; + } + +// public static Gate XOR(){ +// Gate gate = new Gate(3, 2, 6, 2, 1, 1, 0, new int[]{0}); +// gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); +// gate.setBlock(0, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); +// gate.setBlock(0, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); +// gate.setBlock(0, 0, 3, Blocks.WOOL.getDefaultState()); +// gate.setBlock(0, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); +// +// gate.setBlock(0, 1, 0, Blocks.STICKY_PISTON.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.STICKY_PISTON, "facing"), EnumFacing.SOUTH)); +// gate.setBlock(0, 1, 1, Blocks.WOOL.getDefaultState()); +// gate.setBlock(0, 1, 3, Blocks.REDSTONE_WIRE.getDefaultState()); +// +// +// gate.setBlock(2, 0, 0, Blocks.WOOL.getDefaultState()); +// gate.setBlock(2, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); +// gate.setBlock(2, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); +// gate.setBlock(2, 0, 3, Blocks.WOOL.getDefaultState()); +// gate.setBlock(2, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); +// +// gate.setBlock(2, 1, 0, Blocks.STICKY_PISTON.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.STICKY_PISTON, "facing"), EnumFacing.SOUTH)); +// gate.setBlock(2, 1, 1, Blocks.WOOL.getDefaultState()); +// gate.setBlock(2, 1, 3, Blocks.REDSTONE_WIRE.getDefaultState()); +// +// gate.setBlock(1, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); +// gate.setBlock(1, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); +// gate.setBlock(0, 0, 5, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); +// +// return gate; +// } + + public static Gate MUX() { + Gate gate = new Gate(5, 2, 6, 3, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 1, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 2, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 3, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(0, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); + gate.setBlock(0, 0, 5, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + + gate.setBlock(1, 0, 2, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + gate.setBlock(1, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); + + gate.setBlock(2, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(2, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + gate.setBlock(2, 0, 2, Blocks.WOOL.getDefaultState()); + gate.setBlock(2, 0, 4, Blocks.REDSTONE_WIRE.getDefaultState()); + + gate.setBlock(3, 0, 2, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.EAST)); + gate.setBlock(3, 0, 4, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.WEST)); + + gate.setBlock(4, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(4, 0, 1, Blocks.REDSTONE_TORCH.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_TORCH, "facing"), EnumFacing.SOUTH)); + gate.setBlock(4, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_WIRE, "power"), 10)); + gate.setBlock(4, 0, 3, Blocks.REDSTONE_WIRE.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_WIRE, "power"), 10)); + gate.setBlock(4, 0, 4, Blocks.WOOL.getDefaultState()); + + gate.setBlock(0, 1, 0, Blocks.REDSTONE_TORCH.getDefaultState()); + gate.setBlock(0, 1, 1, Blocks.REDSTONE_WIRE.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_WIRE, "power"), 10)); + gate.setBlock(0, 1, 2, Blocks.REDSTONE_WIRE.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.REDSTONE_WIRE, "power"), 10)); + + return gate; + } + + public static Gate LOW(){ + Gate gate = new Gate(1, 1, 1, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + return gate; + } + + public static Gate HIGH(){ + Gate gate = new Gate(1, 1, 1, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, Blocks.REDSTONE_TORCH.getDefaultState()); + return gate; + } + + public static Gate D_LATCH() { + Gate gate = new Gate(3, 1, 4, 2, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(0, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + gate.setBlock(0, 0, 2, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + gate.setBlock(0, 0, 3, Blocks.WOOL.getDefaultState()); + + gate.setBlock(1, 0, 2, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + + gate.setBlock(2, 0, 0, Blocks.WOOL.getDefaultState()); + gate.setBlock(2, 0, 1, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + gate.setBlock(2, 0, 2, Blocks.REDSTONE_WIRE.getDefaultState()); + + return gate; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/Channel.java b/src/main/java/minecrafthdl/synthesis/routing/Channel.java new file mode 100644 index 0000000..621059d --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/Channel.java @@ -0,0 +1,370 @@ +package minecrafthdl.synthesis.routing; + +import minecrafthdl.Utils; +import minecrafthdl.synthesis.Circuit; +import minecrafthdl.synthesis.routing.pins.Pin; +import minecrafthdl.synthesis.routing.pins.PinPair; +import minecrafthdl.synthesis.routing.pins.PinsArray; +import minecrafthdl.synthesis.routing.vcg.VerticalConstraintGraph; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 3/3/2017 - 8:37 AM + */ + +public class Channel { + public PinsArray pinsArray; + public ArrayList> tracks = new ArrayList>(); + + public void findAvailableTrack(Net net, VerticalConstraintGraph vcg){ + if (net == null){ + return; + } + int highest_track = 0; + try { + for (int vc_id : vcg.getEdgeIDList(net.id)){ + for (ArrayList track : this.tracks){ + for (Net n : track){ + if (n.id == vc_id && n.track >= highest_track) highest_track = n.track + 1; + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + } + + for(int i = highest_track; i < this.tracks.size(); i++){ + boolean hasConflict = false; + for (Net n : this.tracks.get(i)){ + hasConflict = n.hasHorizontalConflict(net); + if (hasConflict) break; + } + if (!hasConflict){ + this.tracks.get(i).add(net); + net.setTrack(i); + return; + } + } + ArrayList new_track = new ArrayList(); + new_track.add(net); + this.tracks.add(new_track); + net.setTrack(this.tracks.size() - 1); + } + + public Circuit genChannelCircuit(){ + int length = 2 + (3 * this.tracks.size()); + int height = 3; + int width = 0; + + for (ArrayList track : this.tracks){ + for (Net n : track){ + if (n.x_max > width) width = n.x_max; + } + } + + width += 1; + + Circuit circuit = new Circuit(width, height, length); + + ArrayList nets_done = new ArrayList(); + + for(ArrayList track : this.tracks){ + for (Net n : track){ + if (nets_done.contains(n)) continue; + this.placeTrack(circuit, n.track, n.x_min, n.x_max, n.getpins()); + nets_done.add(n); + + if (n.isOutpath()){ + circuit.setBlock(n.x_max, 0, n.trackZ() + 1, Blocks.WOOL.getDefaultState()); + circuit.setBlock(n.x_max, 1, n.trackZ() + 1, Blocks.REDSTONE_WIRE.getDefaultState()); + } + + if (n.out_partner != null && !n.isOutpath()){ + circuit.setBlock(n.x_max, 0, n.trackZ() - 1, Blocks.WOOL.getDefaultState()); + circuit.setBlock(n.x_max, 1, n.trackZ() - 1, Blocks.REDSTONE_WIRE.getDefaultState()); + } + + this.wireColumns(circuit, n); + this.repeatNets(circuit, n); + } + } + + + + return circuit; + } + + public void printChannel(){ + int width = pinsArray.getPairs().size(); + int height = tracks.size() + 2; + + String[][] chars = new String[width][height]; + + for (int x = 0; x < width; x++){ + for (int y = 0; y < height; y++){ + chars[x][y] = "."; + } + } + + for (int x = 0; x < width; x++){ + PinPair pair = pinsArray.getPair(x); + + chars[x][0] = Integer.toString(pair.top.netID()).charAt(0) + ""; + chars[x][height - 1] = Integer.toString(pair.bot.netID()).charAt(0) + ""; + if (pair.top.empty()) chars[x][0] = " "; + if (pair.bot.empty()) chars[x][height - 1] = " "; + } + + + for (ArrayList t : tracks){ + for (Net n: t){ + for (Pin p : n.getpins()){ + if (p.top) { + for(int i = 1; i <= n.track + 1; i++){ + chars[p.xPos()/2][i] = "│"; + } + } else { + for(int i = n.track + 1; i < height - 1; i++){ + chars[p.xPos()/2][i] = "│"; + } + } + } + } + } + + for (ArrayList t : tracks) { + for (Net n : t) { + if (n.isOutpath()){ + for (int y = n.track; y <= n.out_partner.track; y++){ + chars[n.x_max / 2][y + 1] = "|"; + } + } + } + } + + for (ArrayList t : tracks){ + for (Net n: t){ + for (int i = n.x_min/2; i <= n.x_max/2; i++){ + if(n.x_max == n.x_min) continue; + chars[i][n.track + 1] = "─"; + } + } + } + + + for (ArrayList t : tracks){ + for (Net n: t){ + + if(n.isOutpath()){ + chars[n.x_max / 2][n.track+1] = "┐"; + chars[n.x_max / 2][n.out_partner.track+1] = "┘"; + } + + for (Pin p : n.getpins()){ + int x = p.xPos() / 2; + + boolean up = false; + boolean down = false; + boolean left = n.x_min / 2 < x; + boolean right = n.x_max / 2 > x; + + if (p.top){ + up = true; + for (Pin p2 : n.getpins()){ + if (p2 != p && p.xPos() == p2.xPos()) down = true; + } + } else { + down = true; + for (Pin p2 : n.getpins()){ + if (p2 != p && p.xPos() == p2.xPos()) up = true; + } + } + + if (up){ + if (down){ + if (left){ + if (right) chars[x][n.track + 1] = "┼"; + else chars[x][n.track + 1] = "┤"; + } else { + if (right) chars[x][n.track + 1] = "├"; + //else chars[x][n.track + 1] = "│"; + } + } else { + if (left){ + if (right) chars[x][n.track + 1] = "┴"; + else chars[x][n.track + 1] = "┘"; + } else { + if (right) chars[x][n.track + 1] = "└"; + else chars[x][n.track + 1] = "?"; + } + } + } else { + if (down){ + if (left){ + if (right) chars[x][n.track + 1] = "┬"; + else chars[x][n.track + 1] = "┐"; + } else { + if (right) chars[x][n.track + 1] = "┌"; + else chars[x][n.track + 1] = "?"; + } + } else { + if (left){ + //if (right) chars[x][n.track + 1] = "─"; + //else chars[x][n.track + 1] = "?"; + } else { + if (right) chars[x][n.track + 1] = "?"; + else chars[x][n.track + 1] = "?"; + } + } + } + } + } + } + + for (int y = 0; y < height; y++){ + String row = ""; + for (int x = 0; x < width; x++){ + row += chars[x][y]; + //row += " "; + } + System.out.println(row); + } + + } + + public void placeTrack(Circuit channel, int track_number, int xmin, int xmax, ArrayList pins){ + int z_min = 1 + (3 * track_number); + int z_track = z_min + 1; + + for (int x = xmin; x <= xmax; x++){ + channel.setBlock(x, 1, z_track, Blocks.WOOL.getDefaultState()); + channel.setBlock(x, 2, z_track, Blocks.REDSTONE_WIRE.getDefaultState()); + } + + for (Pin p : pins){ + if (p.top) { + channel.setBlock(p.xPos(), 0, z_min, Blocks.WOOL.getDefaultState()); + channel.setBlock(p.xPos(), 1, z_min, Blocks.REDSTONE_WIRE.getDefaultState()); + } else { + channel.setBlock(p.xPos(), 0, z_track + 1, Blocks.WOOL.getDefaultState()); + channel.setBlock(p.xPos(), 1, z_track + 1, Blocks.REDSTONE_WIRE.getDefaultState()); + } + } + } + + public void wireColumns(Circuit channel, Net n) { + for (Pin p : n.getpins()){ + // wiring the gate's pin's input and outputs + if (p.top) { + for (int z = 0; z < n.trackZ() - 1; z++){ + channel.setBlock(p.xPos(), 0, z, Blocks.REDSTONE_WIRE.getDefaultState()); +// channel.setBlock(p.xPos(), 2, z, Blocks.DARK_OAK_FENCE.getDefaultState()); + } + } else { + for (int z = n.trackZ() + 2; z < this.sizeZ(); z++){ + channel.setBlock(p.xPos(), 0, z, Blocks.REDSTONE_WIRE.getDefaultState()); +// channel.setBlock(p.xPos(), 2, z, Blocks.ACACIA_FENCE.getDefaultState()); + } + } + } + + if (n.isOutpath()){ + for (int z = n.trackZ() + 2; z < n.out_partner.trackZ() - 1; z++){ + channel.setBlock(n.x_max, 0, z, Blocks.REDSTONE_WIRE.getDefaultState()); +// channel.setBlock(n.x_max, 2, z, Blocks.JUNGLE_FENCE.getDefaultState()); + } + } + } + + public void repeatNets(Circuit channel, Net n) { + + for (Pin p : n.getpins()) { + if (p.top) { + if (n.trackZ() > 10) { + for (int z = n.trackZ() - 10; z > -1; z -= 10){ + channel.setBlock(p.xPos(), 0, z, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + } + } + + if (p.xPos() > n.x_min) { + channel.setBlock(p.xPos() - 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } + + if (p.xPos() < n.x_max) { + channel.setBlock(p.xPos() + 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.WEST)); + } + } else { + if (channel.getSizeZ() - n.trackZ() > 10) { + for (int z = n.trackZ() + 3; z < channel.getSizeZ(); z += 10){ + channel.setBlock(p.xPos(), 0, z, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + } + } + if (!(!n.outpath && n.out_partner != null)) { + if (p.xPos() > n.x_min) { + if (p.xPos() > n.top_pin.xPos()) + channel.setBlock(p.xPos() - 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.WEST)); + } + + if (p.xPos() < n.x_max) { + if (p.xPos() < n.top_pin.xPos()) + channel.setBlock(p.xPos() + 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } + } else { + channel.setBlock(p.xPos() + 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } + } + } + + if (n.x_max - n.x_min > 19) { + for (int x = n.x_min + 2; x < n.x_max - 2; x += 14) { + for (Pin p : n.getpins()){ + if (x == p.xPos()) x-= 1; + } + + if (!(!n.outpath && n.out_partner != null)) { + if (x < n.top_pin.xPos()) + channel.setBlock(x, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + if (x > n.top_pin.xPos()) + channel.setBlock(x, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.WEST)); + } else { + channel.setBlock(x, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + } + } + } + + if (n.isOutpath()){ + if (n.out_partner.trackZ() - n.trackZ() > 14) { + for (int z = n.trackZ() + 3; z < n.out_partner.trackZ() - 2; z += 13){ + channel.setBlock(n.x_max, 0, z, Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.NORTH)); + } + } + + channel.setBlock(n.x_max - 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.WEST)); + } + + if (!n.isOutpath() && n.out_partner != null){ + channel.setBlock(n.x_max - 1, 2, n.trackZ(), Blocks.UNPOWERED_REPEATER.getDefaultState().withProperty(Utils.getPropertyByName(Blocks.UNPOWERED_REPEATER, "facing"), EnumFacing.EAST)); + + } + } + + public int sizeX(){ + int x_max = 0; + + for (ArrayList t : this.tracks){ + for (Net n : t){ + if (n.x_max > x_max) x_max = n.x_max; + } + } + return x_max; + } + + public int sizeZ(){ + return 2 + (this.tracks.size() * 3); + } + +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/Net.java b/src/main/java/minecrafthdl/synthesis/routing/Net.java new file mode 100644 index 0000000..cf480f2 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/Net.java @@ -0,0 +1,103 @@ +package minecrafthdl.synthesis.routing; + +import minecrafthdl.MHDLException; +import minecrafthdl.synthesis.routing.pins.Pin; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 3/3/2017 - 6:18 AM + */ + +public class Net { + + public static int num_nets = 0; + + int id; + int track = -1; + + private ArrayList pins = new ArrayList(); + Pin top_pin; + + int x_min = Integer.MAX_VALUE, x_max = -1; + + + boolean outpath = false; + Pin out_pin; + Net out_partner; + + public Net(){ + this.id = Net.num_nets; + Net.num_nets++; + } + + public Net(int x_min, int x_max){ + this.id = Net.num_nets; + Net.num_nets++; + this.x_min = x_min; + this.x_max = x_max; + } + + public void addPin(Pin p, boolean dogleg){ + if (pins.contains(p)) return; + p.setNet(this.id, dogleg); + this.pins.add(p); + if (p.top) this.top_pin = p; + + if (p.xPos() < x_min) this.x_min = p.xPos(); + if (p.xPos() > x_max) this.x_max = p.xPos(); + } + + public boolean hasHorizontalConflict(Net other){ + if (this.x_max < other.x_min || this.x_min > other.x_max) return false; + return true; + } + + public void setTrack(int track){ + if (this.hasTrack()) throw new MHDLException("Net already has a track"); + this.track = track; + } + + public void setOutNet(Pin out_pin, Net original){ + this.pins.add(out_pin); + this.outpath = true; + this.out_pin = out_pin; + this.top_pin = out_pin; + out_pin.setNet(this.id, true); + + this.out_partner = original; + original.out_partner = this; + this.out_partner.pins.remove(out_pin); + } + + public int AssignOutColX(int out_col_x){ + this.x_max = out_col_x; + this.x_min = out_pin.xPos(); + this.out_partner.x_max = out_col_x; + return out_col_x; + } + + public boolean isOutpath(){ + return outpath; + } + + public boolean hasTrack(){ + return track != -1; + } + + public int getId(){ + return this.id; + } + + public ArrayList getpins() { + return pins; + } + + public void newXMax(int x_max) { + this.x_max = x_max; + } + + public int trackZ(){ + return (this.track == 0) ? 2 : (this.track * 3) + 2; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/Router.java b/src/main/java/minecrafthdl/synthesis/routing/Router.java new file mode 100644 index 0000000..4770e2a --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/Router.java @@ -0,0 +1,174 @@ +package minecrafthdl.synthesis.routing; + +import MinecraftGraph.Function; +import MinecraftGraph.FunctionType; +import MinecraftGraph.Vertex; +import MinecraftGraph.VertexType; +import minecrafthdl.synthesis.Gate; +import minecrafthdl.synthesis.routing.pins.*; +import minecrafthdl.synthesis.routing.vcg.VerticalConstraintGraph; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * Created by Francis on 2/22/2017. + */ +public class Router { + + public static Channel route(ArrayList top_vertices, ArrayList top_gates, ArrayList bottom_vertices, ArrayList bottom_gates, int gate_spacing){ + ArrayList top_pins, bottom_pins = new ArrayList(); + + + + return null; + } + + public static class PinInitRtn { + public HashMap pin_map; + public PinsArray pins_array; + } + + + public static PinInitRtn initializePins(ArrayList top_vertices, ArrayList top_gates, ArrayList bottom_vertices, ArrayList bottom_gates, int gate_spacing){ + PinInitRtn rtn = new PinInitRtn(); + + //Pin map init + HashMap pin_map = new HashMap(); + + if(top_gates.size() != top_vertices.size()) throw new RuntimeException("Top vertices and gates must be same size"); + if(bottom_gates.size() != bottom_vertices.size()) throw new RuntimeException("Bottom vertices and gates must be same size"); + + //top pins + int top_offset = 0; + for (int i = 0; i < top_vertices.size(); i++){ + GatePins gate_pins = new GatePins(top_gates.get(i), top_vertices.get(i), top_offset, true); + pin_map.put(top_vertices.get(i), gate_pins); + + top_offset += top_gates.get(i).getSizeX() + gate_spacing; + } + + //bottom pins + int bottom_offset = 0; + for (int i = 0; i < bottom_vertices.size(); i++){ + Vertex v = bottom_vertices.get(i); + + GatePins gate_pins = null; + if (v.type == VertexType.FUNCTION && ((Function)v).func_type == FunctionType.MUX){ + gate_pins = new MuxPins(bottom_gates.get(i), bottom_vertices.get(i), bottom_offset, false); + } else { + gate_pins = new GatePins(bottom_gates.get(i), bottom_vertices.get(i), bottom_offset, false); + } + pin_map.put(bottom_vertices.get(i), gate_pins); + + bottom_offset += bottom_gates.get(i).getSizeX() + gate_spacing; + } + + rtn.pin_map = pin_map; + + //Pins array init + PinsArray pins_array = new PinsArray(); + + //top pins + for (Vertex v : top_vertices){ + for (Pin p : pin_map.get(v).getPins()){ + pins_array.addPin(p, true); + } + } + + //bottom pins + for (Vertex v : bottom_vertices){ + for (Pin p : pin_map.get(v).getPins()){ + pins_array.addPin(p, false); + } + } + + rtn.pins_array = pins_array; + + return rtn; + } + + public static HashMap initializeNets(ArrayList top_vertices, ArrayList bottom_vertices, HashMap pin_map) { + HashMap nets = new HashMap(); + + for (Vertex v : top_vertices){ + GatePins gate = pin_map.get(v); + + while (gate.hasNextPin()){ + Pin next_pin = gate.getNextPin(v); + if (next_pin.empty() || next_pin.hasNet()) continue; + + Net net = new Net(); + nets.put(net.id, net); + net.addPin(next_pin, false); + + for (Vertex next_vertex : v.getNext()){ + net.addPin(pin_map.get(next_vertex).getNextPin(v), false); + } + } + } + + for (Vertex v : bottom_vertices){ + GatePins gate = pin_map.get(v); + + while (gate.hasNextPin()){ + Pin next_pin = gate.getNextPin(v); + if (next_pin.empty() || next_pin.hasNet()) continue; + + Net net = new Net(); + nets.put(net.id, net); + net.addPin(next_pin, false); + + for (Vertex next_vertex : v.getNext()){ + net.addPin(pin_map.get(next_vertex).getNextPin(v), false); + } + } + } + + return nets; + } + + public static Channel placeNets(HashMap nets, PinsArray pin_pairs){ + VerticalConstraintGraph vcg = new VerticalConstraintGraph(pin_pairs, nets); + + Channel channel = new Channel(); + channel.pinsArray = pin_pairs; + + while (!vcg.done()){ + for (PinPair pair : pin_pairs.getPairs()){ + + if (!pair.top.empty() && vcg.canRoute(pair.top.netID())){ + channel.findAvailableTrack(nets.get(pair.top.netID()), vcg); + vcg.routed(pair.top.netID()); + break; + } + + if (!pair.bot.empty() && vcg.canRoute(pair.bot.netID())){ + channel.findAvailableTrack(nets.get(pair.bot.netID()), vcg); + vcg.routed(pair.bot.netID()); + break; + } + } + } + + return channel; + + } + + public static void printPins(HashMap pin_map, ArrayList top_vertices, ArrayList bottom_vertices){ + String str = ""; + for (Vertex v : top_vertices){ + str += pin_map.get(v).printPins() + "|"; + } + + System.out.println(str + "\n"); + + str = ""; + + for (Vertex v : bottom_vertices){ + str += pin_map.get(v).printPins() + "|"; + } + + System.out.println(str + "\n"); + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/EmptyPin.java b/src/main/java/minecrafthdl/synthesis/routing/pins/EmptyPin.java new file mode 100644 index 0000000..7f9c445 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/EmptyPin.java @@ -0,0 +1,21 @@ +package minecrafthdl.synthesis.routing.pins; + +import minecrafthdl.MHDLException; + +/** + * Created by Francis O'Brien - 3/4/2017 - 5:41 AM + */ + +public class EmptyPin extends Pin { + public EmptyPin(int x, boolean top) { + super(x, top); + } + + public void setNet(int net_id, boolean out_net){ + throw new MHDLException("Cant set net of empty pin"); + } + + public boolean empty(){ + return true; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/GatePins.java b/src/main/java/minecrafthdl/synthesis/routing/pins/GatePins.java new file mode 100644 index 0000000..c240229 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/GatePins.java @@ -0,0 +1,80 @@ +package minecrafthdl.synthesis.routing.pins; + +import MinecraftGraph.Vertex; +import minecrafthdl.MHDLException; +import minecrafthdl.synthesis.Gate; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 3/3/2017 - 9:43 AM + */ + +public class GatePins { + + private final Vertex vertex; + protected ArrayList pins = new ArrayList(); + + protected int next_free_input_pin = 0; + protected int next_free_output_pin = 0; + + protected int gate_width; + protected int offset; + protected boolean top; + + public GatePins(Gate g, Vertex v, int offset, boolean top){ + this.vertex = v; + this.offset = offset; + this.top = top; + this.gate_width = g.getSizeX(); + + if (top){ + for(int i = 0; i < g.num_outputs; i++){ + pins.add(new Pin(offset + (i * (1 + g.output_spacing)), true)); + } + } else { + for(int i = 0; i < g.num_inputs; i++){ + pins.add(new Pin(offset + (i * (1 + g.input_spacing)), false)); + } + } + } + + public ArrayList getPins(){ + return this.pins; + } + + public boolean hasNet(int net_id){ + for (Pin p : this.pins) { + if (p.netID() == net_id) return true; + } + return false; + } + + public Pin getNextPin(Vertex v){ + if (next_free_input_pin == this.pins.size()) { + throw new MHDLException("To many input pins requested from gate"); + } + + this.next_free_input_pin += 1; + return pins.get(this.next_free_input_pin - 1); + } + + public boolean hasNextPin(){ + return next_free_input_pin < this.pins.size(); + } + + public String printPins(){ + String str = ""; + for (int i = 0; i < gate_width; i++) { + str += "."; + } + + for(Pin p : pins){ + if(p.x - offset == 0) str = 'x' + str.substring(p.x - offset + 1); + else if (p.x - offset == gate_width - 1) str = str.substring(0, p.x - offset) + 'x'; + else str = str.substring(0, p.x - offset) + 'x' + str.substring(p.x - offset + 1); + } + + return str; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/MuxPins.java b/src/main/java/minecrafthdl/synthesis/routing/pins/MuxPins.java new file mode 100644 index 0000000..5239f98 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/MuxPins.java @@ -0,0 +1,55 @@ +package minecrafthdl.synthesis.routing.pins; + +import MinecraftGraph.*; +import minecrafthdl.MHDLException; +import minecrafthdl.synthesis.Gate; + +/** + * Created by Francis O'Brien - 4/7/2017 - 5:28 + */ + +public class MuxPins extends GatePins { + MuxVertex mux_v; + + boolean a_requested = false; + boolean b_requested = false; + boolean s_requested = false; + + public MuxPins(Gate g, Vertex v, int offset, boolean top) { + super(g, v, offset, top); + if (v.type == VertexType.FUNCTION && ((Function)v).func_type == FunctionType.MUX){ + this.mux_v = (MuxVertex)v; + } else { + throw new MHDLException("CANT MAKE MUX PINS WITH NON_MUX VERTEX"); + } + } + + @Override + public Pin getNextPin(Vertex v){ + this.next_free_input_pin += 1; + if (v == this.mux_v.a_vertex) { + if (!a_requested){ + this.a_requested = true; + return this.pins.get(0); + } + else throw new RuntimeException("A PIN ALREADY REQUESTED"); + } + else if (v == this.mux_v.b_vertex) { + if (!b_requested){ + this.b_requested = true; + return this.pins.get(2); + } + else throw new RuntimeException("B PIN ALREADY REQUESTED"); + } + else if (v == this.mux_v.s_vertex) { + if (!s_requested){ + this.s_requested = true; + return this.pins.get(1); + } + else throw new RuntimeException("S PIN ALREADY REQUESTED"); + } + else { + throw new RuntimeException("INPUT PIN MUST BE REQUESTED BY A VALID VERTEX"); + } + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/Pin.java b/src/main/java/minecrafthdl/synthesis/routing/pins/Pin.java new file mode 100644 index 0000000..9b560df --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/Pin.java @@ -0,0 +1,41 @@ +package minecrafthdl.synthesis.routing.pins; + +import minecrafthdl.MHDLException; + +/** + * Created by Francis on 2/22/2017. + */ +public class Pin { + int x; + int net = -1; + public boolean top; + + public Pin(int x, boolean top){ + this.x = x; + this.top = top; + } + + public void setNet(int net_id, boolean out_net){ + if (!out_net && this.net != -1) { + throw new MHDLException("Should not assign pin to two different nets"); + } + + this.net = net_id; + } + + public int xPos(){ + return this.x; + } + + public int netID(){ + return this.net; + } + + public boolean empty(){ + return false; + } + + public boolean hasNet() { + return this.netID() != -1; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/PinPair.java b/src/main/java/minecrafthdl/synthesis/routing/pins/PinPair.java new file mode 100644 index 0000000..d3216a0 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/PinPair.java @@ -0,0 +1,15 @@ +package minecrafthdl.synthesis.routing.pins; + +/** + * Created by Francis O'Brien - 3/4/2017 - 6:36 AM + */ + +public class PinPair { + public Pin top, bot; + + public PinPair(int x){ + this.top = new EmptyPin(x, true); + this.bot = new EmptyPin(x, false); + } + +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/pins/PinsArray.java b/src/main/java/minecrafthdl/synthesis/routing/pins/PinsArray.java new file mode 100644 index 0000000..af95157 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/pins/PinsArray.java @@ -0,0 +1,58 @@ +package minecrafthdl.synthesis.routing.pins; + +import minecrafthdl.MHDLException; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 3/4/2017 - 5:37 AM + */ + +public class PinsArray { + ArrayList pairs; + + public PinsArray() { + pairs = new ArrayList(); + } + + + public void addPin(Pin p, boolean top) { + int index = p.x / 2; + int difference = index - this.pairs.size(); + + if (difference >= 0){ + for (int i = 0; i < difference; i++){ + this.pairs.add(new PinPair(this.pairs.size() * 2)); + } + PinPair new_pair = new PinPair(this.pairs.size() * 2); + if(top) new_pair.top = p; + else new_pair.bot = p; + + this.pairs.add(new_pair); + } else { + PinPair pair = this.pairs.get(index); + + if(top){ + if (pair.top.empty()) pair.top = p; + else throw new MHDLException("Attempting to overwrite pin in pair"); + } else { + if (pair.bot.empty()) pair.bot = p; + else throw new MHDLException("Attempting to overwrite pin in pair"); + } + } + } + + public int addEmptyPair(){ + int x = this.pairs.size() * 2; + this.pairs.add(new PinPair(x)); + return x; + } + + public PinPair getPair(int index){ + return this.pairs.get(index); + } + + public ArrayList getPairs(){ + return this.pairs; + } +} diff --git a/src/main/java/minecrafthdl/synthesis/routing/vcg/VerticalConstraintGraph.java b/src/main/java/minecrafthdl/synthesis/routing/vcg/VerticalConstraintGraph.java new file mode 100644 index 0000000..a743612 --- /dev/null +++ b/src/main/java/minecrafthdl/synthesis/routing/vcg/VerticalConstraintGraph.java @@ -0,0 +1,140 @@ +package minecrafthdl.synthesis.routing.vcg; + +import minecrafthdl.MHDLException; +import org.apache.commons.lang3.tuple.ImmutablePair; +import minecrafthdl.synthesis.routing.Net; +import minecrafthdl.synthesis.routing.pins.PinPair; +import minecrafthdl.synthesis.routing.pins.PinsArray; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * Created by Francis O'Brien - 3/4/2017 - 9:29 AM + */ + +public class VerticalConstraintGraph { + + int num_nets_routed = 0; + ArrayList> edges_done = new ArrayList>(); + + public int[] getEdgeIDList(int id) { + Node n = nodes.get(id); + + int[] vc_ids = new int[n.edges.size()]; + + for (int i = 0; i < n.edges.size(); i++){ + vc_ids[i] = n.edges.get(i).to.net_id; + } + + return vc_ids; + } + + private static class Node { + public boolean routed = false; + public ArrayList edges = new ArrayList(); + + int net_id; + + public Node(int net_id){ + this.net_id = net_id; + } + } + + private static class Edge { + public Node to; + + public Edge(Node to){ + this.to = to; + } + } + + private HashMap nodes = new HashMap(); + + public VerticalConstraintGraph(PinsArray pin_pairs, HashMap nets) { + ArrayList original_pairs = new ArrayList(pin_pairs.getPairs()); + for(PinPair pair : original_pairs){ + if (!pair.top.empty()){ + if(!this.nodes.containsKey(pair.top.netID())) this.nodes.put(pair.top.netID(), new Node(pair.top.netID())); + } + + if (!pair.bot.empty()){ + if(!this.nodes.containsKey(pair.bot.netID())) this.nodes.put(pair.bot.netID(), new Node(pair.bot.netID())); + } + + if (!pair.top.empty() && !pair.bot.empty() && pair.top.netID() != pair.bot.netID()) { + + if(edgeDone(pair.top.netID(), pair.bot.netID())) continue; + + if (!cycle(this.nodes.get(pair.top.netID()), pair.bot.netID())){ + this.nodes.get(pair.bot.netID()).edges.add(new Edge(this.nodes.get(pair.top.netID()))); + this.edges_done.add(new ImmutablePair(pair.top.netID(), pair.bot.netID())); + } else { + Net out_net = new Net(); + Net out_partner = nets.get(pair.top.netID()); + + out_net.setOutNet(pair.top, out_partner); + + int x_max = out_net.AssignOutColX(pin_pairs.addEmptyPair()); + + out_partner.newXMax(x_max); + + nets.put(out_net.getId(), out_net); + + Node out_node = new Node(out_net.getId()); + this.nodes.put(out_net.getId(), out_node); + this.nodes.get(pair.bot.netID()).edges.add(new Edge(out_node)); + this.edges_done.add(new ImmutablePair(pair.top.netID(), pair.bot.netID())); + } + + } + } + System.out.println(); + } + + public boolean edgeDone(int top, int bot){ + for (ImmutablePair pair : this.edges_done){ + if (pair.getKey() == top && pair.getValue() == bot) return true; + } + + return false; + } + + public static boolean cycle(Node n, int cycle_id){ + if (cycle_id == 1){ + System.out.println(""); + + } + if (n.net_id == cycle_id) return true; + for (Edge e : n.edges){ + if (cycle(e.to, cycle_id)){ + return true; + } + } + return false; + } + + + public boolean canRoute(int netID){ + Node n = this.nodes.get(netID); + + if (n.routed) return false; + + for (Edge e : n.edges){ + if(!e.to.routed) return false; + } + return true; + } + + public void routed(int netID){ + if (this.nodes.get(netID).routed) throw new MHDLException("Routed same net twice"); + + this.nodes.get(netID).routed = true; + this.num_nets_routed++; + } + + public boolean done(){ + return this.nodes.values().size() == this.num_nets_routed; + } + +} diff --git a/src/main/java/minecrafthdl/testing/RouterTesting.java b/src/main/java/minecrafthdl/testing/RouterTesting.java new file mode 100644 index 0000000..3f34dca --- /dev/null +++ b/src/main/java/minecrafthdl/testing/RouterTesting.java @@ -0,0 +1,25 @@ +package minecrafthdl.testing; + +import minecrafthdl.Demo; +import minecrafthdl.synthesis.Circuit; +import minecrafthdl.synthesis.IntermediateCircuit; + +/** + * Created by Francis O'Brien - 3/4/2017 - 1:54 AM + */ + +public class RouterTesting { + + public static void main(String[] args){ + Circuit.TEST = true; + IntermediateCircuit ic = new IntermediateCircuit(); + ic.loadGraph(Demo.create4bitmuxgraph()); + ic.buildGates(); + ic.printLayers(); + ic.routeChannels(); + ic.channels.get(1).genChannelCircuit(); + } + + + +} diff --git a/src/main/java/minecrafthdl/testing/TestGate.java b/src/main/java/minecrafthdl/testing/TestGate.java new file mode 100644 index 0000000..0e175cb --- /dev/null +++ b/src/main/java/minecrafthdl/testing/TestGate.java @@ -0,0 +1,45 @@ +package minecrafthdl.testing; + +import minecrafthdl.synthesis.Gate; + +import java.util.ArrayList; + +/** + * Created by Francis O'Brien - 3/4/2017 - 2:31 AM + */ + +public class TestGate extends Gate { + + private ArrayList>> sblocks; + + public TestGate(int sizeX, int sizeY, int sizeZ, int num_inputs, int num_outputs, int input_spacing, int output_spacing, int[] output_lines) { + super(sizeX, sizeY, sizeZ, num_inputs, num_outputs, input_spacing, output_spacing, output_lines); + + this.sblocks = new ArrayList>>(); + for (int x = 0; x < sizeX; x++) { + this.sblocks.add(new ArrayList>()); + for (int y = 0; y < sizeY; y++) { + this.sblocks.get(x).add(new ArrayList()); + for (int z = 0; z < sizeZ; z++) { + this.sblocks.get(x).get(y).add("."); + } + } + } + } + + public void setBlock(int x, int y, int z, String blockstate) { + this.sblocks.get(x).get(y).set(z, blockstate); + } + + public void printGate(){ + for(int y = 0; y < this.getSizeX(); y++) { + for (int z = 0; z < this.getSizeX(); z++) { + for(int x = 0; x < this.getSizeX(); x++){ + System.out.print(this.sblocks.get(x).get(y).get(z)); + } + System.out.print("\n"); + } + System.out.print("\n"); + } + } +} diff --git a/src/main/java/minecrafthdl/testing/TestLogicGates.java b/src/main/java/minecrafthdl/testing/TestLogicGates.java new file mode 100644 index 0000000..696c13b --- /dev/null +++ b/src/main/java/minecrafthdl/testing/TestLogicGates.java @@ -0,0 +1,110 @@ +package minecrafthdl.testing; + +import minecrafthdl.Demo; +import minecrafthdl.MHDLException; +import minecrafthdl.synthesis.Gate; +import minecrafthdl.synthesis.IntermediateCircuit; +import minecrafthdl.synthesis.LogicGates; + +/** + * Created by Francis O'Brien - 3/4/2017 - 2:35 AM + */ + +public class TestLogicGates extends LogicGates { + + + + public static void main(String[] args) { + IntermediateCircuit ic = new IntermediateCircuit(); + ic.loadGraph(Demo.create4bitmuxgraph()); + ic.printLayers(); + } + + public static Gate IO(){ + TestGate gate = new TestGate(1, 1, 1, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, "x"); + return gate; + } + + public static Gate NOT(){ + TestGate gate = new TestGate(1, 1, 5, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, "x"); + gate.setBlock(0, 0, 1, "i"); + gate.setBlock(0, 0, 2, "*"); + gate.setBlock(0, 0, 3, "*"); + gate.setBlock(0, 0, 4, "x"); + return gate; + } + + public static Gate RELAY(){ + TestGate gate = new TestGate(1, 1, 5, 1, 1, 0, 0, new int[]{0}); + gate.setBlock(0, 0, 0, "x"); + gate.setBlock(0, 0, 1, "*"); + gate.setBlock(0, 0, 2, ">"); + gate.setBlock(0, 0, 3, "*"); + gate.setBlock(0, 0, 4, "x"); + return gate; + } + + public static Gate AND(int inputs) { + if (inputs == 0) throw new MHDLException("Gate cannot have 0 inputs"); + int width; + if (inputs == 1) width = 1; + + else width = (inputs * 2) - 1; + + TestGate gate = new TestGate(width, 2, 5, inputs, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 2, "i"); + gate.setBlock(0, 0, 3, "*"); + gate.setBlock(0, 0, 4, "x"); + + for (int i = 0; i < width; i+=2) { + gate.setBlock(i, 0, 0, "x"); + gate.setBlock(i, 0, 1, "x"); + gate.setBlock(i, 1, 0, "i"); + gate.setBlock(i, 1, 1, "*"); + + if (i != width - 1) { + gate.setBlock(i + 1, 0, 1, "x"); + if (i == 14) { + gate.setBlock(i + 1, 1, 1, ">"); + } else { + gate.setBlock(i + 1, 1, 1, "*"); + } + } + } + + return gate; + } + + + + public static Gate OR(int inputs) { + if (inputs == 0) throw new MHDLException("Gate cannot have 0 inputs"); + int width; + if (inputs == 1) width = 1; + else width = (inputs * 2) - 1; + + TestGate gate = new TestGate(width, 2, 5, inputs, 1, 1, 0, new int[]{0}); + + gate.setBlock(0, 0, 3, "*"); + gate.setBlock(0, 0, 4, "x"); + + for (int i = 0; i < width; i+=2) { + gate.setBlock(i, 0, 0, "x"); + gate.setBlock(i, 0, 1, ">"); + gate.setBlock(i, 0, 2, "*"); + if (i != width - 1) { + if (i == 14) { + gate.setBlock(i + 1, 0, 2, ">"); + } else { + gate.setBlock(i + 1, 0, 2, "*"); + } + } + } + return gate; + } + + +} diff --git a/src/main/resources/assets/minecrafthdl/blockstates/synthesizer.json b/src/main/resources/assets/minecrafthdl/blockstates/synthesizer.json new file mode 100644 index 0000000..eacf4fa --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/blockstates/synthesizer.json @@ -0,0 +1,10 @@ +{ + "variants": { + "triggered=true": { + "model": "minecrafthdl:synthesizer" + }, + "triggered=false": { + "model": "minecrafthdl:synthesizer" + } + } +} diff --git a/src/main/resources/assets/minecrafthdl/blockstates/tutorial_block.json b/src/main/resources/assets/minecrafthdl/blockstates/tutorial_block.json new file mode 100644 index 0000000..7fea26a --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/blockstates/tutorial_block.json @@ -0,0 +1,10 @@ +{ + "variants": { + "triggered=true": { + "model": "minecrafthdl:tutorial_block" + }, + "triggered=false": { + "model": "minecrafthdl:tutorial_block" + } + } +} diff --git a/src/main/resources/assets/minecrafthdl/models/block/synthesizer.json b/src/main/resources/assets/minecrafthdl/models/block/synthesizer.json new file mode 100644 index 0000000..8540b47 --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/models/block/synthesizer.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "minecrafthdl:blocks/synthesizer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/minecrafthdl/models/block/tutorial_block.json b/src/main/resources/assets/minecrafthdl/models/block/tutorial_block.json new file mode 100644 index 0000000..3ecaa20 --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/models/block/tutorial_block.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "minecrafthdl:blocks/tutorial_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/minecrafthdl/models/item/synthesizer.json b/src/main/resources/assets/minecrafthdl/models/item/synthesizer.json new file mode 100644 index 0000000..2102e28 --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/models/item/synthesizer.json @@ -0,0 +1,10 @@ +{ + "parent":"minecrafthdl:block/synthesizer", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/minecrafthdl/models/item/tutorial_block.json b/src/main/resources/assets/minecrafthdl/models/item/tutorial_block.json new file mode 100644 index 0000000..de181d2 --- /dev/null +++ b/src/main/resources/assets/minecrafthdl/models/item/tutorial_block.json @@ -0,0 +1,10 @@ +{ + "parent":"minecrafthdl:block/tutorial_block", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/minecrafthdl/textures/blocks/synthesizer.png b/src/main/resources/assets/minecrafthdl/textures/blocks/synthesizer.png new file mode 100644 index 0000000..5d2500c Binary files /dev/null and b/src/main/resources/assets/minecrafthdl/textures/blocks/synthesizer.png differ diff --git a/src/main/resources/assets/minecrafthdl/textures/blocks/tutorial_block.png b/src/main/resources/assets/minecrafthdl/textures/blocks/tutorial_block.png new file mode 100644 index 0000000..5d2500c Binary files /dev/null and b/src/main/resources/assets/minecrafthdl/textures/blocks/tutorial_block.png differ diff --git a/src/main/resources/assets/minecrafthdl/textures/gui/synthesiser.png b/src/main/resources/assets/minecrafthdl/textures/gui/synthesiser.png new file mode 100644 index 0000000..106288f Binary files /dev/null and b/src/main/resources/assets/minecrafthdl/textures/gui/synthesiser.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..b6adf70 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "minecrafthdl", + "name": "Minecraft HDL", + "description": "Hardware synthesis for Minecraft", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "", + "updateUrl": "", + "authorList": ["itsfrank"], + "credits": "Professor Brett H Meyer and McGill University", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/src/main/tests/Verilogfiles/and.v b/src/main/tests/Verilogfiles/and.v new file mode 100644 index 0000000..c6330a4 --- /dev/null +++ b/src/main/tests/Verilogfiles/and.v @@ -0,0 +1,7 @@ +module AND(a, b, c, d); + +input a, b, c; +output d; +assign d=a&b&c; + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/counter.v b/src/main/tests/Verilogfiles/counter.v new file mode 100644 index 0000000..3ee705c --- /dev/null +++ b/src/main/tests/Verilogfiles/counter.v @@ -0,0 +1,24 @@ +//module counter +// bits simple counter +//with enable and reset + +module counter( +out, +enable, +reset, +clk +); +output [7:0] out; +input enable, reset, clk; +reg [7:0] out; + +always @(posedge clk) +if (reset) begin + out<=8'b0; +end +else if (enable) begin + out<=out+1; +end + + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/multiplexer.v b/src/main/tests/Verilogfiles/multiplexer.v new file mode 100644 index 0000000..209ac10 --- /dev/null +++ b/src/main/tests/Verilogfiles/multiplexer.v @@ -0,0 +1,17 @@ +module mux(a, b, sel, out ); + +input a,b, sel; +output out; + +always @(a, b, sel) + +if (sel) begin + out<=a; +end +else begin + out<=b; +end + + +endmodule + diff --git a/src/main/tests/Verilogfiles/onebitadder.v b/src/main/tests/Verilogfiles/onebitadder.v new file mode 100644 index 0000000..eb8d56a --- /dev/null +++ b/src/main/tests/Verilogfiles/onebitadder.v @@ -0,0 +1,21 @@ +module veriglLearn( + input a, input b, + input cin, + output cout, + output sum); + + + wire x, y; + //adder xor gates + xor G1(sum, a, b, cin); + and G2(x, a, b); + and G3(y, sum, cin); + or G4(cout, x, y); + + + + + + + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/or.v b/src/main/tests/Verilogfiles/or.v new file mode 100644 index 0000000..bdc7acf --- /dev/null +++ b/src/main/tests/Verilogfiles/or.v @@ -0,0 +1,5 @@ +module OR(a, b, c, out); +input a, b, c; +output out; +OR G1(out, a, b, c); +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/test1.v b/src/main/tests/Verilogfiles/test1.v new file mode 100644 index 0000000..373265a --- /dev/null +++ b/src/main/tests/Verilogfiles/test1.v @@ -0,0 +1,7 @@ +module test12(a, b, c, d, e, f, g, h, out); + +input a, b, c,d, e,f,g,h; +output out; +assign out=a&b&c&d&e&f&g&h; + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/test23.v b/src/main/tests/Verilogfiles/test23.v new file mode 100644 index 0000000..4378dc7 --- /dev/null +++ b/src/main/tests/Verilogfiles/test23.v @@ -0,0 +1,15 @@ +//test multiple different gates + +module test(a, b, c, d, out); + input a, b, c, d; + output out; + wire x, y, z, w; + assign x=a&b; + assign y=c&d; + assign z=x&y; + assign w=x&y; + + assign out=z&w; + + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/test33.v b/src/main/tests/Verilogfiles/test33.v new file mode 100644 index 0000000..ce3a291 --- /dev/null +++ b/src/main/tests/Verilogfiles/test33.v @@ -0,0 +1,11 @@ +//test when can not merge + +module test(a, b, c, d, out1, out2); + input a, b, c, d; + output out1, out2; + wire x; + assign x=a&b; + assign out1=x&c; + assign out2=x|d; + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/testAND.v b/src/main/tests/Verilogfiles/testAND.v new file mode 100644 index 0000000..85d5558 --- /dev/null +++ b/src/main/tests/Verilogfiles/testAND.v @@ -0,0 +1,4 @@ +module testAND(input a, input b, output c); +AND G1(c, a, b); +endmodule + diff --git a/src/main/tests/Verilogfiles/testAO.v b/src/main/tests/Verilogfiles/testAO.v new file mode 100644 index 0000000..b215514 --- /dev/null +++ b/src/main/tests/Verilogfiles/testAO.v @@ -0,0 +1,13 @@ +//test multiple different gates + +module test(a, b, c, d, e, f, g, out); + input a, b, c, d, e, f, g; + output out; + wire x, y, z; + assign x=a&b&c; + assign y=x|d; + assign z=x&g; + assign out=z|y|f&a; + + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/testMajority.v b/src/main/tests/Verilogfiles/testMajority.v new file mode 100644 index 0000000..1ec5aea --- /dev/null +++ b/src/main/tests/Verilogfiles/testMajority.v @@ -0,0 +1,8 @@ +module testMajority(a, b, c, d); +input a, b, c; +output d; + +assign d=(a&c)|(a&b)|(b&c); + + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/test_arrays.v b/src/main/tests/Verilogfiles/test_arrays.v new file mode 100644 index 0000000..e542e1a --- /dev/null +++ b/src/main/tests/Verilogfiles/test_arrays.v @@ -0,0 +1,8 @@ +module test(a, b); + +input [3:0]a; +output [1:0]b; +assign b[0]=a[0]&a[2]; +assign b[1]=a[1] | a[3]; + +endmodule \ No newline at end of file diff --git a/src/main/tests/Verilogfiles/test_pattern.v b/src/main/tests/Verilogfiles/test_pattern.v new file mode 100644 index 0000000..ae95af0 --- /dev/null +++ b/src/main/tests/Verilogfiles/test_pattern.v @@ -0,0 +1,62 @@ +module test(in, clk, out); + +input in, clk; +output out; +reg out; + +parameter ONE=2'b00, TWO=2'b01, THREE=2'b10; +reg [1:0] state; +wire [1:0] next_state; + +assign next_state=fsm_state(state, in); + +function [1:0] fsm_state; + + input [1:0] state; + input in; + case(state) + ONE: if(in==1'b1) begin + fsm_state=ONE; + end + else begin + fsm_state=TWO; + end + TWO: if (in==1'b1) begin + fsm_state=ONE; + end + else begin + fsm_state=THREE; + end + THREE: if(in==1'b1) begin + fsm_state=THREE; + end + else begin + fsm_state=ONE; + end + default: fsm_state=ONE; //shoud never be accessed + endcase + endfunction +//define states + +always @(posedge clk) +begin +state<=next_state; +end + + +always @(posedge clk) +begin + +case(state) +ONE: out<=#1 1'b0; +TWO: out<=#1 1'b0; +THREE: out<=#1 1'b1; +default: out<=#1 1'b0; + +endcase + +end + + + +endmodule \ No newline at end of file diff --git a/src/main/tests/json b/src/main/tests/json new file mode 100644 index 0000000..e69de29 diff --git a/src/main/tests/json files/and.json b/src/main/tests/json files/and.json new file mode 100644 index 0000000..f7c700b --- /dev/null +++ b/src/main/tests/json files/and.json @@ -0,0 +1,981 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "AND": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "output", + "bits": [ 5 ] + } + }, + "cells": { + "$and$tests/and.v:5$630": { + "hide_name": 1, + "type": "$and", + "parameters": { + "A_SIGNED": 0, + "A_WIDTH": 1, + "B_SIGNED": 0, + "B_WIDTH": 1, + "Y_WIDTH": 1 + }, + "attributes": { + "src": "tests/and.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 6 ] + } + }, + "$and$tests/and.v:5$631": { + "hide_name": 1, + "type": "$and", + "parameters": { + "A_SIGNED": 0, + "A_WIDTH": 1, + "B_SIGNED": 0, + "B_WIDTH": 1, + "Y_WIDTH": 1 + }, + "attributes": { + "src": "tests/and.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 4 ], + "Y": [ 5 ] + } + } + }, + "netnames": { + "$and$tests/and.v:5$630_Y": { + "hide_name": 1, + "bits": [ 6 ], + "attributes": { + "src": "tests/and.v:5" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/and.v:3" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/and.v:3" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/and.v:3" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/and.v:4" + } + } + } + }, + "counter": { + "ports": { + "out": { + "direction": "output", + "bits": [ 2, 3, 4, 5, 6, 7, 8, 9 ] + }, + "enable": { + "direction": "input", + "bits": [ 10 ] + }, + "reset": { + "direction": "input", + "bits": [ 11 ] + }, + "clk": { + "direction": "input", + "bits": [ 12 ] + } + }, + "cells": { + "$auto$simplemap.cc:277:simplemap_mux$57": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 13 ], + "S": [ 10 ], + "Y": [ 14 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$58": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 15 ], + "S": [ 10 ], + "Y": [ 16 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$59": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 17 ], + "S": [ 10 ], + "Y": [ 18 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$60": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 19 ], + "S": [ 10 ], + "Y": [ 20 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$61": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 21 ], + "S": [ 10 ], + "Y": [ 22 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$62": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 23 ], + "S": [ 10 ], + "Y": [ 24 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$63": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 25 ], + "S": [ 10 ], + "Y": [ 26 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$64": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 9 ], + "B": [ 27 ], + "S": [ 10 ], + "Y": [ 28 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$65": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 29 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$66": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 30 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$67": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 18 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 31 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$68": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 20 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 32 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$69": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 22 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 33 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$70": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 24 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 34 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$71": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 26 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 35 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$72": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 28 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 36 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$73": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 29 ], + "Q": [ 2 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$74": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 30 ], + "Q": [ 3 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$75": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 31 ], + "Q": [ 4 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$76": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 32 ], + "Q": [ 5 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$77": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 33 ], + "Q": [ 6 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$78": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 34 ], + "Q": [ 7 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$79": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 35 ], + "Q": [ 8 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$80": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 36 ], + "Q": [ 9 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$119": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 2 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$120": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 37 ], + "Y": [ 17 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$121": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 38 ], + "Y": [ 19 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$122": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 39 ], + "Y": [ 21 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$123": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 40 ], + "Y": [ 23 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$124": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 41 ], + "Y": [ 25 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$125": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 9 ], + "B": [ 42 ], + "Y": [ 27 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$489": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:221" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 2 ], + "Y": [ 37 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$505": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:221" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 43 ], + "B": [ 37 ], + "Y": [ 39 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$520": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:222" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 4 ], + "Y": [ 43 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$521": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:222" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 6 ], + "Y": [ 44 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$550": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 44 ], + "B": [ 39 ], + "Y": [ 41 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$557": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 37 ], + "Y": [ 38 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$558": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 39 ], + "Y": [ 40 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$559": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 41 ], + "Y": [ 42 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$86": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":262" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ "1" ], + "Y": [ 13 ] + } + } + }, + "netnames": { + "$0\\out[7:0]": { + "hide_name": 1, + "bits": [ 29, 30, 31, 32, 33, 34, 35, 36 ], + "attributes": { + "src": "tests/counter.v:15" + } + }, + "$add$tests/counter.v:20$2_Y": { + "hide_name": 1, + "bits": [ 13, 15, 17, 19, 21, 23, 25, 27, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 ], + "attributes": { + "src": "tests/counter.v:20" + } + }, + "$procmux$4_Y": { + "hide_name": 1, + "bits": [ 14, 16, 18, 20, 22, 24, 26, 28 ], + "attributes": { + } + }, + "$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.g": { + "hide_name": 1, + "bits": [ 69, 37, 38, 39, 40, 41, 42, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 ], + "attributes": { + "src": ":260|:203" + } + }, + "$techmap$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.$and$:222$258_Y": { + "hide_name": 1, + "bits": [ 43 ], + "attributes": { + "src": ":260|:222" + } + }, + "$techmap$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.$and$:222$261_Y": { + "hide_name": 1, + "bits": [ 44 ], + "attributes": { + "src": ":260|:222" + } + }, + "clk": { + "hide_name": 0, + "bits": [ 12 ], + "attributes": { + "src": "tests/counter.v:12" + } + }, + "enable": { + "hide_name": 0, + "bits": [ 10 ], + "attributes": { + "src": "tests/counter.v:12" + } + }, + "out": { + "hide_name": 0, + "bits": [ 2, 3, 4, 5, 6, 7, 8, 9 ], + "attributes": { + "src": "tests/counter.v:11" + } + }, + "reset": { + "hide_name": 0, + "bits": [ 11 ], + "attributes": { + "src": "tests/counter.v:12" + } + } + } + } + } +} diff --git a/src/main/tests/json files/counter.json b/src/main/tests/json files/counter.json new file mode 100644 index 0000000..9cedd21 --- /dev/null +++ b/src/main/tests/json files/counter.json @@ -0,0 +1,874 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "counter": { + "ports": { + "out": { + "direction": "output", + "bits": [ 2, 3, 4, 5, 6, 7, 8, 9 ] + }, + "enable": { + "direction": "input", + "bits": [ 10 ] + }, + "reset": { + "direction": "input", + "bits": [ 11 ] + }, + "clk": { + "direction": "input", + "bits": [ 12 ] + } + }, + "cells": { + "$auto$simplemap.cc:277:simplemap_mux$57": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 13 ], + "S": [ 10 ], + "Y": [ 14 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$58": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 15 ], + "S": [ 10 ], + "Y": [ 16 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$59": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 17 ], + "S": [ 10 ], + "Y": [ 18 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$60": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 19 ], + "S": [ 10 ], + "Y": [ 20 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$61": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 21 ], + "S": [ 10 ], + "Y": [ 22 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$62": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 23 ], + "S": [ 10 ], + "Y": [ 24 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$63": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 25 ], + "S": [ 10 ], + "Y": [ 26 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$64": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 9 ], + "B": [ 27 ], + "S": [ 10 ], + "Y": [ 28 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$65": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 29 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$66": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 30 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$67": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 18 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 31 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$68": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 20 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 32 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$69": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 22 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 33 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$70": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 24 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 34 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$71": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 26 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 35 ] + } + }, + "$auto$simplemap.cc:277:simplemap_mux$72": { + "hide_name": 1, + "type": "$_MUX_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "S": "input", + "Y": "output" + }, + "connections": { + "A": [ 28 ], + "B": [ "0" ], + "S": [ 11 ], + "Y": [ 36 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$73": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 29 ], + "Q": [ 2 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$74": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 30 ], + "Q": [ 3 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$75": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 31 ], + "Q": [ 4 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$76": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 32 ], + "Q": [ 5 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$77": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 33 ], + "Q": [ 6 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$78": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 34 ], + "Q": [ 7 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$79": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 35 ], + "Q": [ 8 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$80": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/counter.v:15" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 12 ], + "D": [ 36 ], + "Q": [ 9 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$119": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 2 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$120": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 37 ], + "Y": [ 17 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$121": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 38 ], + "Y": [ 19 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$122": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 39 ], + "Y": [ 21 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$123": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 40 ], + "Y": [ 23 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$124": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 41 ], + "Y": [ 25 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$125": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":263" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 9 ], + "B": [ 42 ], + "Y": [ 27 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$489": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:221" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 2 ], + "Y": [ 37 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$505": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:221" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 43 ], + "B": [ 37 ], + "Y": [ 39 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$520": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:222" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 4 ], + "Y": [ 43 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$521": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:222" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 6 ], + "Y": [ 44 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$550": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 44 ], + "B": [ 39 ], + "Y": [ 41 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$557": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 37 ], + "Y": [ 38 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$558": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 6 ], + "B": [ 39 ], + "Y": [ 40 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$559": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": ":260|:229" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 41 ], + "Y": [ 42 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$86": { + "hide_name": 1, + "type": "$_XOR_", + "parameters": { + }, + "attributes": { + "src": ":262" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ "1" ], + "Y": [ 13 ] + } + } + }, + "netnames": { + "$0\\out[7:0]": { + "hide_name": 1, + "bits": [ 29, 30, 31, 32, 33, 34, 35, 36 ], + "attributes": { + "src": "tests/counter.v:15" + } + }, + "$add$tests/counter.v:20$2_Y": { + "hide_name": 1, + "bits": [ 13, 15, 17, 19, 21, 23, 25, 27, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 ], + "attributes": { + "src": "tests/counter.v:20" + } + }, + "$procmux$4_Y": { + "hide_name": 1, + "bits": [ 14, 16, 18, 20, 22, 24, 26, 28 ], + "attributes": { + } + }, + "$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.g": { + "hide_name": 1, + "bits": [ 69, 37, 38, 39, 40, 41, 42, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 ], + "attributes": { + "src": ":260|:203" + } + }, + "$techmap$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.$and$:222$258_Y": { + "hide_name": 1, + "bits": [ 43 ], + "attributes": { + "src": ":260|:222" + } + }, + "$techmap$techmap$add$tests/counter.v:20$2.$auto$alumacc.cc:470:replace_alu$54.lcu.$and$:222$261_Y": { + "hide_name": 1, + "bits": [ 44 ], + "attributes": { + "src": ":260|:222" + } + }, + "clk": { + "hide_name": 0, + "bits": [ 12 ], + "attributes": { + "src": "tests/counter.v:12" + } + }, + "enable": { + "hide_name": 0, + "bits": [ 10 ], + "attributes": { + "src": "tests/counter.v:12" + } + }, + "out": { + "hide_name": 0, + "bits": [ 2, 3, 4, 5, 6, 7, 8, 9 ], + "attributes": { + "src": "tests/counter.v:11" + } + }, + "reset": { + "hide_name": 0, + "bits": [ 11 ], + "attributes": { + "src": "tests/counter.v:12" + } + } + } + } + } +} diff --git a/src/main/tests/json files/multiplexer.json b/src/main/tests/json files/multiplexer.json new file mode 100644 index 0000000..093b2c4 --- /dev/null +++ b/src/main/tests/json files/multiplexer.json @@ -0,0 +1,64 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "mux": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "sel": { + "direction": "input", + "bits": [ 4 ] + }, + "out": { + "direction": "output", + "bits": [ 5 ] + } + }, + "cells": { + }, + "netnames": { + "$0\\out[0:0]": { + "hide_name": 1, + "bits": [ 6 ], + "attributes": { + "src": "tests/multiplexer.v:6" + } + }, + "out": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/multiplexer.v:4" + } + }, + "sel": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/multiplexer.v:3" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/multiplexer.v:3" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/multiplexer.v:3" + } + } + } + } + } +} diff --git a/src/main/tests/json files/or.json b/src/main/tests/json files/or.json new file mode 100644 index 0000000..5de1a87 --- /dev/null +++ b/src/main/tests/json files/or.json @@ -0,0 +1,78 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "OR": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "out": { + "direction": "output", + "bits": [ 5 ] + } + }, + "cells": { + "G1": { + "hide_name": 0, + "type": "OR", + "parameters": { + }, + "attributes": { + "src": "tests/or.v:4" + }, + "port_directions": { + "$4": "input", + "$3": "input", + "$2": "input", + "$1": "output" + }, + "connections": { + "$4": [ 4 ], + "$3": [ 3 ], + "$2": [ 2 ], + "$1": [ 5 ] + } + } + }, + "netnames": { + "out": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/or.v:3" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/or.v:2" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/or.v:2" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/or.v:2" + } + } + } + } + } +} diff --git a/src/main/tests/json files/pattern.json b/src/main/tests/json files/pattern.json new file mode 100644 index 0000000..ad6219b --- /dev/null +++ b/src/main/tests/json files/pattern.json @@ -0,0 +1,334 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test": { + "ports": { + "in": { + "direction": "input", + "bits": [ 2 ] + }, + "clk": { + "direction": "input", + "bits": [ 3 ] + }, + "out": { + "direction": "output", + "bits": [ 4 ] + } + }, + "cells": { + "$auto$simplemap.cc:136:simplemap_reduce$133": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 5 ], + "B": [ 6 ], + "Y": [ 7 ] + } + }, + "$auto$simplemap.cc:136:simplemap_reduce$138": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 9 ], + "Y": [ 10 ] + } + }, + "$auto$simplemap.cc:136:simplemap_reduce$140": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 11 ], + "B": [ 12 ], + "Y": [ 13 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$142": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 3 ], + "D": [ 10 ], + "Q": [ 12 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$143": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 3 ], + "D": [ 7 ], + "Q": [ 14 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$144": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 3 ], + "D": [ 15 ], + "Q": [ 11 ] + } + }, + "$auto$simplemap.cc:373:simplemap_dff$146": { + "hide_name": 1, + "type": "$_DFF_P_", + "parameters": { + }, + "attributes": { + "src": "tests/test_pattern.v:47" + }, + "port_directions": { + "C": "input", + "D": "input", + "Q": "output" + }, + "connections": { + "C": [ 3 ], + "D": [ 14 ], + "Q": [ 4 ] + } + }, + "$auto$simplemap.cc:37:simplemap_not$131": { + "hide_name": 1, + "type": "$_NOT_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "Y": [ 16 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$130": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ 12 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$134": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 14 ], + "Y": [ 6 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$135": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ 14 ], + "Y": [ 9 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$136": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ 11 ], + "Y": [ 5 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$141": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 13 ], + "Y": [ 8 ] + } + } + }, + "netnames": { + "$auto$fsm_map.cc:102:implement_pattern_cache$68": { + "hide_name": 1, + "bits": [ 13 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:118:implement_pattern_cache$64": { + "hide_name": 1, + "bits": [ 9 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:118:implement_pattern_cache$70": { + "hide_name": 1, + "bits": [ 8 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:118:implement_pattern_cache$75": { + "hide_name": 1, + "bits": [ 5 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:118:implement_pattern_cache$79": { + "hide_name": 1, + "bits": [ 6 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:118:implement_pattern_cache$84": { + "hide_name": 1, + "bits": [ 15 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:170:map_fsm$58": { + "hide_name": 1, + "bits": [ 10, 7, 17 ], + "attributes": { + } + }, + "$auto$fsm_map.cc:74:implement_pattern_cache$62": { + "hide_name": 1, + "bits": [ 16 ], + "attributes": { + } + }, + "clk": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/test_pattern.v:3" + } + }, + "in": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/test_pattern.v:3" + } + }, + "out": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/test_pattern.v:4" + } + }, + "state": { + "hide_name": 0, + "bits": [ 12, 14, 11 ], + "attributes": { + "onehot": 1 + } + } + } + } + } +} diff --git a/src/main/tests/json files/test12.json b/src/main/tests/json files/test12.json new file mode 100644 index 0000000..41a35ae --- /dev/null +++ b/src/main/tests/json files/test12.json @@ -0,0 +1,287 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test12": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "input", + "bits": [ 5 ] + }, + "e": { + "direction": "input", + "bits": [ 6 ] + }, + "f": { + "direction": "input", + "bits": [ 7 ] + }, + "g": { + "direction": "input", + "bits": [ 8 ] + }, + "h": { + "direction": "input", + "bits": [ 9 ] + }, + "out": { + "direction": "output", + "bits": [ 10 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$52": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 11 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$53": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 11 ], + "B": [ 4 ], + "Y": [ 12 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$54": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 12 ], + "B": [ 5 ], + "Y": [ 13 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$55": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 13 ], + "B": [ 6 ], + "Y": [ 14 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$56": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ 7 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$57": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 15 ], + "B": [ 8 ], + "Y": [ 16 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$58": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ 9 ], + "Y": [ 10 ] + } + } + }, + "netnames": { + "$and$tests/Verilogfiles/test1.v:5$1_Y": { + "hide_name": 1, + "bits": [ 11 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$2_Y": { + "hide_name": 1, + "bits": [ 12 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$3_Y": { + "hide_name": 1, + "bits": [ 13 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$4_Y": { + "hide_name": 1, + "bits": [ 14 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$5_Y": { + "hide_name": 1, + "bits": [ 15 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$6_Y": { + "hide_name": 1, + "bits": [ 16 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "e": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "f": { + "hide_name": 0, + "bits": [ 7 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "g": { + "hide_name": 0, + "bits": [ 8 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "h": { + "hide_name": 0, + "bits": [ 9 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "out": { + "hide_name": 0, + "bits": [ 10 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:4" + } + } + } + } + } +} diff --git a/src/main/tests/json files/test23.json b/src/main/tests/json files/test23.json new file mode 100644 index 0000000..cb98e8f --- /dev/null +++ b/src/main/tests/json files/test23.json @@ -0,0 +1,172 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "input", + "bits": [ 5 ] + }, + "out": { + "direction": "output", + "bits": [ 6 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$50": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test23.v:7" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 7 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$51": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test23.v:8" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 4 ], + "B": [ 5 ], + "Y": [ 8 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$52": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test23.v:10" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 8 ], + "Y": [ 9 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$53": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test23.v:12" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 9 ], + "B": [ 9 ], + "Y": [ 6 ] + } + } + }, + "netnames": { + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:4" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:4" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:4" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:4" + } + }, + "out": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:5" + } + }, + "w": { + "hide_name": 0, + "bits": [ 9 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:6" + } + }, + "x": { + "hide_name": 0, + "bits": [ 7 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:6" + } + }, + "y": { + "hide_name": 0, + "bits": [ 8 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:6" + } + }, + "z": { + "hide_name": 0, + "bits": [ 9 ], + "attributes": { + "src": "tests/Verilogfiles/test23.v:6" + } + } + } + } + } +} diff --git a/src/main/tests/json files/test33.json b/src/main/tests/json files/test33.json new file mode 100644 index 0000000..d925da3 --- /dev/null +++ b/src/main/tests/json files/test33.json @@ -0,0 +1,143 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "input", + "bits": [ 5 ] + }, + "out1": { + "direction": "output", + "bits": [ 6 ] + }, + "out2": { + "direction": "output", + "bits": [ 7 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$48": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test33.v:7" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 8 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$49": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test33.v:8" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 4 ], + "Y": [ 6 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$50": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test33.v:9" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 8 ], + "B": [ 5 ], + "Y": [ 7 ] + } + } + }, + "netnames": { + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:4" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:4" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:4" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:4" + } + }, + "out1": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:5" + } + }, + "out2": { + "hide_name": 0, + "bits": [ 7 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:5" + } + }, + "x": { + "hide_name": 0, + "bits": [ 8 ], + "attributes": { + "src": "tests/Verilogfiles/test33.v:6" + } + } + } + } + } +} diff --git a/src/main/tests/json files/testAO.json b/src/main/tests/json files/testAO.json new file mode 100644 index 0000000..a141281 --- /dev/null +++ b/src/main/tests/json files/testAO.json @@ -0,0 +1,558 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "input", + "bits": [ 5 ] + }, + "e": { + "direction": "input", + "bits": [ 6 ] + }, + "f": { + "direction": "input", + "bits": [ 7 ] + }, + "g": { + "direction": "input", + "bits": [ 8 ] + }, + "out": { + "direction": "output", + "bits": [ 9 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$110": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:7" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 10 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$111": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:10" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 11 ], + "B": [ 12 ], + "Y": [ 13 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$112": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:9" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ 8 ], + "Y": [ 11 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$113": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:10" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 13 ], + "B": [ 15 ], + "Y": [ 9 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$114": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:10" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 7 ], + "B": [ 2 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$115": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:7" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 10 ], + "B": [ 4 ], + "Y": [ 14 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$116": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/testAO.v:8" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ 5 ], + "Y": [ 12 ] + } + } + }, + "netnames": { + "$and$tests/Verilogfiles/testAO.v:10$64_Y": { + "hide_name": 1, + "bits": [ 15 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:10" + } + }, + "$and$tests/Verilogfiles/testAO.v:7$59_Y": { + "hide_name": 1, + "bits": [ 10 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:7" + } + }, + "$or$tests/Verilogfiles/testAO.v:10$63_Y": { + "hide_name": 1, + "bits": [ 13 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:10" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "e": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "f": { + "hide_name": 0, + "bits": [ 7 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "g": { + "hide_name": 0, + "bits": [ 8 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:4" + } + }, + "out": { + "hide_name": 0, + "bits": [ 9 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:5" + } + }, + "x": { + "hide_name": 0, + "bits": [ 14 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:6" + } + }, + "y": { + "hide_name": 0, + "bits": [ 12 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:6" + } + }, + "z": { + "hide_name": 0, + "bits": [ 11 ], + "attributes": { + "src": "tests/Verilogfiles/testAO.v:6" + } + } + } + }, + "test12": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "input", + "bits": [ 5 ] + }, + "e": { + "direction": "input", + "bits": [ 6 ] + }, + "f": { + "direction": "input", + "bits": [ 7 ] + }, + "g": { + "direction": "input", + "bits": [ 8 ] + }, + "h": { + "direction": "input", + "bits": [ 9 ] + }, + "out": { + "direction": "output", + "bits": [ 10 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$52": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 3 ], + "Y": [ 11 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$53": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 11 ], + "B": [ 4 ], + "Y": [ 12 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$54": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 12 ], + "B": [ 5 ], + "Y": [ 13 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$55": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 13 ], + "B": [ 6 ], + "Y": [ 14 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$56": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 14 ], + "B": [ 7 ], + "Y": [ 15 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$57": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 15 ], + "B": [ 8 ], + "Y": [ 16 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$58": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 16 ], + "B": [ 9 ], + "Y": [ 10 ] + } + } + }, + "netnames": { + "$and$tests/Verilogfiles/test1.v:5$1_Y": { + "hide_name": 1, + "bits": [ 11 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$2_Y": { + "hide_name": 1, + "bits": [ 12 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$3_Y": { + "hide_name": 1, + "bits": [ 13 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$4_Y": { + "hide_name": 1, + "bits": [ 14 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$5_Y": { + "hide_name": 1, + "bits": [ 15 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "$and$tests/Verilogfiles/test1.v:5$6_Y": { + "hide_name": 1, + "bits": [ 16 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:5" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "e": { + "hide_name": 0, + "bits": [ 6 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "f": { + "hide_name": 0, + "bits": [ 7 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "g": { + "hide_name": 0, + "bits": [ 8 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "h": { + "hide_name": 0, + "bits": [ 9 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:3" + } + }, + "out": { + "hide_name": 0, + "bits": [ 10 ], + "attributes": { + "src": "tests/Verilogfiles/test1.v:4" + } + } + } + } + } +} diff --git a/src/main/tests/json files/testMajority.json b/src/main/tests/json files/testMajority.json new file mode 100644 index 0000000..f360d9b --- /dev/null +++ b/src/main/tests/json files/testMajority.json @@ -0,0 +1,212 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "testMajority": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2 ] + }, + "b": { + "direction": "input", + "bits": [ 3 ] + }, + "c": { + "direction": "input", + "bits": [ 4 ] + }, + "d": { + "direction": "output", + "bits": [ 5 ] + } + }, + "cells": { + "$or$tests/testMajority.v:5$5": { + "hide_name": 1, + "type": "$or", + "parameters": { + "Y_WIDTH": 1, + "B_WIDTH": 1, + "A_WIDTH": 1, + "B_SIGNED": 0, + "A_SIGNED": 0 + }, + "attributes": { + "src": "tests/testMajority.v:5" + }, + "port_directions": { + "Y": "output", + "B": "input", + "A": "input" + }, + "connections": { + "Y": [ 5 ], + "B": [ 6 ], + "A": [ 7 ] + } + }, + "$and$tests/testMajority.v:5$4": { + "hide_name": 1, + "type": "$and", + "parameters": { + "Y_WIDTH": 1, + "B_WIDTH": 1, + "A_WIDTH": 1, + "B_SIGNED": 0, + "A_SIGNED": 0 + }, + "attributes": { + "src": "tests/testMajority.v:5" + }, + "port_directions": { + "Y": "output", + "B": "input", + "A": "input" + }, + "connections": { + "Y": [ 6 ], + "B": [ 4 ], + "A": [ 3 ] + } + }, + "$or$tests/testMajority.v:5$3": { + "hide_name": 1, + "type": "$or", + "parameters": { + "Y_WIDTH": 1, + "B_WIDTH": 1, + "A_WIDTH": 1, + "B_SIGNED": 0, + "A_SIGNED": 0 + }, + "attributes": { + "src": "tests/testMajority.v:5" + }, + "port_directions": { + "Y": "output", + "B": "input", + "A": "input" + }, + "connections": { + "Y": [ 7 ], + "B": [ 8 ], + "A": [ 9 ] + } + }, + "$and$tests/testMajority.v:5$2": { + "hide_name": 1, + "type": "$and", + "parameters": { + "Y_WIDTH": 1, + "B_WIDTH": 1, + "A_WIDTH": 1, + "B_SIGNED": 0, + "A_SIGNED": 0 + }, + "attributes": { + "src": "tests/testMajority.v:5" + }, + "port_directions": { + "Y": "output", + "B": "input", + "A": "input" + }, + "connections": { + "Y": [ 8 ], + "B": [ 3 ], + "A": [ 2 ] + } + }, + "$and$tests/testMajority.v:5$1": { + "hide_name": 1, + "type": "$and", + "parameters": { + "Y_WIDTH": 1, + "B_WIDTH": 1, + "A_WIDTH": 1, + "B_SIGNED": 0, + "A_SIGNED": 0 + }, + "attributes": { + "src": "tests/testMajority.v:5" + }, + "port_directions": { + "Y": "output", + "B": "input", + "A": "input" + }, + "connections": { + "Y": [ 9 ], + "B": [ 4 ], + "A": [ 2 ] + } + } + }, + "netnames": { + "$or$tests/testMajority.v:5$5_Y": { + "hide_name": 1, + "bits": [ 5 ], + "attributes": { + "src": "tests/testMajority.v:5" + } + }, + "$and$tests/testMajority.v:5$4_Y": { + "hide_name": 1, + "bits": [ 6 ], + "attributes": { + "src": "tests/testMajority.v:5" + } + }, + "$or$tests/testMajority.v:5$3_Y": { + "hide_name": 1, + "bits": [ 7 ], + "attributes": { + "src": "tests/testMajority.v:5" + } + }, + "$and$tests/testMajority.v:5$2_Y": { + "hide_name": 1, + "bits": [ 8 ], + "attributes": { + "src": "tests/testMajority.v:5" + } + }, + "$and$tests/testMajority.v:5$1_Y": { + "hide_name": 1, + "bits": [ 9 ], + "attributes": { + "src": "tests/testMajority.v:5" + } + }, + "d": { + "hide_name": 0, + "bits": [ 5 ], + "attributes": { + "src": "tests/testMajority.v:3" + } + }, + "c": { + "hide_name": 0, + "bits": [ 4 ], + "attributes": { + "src": "tests/testMajority.v:2" + } + }, + "b": { + "hide_name": 0, + "bits": [ 3 ], + "attributes": { + "src": "tests/testMajority.v:2" + } + }, + "a": { + "hide_name": 0, + "bits": [ 2 ], + "attributes": { + "src": "tests/testMajority.v:2" + } + } + } + } + } +} diff --git a/src/main/tests/json files/test_arrays.json b/src/main/tests/json files/test_arrays.json new file mode 100644 index 0000000..c463429 --- /dev/null +++ b/src/main/tests/json files/test_arrays.json @@ -0,0 +1,73 @@ +{ + "creator": "Yosys 0.6 (git sha1 5869d26, i686-pc-mingw32-gcc 4.8.1 -Os)", + "modules": { + "test": { + "ports": { + "a": { + "direction": "input", + "bits": [ 2, 3, 4, 5 ] + }, + "b": { + "direction": "output", + "bits": [ 6, 7 ] + } + }, + "cells": { + "$auto$simplemap.cc:85:simplemap_bitop$47": { + "hide_name": 1, + "type": "$_AND_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test_arrays.v:5" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 2 ], + "B": [ 4 ], + "Y": [ 6 ] + } + }, + "$auto$simplemap.cc:85:simplemap_bitop$48": { + "hide_name": 1, + "type": "$_OR_", + "parameters": { + }, + "attributes": { + "src": "tests/Verilogfiles/test_arrays.v:6" + }, + "port_directions": { + "A": "input", + "B": "input", + "Y": "output" + }, + "connections": { + "A": [ 3 ], + "B": [ 5 ], + "Y": [ 7 ] + } + } + }, + "netnames": { + "a": { + "hide_name": 0, + "bits": [ 2, 3, 4, 5 ], + "attributes": { + "src": "tests/Verilogfiles/test_arrays.v:3" + } + }, + "b": { + "hide_name": 0, + "bits": [ 6, 7 ], + "attributes": { + "src": "tests/Verilogfiles/test_arrays.v:4" + } + } + } + } + } +} diff --git a/temp.txt b/temp.txt new file mode 100644 index 0000000..a9dcadc --- /dev/null +++ b/temp.txt @@ -0,0 +1,57 @@ + public void placeInWorld(World worldIn, BlockPos pos, EnumFacing direction) { + int width = blocks.size(); + int height = blocks.get(0).size(); + int length = blocks.get(0).get(0).size(); + + int start_x = pos.getX(); + int start_y = pos.getY(); + int start_z = pos.getZ(); + + if (direction == EnumFacing.NORTH){ + start_z += 2; + } else if (direction == EnumFacing.SOUTH) { + start_z -= length + 1; + } else if (direction == EnumFacing.EAST){ + start_x -= width + 1; + } else if (direction == EnumFacing.WEST) { + start_x -= width + 1; + } + + int y = start_y - 1; + for (int z = start_z - 1; z < start_z + length + 1; z ++){ + for (int x = start_x - 1; x < start_x + width + 1; x++){ + worldIn.setBlockState(new BlockPos(x, y, z), Blocks.WOOL.getDefaultState()); + } + } + + HashMap torches = new HashMap(); + + for (int i = 0; i < width; i++){ + for (int j = 0; j < height; j++) { + for (int k = 0; k < length; k++) { + if (this.getState(i, j, k).getBlock().getDefaultState() == Blocks.REDSTONE_TORCH.getDefaultState()) { + torches.put(new Vec3i(i, j, k), this.getState(i, j, k)); + } else { + BlockPos blk_pos = new BlockPos(start_x + i, start_y + j, start_z + k); + worldIn.setBlockState(blk_pos, this.getState(i, j, k)); + + TileEntity te = this.te_map.get(new Vec3i(i, j, k)); + if (te != null) { + worldIn.setTileEntity(blk_pos, te); + } + } + } + } + } + + for (Map.Entry set : torches.entrySet()){ + worldIn.setBlockState(new BlockPos(start_x + set.getKey().getX(), start_y + set.getKey().getY(), start_z + set.getKey().getZ()), set.getValue()); + } + for (int z = start_z - 1; z < start_z + length + 1; z ++) { + for (int x = start_x - 1; x < start_x + width + 1; x++) { + if (worldIn.getBlockState(new BlockPos(x, y + 1, z)).getBlock() == Blocks.AIR | worldIn.getBlockState(new BlockPos(x, y + 1, z)).getBlock() == Blocks.WOOL) { + worldIn.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState()); + } + } + } + } \ No newline at end of file