[
https://issues.apache.org/jira/browse/GOBBLIN-2041?focusedWorklogId=914436&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-914436
]
ASF GitHub Bot logged work on GOBBLIN-2041:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/Apr/24 16:31
Start Date: 12/Apr/24 16:31
Worklog Time Spent: 10m
Work Description: phet commented on PR #3920:
URL: https://github.com/apache/gobblin/pull/3920#issuecomment-2052089195
> This would be changing the NPE into an IOException instead right? The
underlying issue is that not every source has a CopyEntityClass which is
depended on by `ProcessWorkUnitImpl`, it seems that you need to decouple the
ProcessWorkUnitImpl with the CopySource since there are different Gobblin
sources that can be used.
I do agree with addressing the presumption in `ProcessWorkUnitImpl`, but
will do so separately. RN the presumption of `CopyEntity` only shows up there
for informational logging, but I agree, that it's too `CopySource`-specific for
the general case.
that said, protecting against NPE by first checking the result seems a
reasonable stand-alone change, and this method already has `IOException` in its
signature.
Issue Time Tracking
-------------------
Worklog Id: (was: 914436)
Time Spent: 0.5h (was: 20m)
> CopySource::getCopyEntityClass throws NPE when optional property missing
> ------------------------------------------------------------------------
>
> Key: GOBBLIN-2041
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2041
> Project: Apache Gobblin
> Issue Type: New Feature
> Components: gobblin-core
> Reporter: Kip Kohn
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> access to prop `gobblin.copy.copy.entity.class`, when not present, causes:
> {code}
> java.lang.NullPointerException:
> at java.lang.Class.forName0(Native Method:0)
> at java.lang.Class.forName(Class.java:264)
> at
> org.apache.gobblin.data.management.copy.CopySource.getCopyEntityClass(CopySource.java:558)
> at
> org.apache.gobblin.temporal.ddm.activity.impl.ProcessWorkUnitImpl.getOptCopyEntityClass(ProcessWorkUnitImpl.java:204)
> at
> org.apache.gobblin.temporal.ddm.activity.impl.ProcessWorkUnitImpl.getOptCopyableFile(ProcessWorkUnitImpl.java:184)
> ...
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)