Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 98156 invoked from network); 1 Jun 2007 15:16:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2007 15:16:07 -0000 Received: (qmail 66565 invoked by uid 500); 1 Jun 2007 15:15:41 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 66550 invoked by uid 500); 1 Jun 2007 15:15:41 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 66541 invoked by uid 99); 1 Jun 2007 15:15:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:15:41 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:15:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EB0C6714187 for ; Fri, 1 Jun 2007 08:15:15 -0700 (PDT) Message-ID: <29720831.1180710915959.JavaMail.jira@brutus> Date: Fri, 1 Jun 2007 08:15:15 -0700 (PDT) From: "Vera Volynets (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-3741) [drlvm][classloader] Class_File_Loader.cpp small file defects improvement In-Reply-To: <15026272.1177405635618.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500738 ] Vera Volynets commented on HARMONY-3741: ---------------------------------------- 88)1513 - better use uint8 here instead of Byte 89)1518 - then remove cast to (uint8*) 90)1518 - change loop to memcpy 91)1602,1646 - change {} for if operator to the unique style. 92)1619,1663 - move skip to line 1609 (1653) 93)1610,1653 - move loop iterator 'j' into the for and change it to uint16 94)1697 - change get_offset() to return unsigned 95)1738 - comment failed variable 96)1754-1757 - remove FIXME from comment and improve it 97)1766 - inline to line 1767 98)1807 - move operator return to another string 99)1814 - change to return false > [drlvm][classloader] Class_File_Loader.cpp small file defects improvement > ------------------------------------------------------------------------- > > Key: HARMONY-3741 > URL: https://issues.apache.org/jira/browse/HARMONY-3741 > Project: Harmony > Issue Type: Improvement > Components: DRLVM > Environment: all > Reporter: Vera Volynets > Assignee: Gregory Shimansky > Priority: Trivial > > I've noticed that file Class_File_Loader.cpp has many small defects which should be improved. > Here is the list of it. > This list will be expanded as I look through it. > 0 80 symbols per line > 0)17 remove @author > 1)18 remove @revision > 2)26 reduce #include list > 3)42 remove #ifdef _IPF_ from this file > 4)47 misprint th->the > 5)51-54 remove comment > 6)56 think of making this inline function, add a comment to this function / macro > 7)60 check what currently ReportFailedClass does > 8)64 add a comment how output of this function is used > 9)66 use return instead of assignment name = > 10)107 add a comment, name function is_valid_cp_entry > 11)107 add inline prefix > 12)64, 107 use either "tag", or "type" term consistently in the file for any constant pool tag > 13)125- use static const int instead of #define > 14)130 comment: explain +1 in following declarations, or remove terminators from these arrays by using for() instead of while(), remove +1 > 15)143 initialize -> initializes > 16)145 think of creating static const char* table of strings, attribute table size can be obtained via sizeof, filling arrays can be done via inline function, merge arrays into array of struct > 17)239 make the function void > 18)240 incorrect comment, think of renaming the function > 19)243 parse_signature_attr function should be static > 20)261 don't use sig, just return a result > 21)267 should be static > 22)269 excessive argument, can be get from class > 23)274 add a comment why this works > 24)275 rethink this comment > 25)291, 284 change if with reading length > 26)277 think of using excessive variable result > 27)294 think of improving code/style here > 28)304 change message > 29)310, 314, 365 parse_annotation[_value] should be static > 30)0 add "Truncated class file: " message to REPORT_FAILED_CLASS messages, see http://issues.apache.org/jira/browse/HARMONY-3670 > 31)329 ask Nadya "parse number" or "parse a number" > 32)337, 532 investigate if we can remove antn->elements assignment (use array of zero length or just getter function for antn->elements) > 33)0 add a comment before each parse > 34)345 rename parse_u2_be -> parse_2? > 35)340, 358 add a comment, calculate number of bytes by subtracting a start offset from the end offset, change function contract to boolean? remove read_len averywhere in all functions, ask cfs if needed > 36)378 don't use nested switches? > 37)512 operator ? prints integer anyway - don't need it > 38)533 rewrite FIXME OOM with raise + return 0, may use preallocated exception object (preallocate Out of C heap exception object) or lazy exception with const char string > 39)365 exchange parse_annotation and parse_annotation_value in code > 40)551 One general's star is better than three colonel's stars -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.