From 6b70878e0bbff1b2a57dd6d8e22b0bceb82a6387 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 24 Jan 2002 11:36:53 +0000 Subject: [PATCH] Made tasks receive contexts directly rather than through Contextualizable interface as all tasks will most likely use the context in some fashion Also fixed up misnamed error message git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270839 13f79535-47bb-0310-9956-ffa450edef68 --- .../myrmidon/components/executor/DefaultExecutor.java | 7 ++----- .../myrmidon/components/executor/Resources.properties | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java index 537bd6256..33fdf4d83 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/DefaultExecutor.java @@ -143,15 +143,12 @@ public class DefaultExecutor { try { - if( task instanceof Contextualizable ) - { - ( (Contextualizable)task ).contextualize( context ); - } + task.contextualize( context ); } catch( final Throwable throwable ) { final String message = - REZ.getString( "compose.error", + REZ.getString( "contextualize.error", taskModel.getName(), taskModel.getLocation(), throwable.getMessage() ); diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties index 6bb2f9cf0..5bf2ee70e 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/executor/Resources.properties @@ -10,7 +10,7 @@ disposing.notice=Disposing. no-create.error=Unable to create task {0}. config.error=Error configuring task {0} at {1} (Reason: {2}). compose.error=Error composing task {0} at {1} (Reason: {2}). -context.error=Error contextualizing task {0} at {1} (Reason: {2}). +contextualize.error=Error contextualizing task {0} at {1} (Reason: {2}). dispose.error=Error disposing task {0} at {1} (Reason: {2}). init.error=Error initializing task {0} at {1} (Reason: {2}). logger.error=Error setting logger for task {0} at {1} (Reason: {2}).