CommitResource: Delegate to ProjectResource

Other child resources, such as RevisionResource, use delegation rather
than inheritance to refer to their parent collections. This allows us
to use more sensibly named methods; for example, it is not obvious
that what myCommitResource.getNameKey() is referring to is actually
the project name key.

Change-Id: I2aa58246afd22ef7bd0f437c6cfe7233b825f976
This commit is contained in:
Dave Borowitz
2014-08-04 14:44:20 -07:00
parent 3a5e2d19d7
commit 6673b4f161
3 changed files with 12 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ public class FilesInCommitCollection implements
@Override
public FileResource parse(CommitResource parent, IdString id)
throws ResourceNotFoundException {
return new FileResource(parent.getNameKey(), parent.getCommit().getName(),
return new FileResource(parent.getProject(), parent.getCommit().getName(),
id.get());
}