hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1826) Side classes should be moved to separate files
Date Fri, 18 Apr 2008 12:56:21 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590432#action_12590432

Steve Loughran commented on HADOOP-1826:

I should point out this is not an Ant problem, it is javac itself that has strict rules about
naming. When javac tries to compile a class that imports another class, if it cant find the
.class, it works out what the .java filename should be and compiles that. This is how javac
magically compiles all files in the right order. 

If you stick classes in the wrong package locations, or the wrong source file names (including
wrong case) there is no guarantee that stuff builds, or if it does, that changes to the source

Dont do this. Either make them static inners or give them the right file names.

> Side classes should be moved to separate files
> ----------------------------------------------
>                 Key: HADOOP-1826
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1826
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Owen O'Malley
>            Assignee: Owen O'Malley
>         Attachments: HADOOP-1826-BlockCrcUpgrade.ingnorespace.patch, HADOOP-1826-BlockCrcUpgrade.patch
> The following classes are "side" classes that aren't in files with the same name. This
caused problems last night because ant compiled things in the wrong order and couldn't find
one of the relevant classes. I think it would make the code easier to read and understand
if you could always find a given class in the expected place.
> {code}
> > find src/java -name '*.java' | xargs grep '^class' | sed -e 's|\([a-zA-Z0-9/]*/\)\([^/.]*\)[.]java:class
\([^ <]*\).*|\1 \2 \3|' | awk '{if ($2 != $3) print $1$2".java",$3}'
> src/java/org/apache/hadoop/mapred/BasicTypeSorterBase.java MRSortResultIterator
> src/java/org/apache/hadoop/dfs/BlockCommand.java DatanodeCommand
> src/java/org/apache/hadoop/dfs/Storage.java StorageInfo
> src/java/org/apache/hadoop/dfs/BlockCrcUpgrade.java BlockCrcInfo
> src/java/org/apache/hadoop/dfs/BlockCrcUpgrade.java DNBlockUpgradeInfo
> src/java/org/apache/hadoop/dfs/BlockCrcUpgrade.java BlockCrcUpgradeUtils
> src/java/org/apache/hadoop/dfs/BlockCrcUpgrade.java BlockCrcUpgradeObjectDatanode
> src/java/org/apache/hadoop/dfs/BlockCrcUpgrade.java BlockCrcUpgradeObjectNamenode
> src/java/org/apache/hadoop/dfs/INode.java INodeDirectory
> src/java/org/apache/hadoop/dfs/INode.java INodeFile
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message