@@ -70,7 +70,6 @@ public static SNPRC_schedulerManager get()
7070 */
7171 private Integer getNextRevisionNum (int timelineId )
7272 {
73-
7473 SQLFragment sql = new SQLFragment ("SELECT MAX(t.RevisionNum) AS RevisionNum FROM " );
7574 sql .append (SNPRC_schedulerSchema .getInstance ().getTableInfoTimeline (), "t" );
7675 sql .append (" WHERE t.TimelineId = ?" ).add (timelineId );
@@ -79,7 +78,6 @@ private Integer getNextRevisionNum(int timelineId)
7978 Integer revNum = sqlSelector .getObject (Integer .class );
8079
8180 return (revNum == null ) ? 0 : revNum + 1 ;
82-
8381 }
8482
8583 /**
@@ -102,6 +100,7 @@ public static String getUserDisplayName(Integer userId)
102100 }
103101 return userName ;
104102 }
103+
105104 // TODO: fb_snprc_edit
106105 public List <TimelineItem > getTimelineItems (Container c , User u , String timelineObjectId , @ Nullable Date scheduleDate ) throws ApiUsageException
107106 {
@@ -121,7 +120,6 @@ public List<TimelineItem> getTimelineItems(Container c, User u, String timelineO
121120 }
122121
123122 timelineItems = new TableSelector (timelineItemTable , filter , null ).getArrayList (TimelineItem .class );
124-
125123 }
126124 catch (Exception e )
127125 {
@@ -144,7 +142,6 @@ public List<StudyDayNotes> getStudyDayNotes(Container c, User u, String timeline
144142
145143 SimpleFilter filter = new SimpleFilter (FieldKey .fromParts (StudyDayNotes .STUDYDAY_TIMELINE_OBJECT_ID ), timelineObjectId , CompareType .EQUAL );
146144 studyDayNotes = new TableSelector (studyDayTable , filter , null ).getArrayList (StudyDayNotes .class );
147-
148145 }
149146 catch (Exception e )
150147 {
@@ -154,10 +151,8 @@ public List<StudyDayNotes> getStudyDayNotes(Container c, User u, String timeline
154151 return studyDayNotes ;
155152 }
156153
157-
158154 public List <TimelineAnimalJunction > getTimelineAnimalItems (Container c , User u , String timelineObjectId ) throws ApiUsageException
159155 {
160-
161156 List <TimelineAnimalJunction > timelineAnimalItems ;
162157 try
163158 {
@@ -259,7 +254,6 @@ public List<TimelineProjectItem> getTimelineProjectItems(Container c, User u, St
259254 */
260255 public void validateBeforeDelete (Container c , User u , Timeline timeline , BatchValidationException errors )
261256 {
262-
263257 Integer timelineId = timeline .getTimelineId ();
264258 Integer revisionNum = timeline .getRevisionNum ();
265259 String timelineObjectId = timeline .getObjectId ();
@@ -274,8 +268,7 @@ public void validateBeforeDelete(Container c, User u, Timeline timeline, BatchVa
274268 // Does timeline exist?
275269 if (!errors .hasErrors () && timelineTable != null )
276270 {
277- Set <String > cols = new HashSet <>();
278- cols .add (Timeline .TIMELINE_ID );
271+ Set <String > cols = Collections .singleton (Timeline .TIMELINE_ID );
279272
280273 SimpleFilter filter = new SimpleFilter (FieldKey .fromString (Timeline .TIMELINE_ID ), timelineId , CompareType .EQUAL ).
281274 addCondition (FieldKey .fromString (Timeline .TIMELINE_REVISION_NUM ), revisionNum , CompareType .EQUAL );
@@ -290,11 +283,9 @@ public void validateBeforeDelete(Container c, User u, Timeline timeline, BatchVa
290283 // is timeline in use?
291284 if (!errors .hasErrors () && timelineTable != null )
292285 {
293-
294286 if (timelineTable .isTimelineInUse (timelineId , revisionNum ))
295287 errors .addRowError (new ValidationException ("Timeline is in use - cannot be deleted." ));
296288 }
297-
298289 }
299290
300291 /**
@@ -319,7 +310,6 @@ public void deleteTimeline(@NotNull Container c, @NotNull User u, Timeline time
319310 Integer revisionNum = timeline .getRevisionNum ();
320311 String timelineObjectId = timeline .getObjectId ();
321312
322-
323313 // delete the timeline
324314 try (DbScope .Transaction transaction = scope .ensureTransaction ())
325315 {
@@ -431,7 +421,6 @@ public void deleteTimeline(@NotNull Container c, @NotNull User u, Timeline time
431421
432422 // All is well
433423 transaction .commit ();
434-
435424 }
436425 catch (BatchValidationException | InvalidKeyException | QueryUpdateServiceException | SQLException e )
437426 {
@@ -440,7 +429,6 @@ public void deleteTimeline(@NotNull Container c, @NotNull User u, Timeline time
440429 }
441430 }
442431
443-
444432 /**
445433 * Update the Timeline table (called by SNPRC_schedulerServiceImpl.saveTimelineData()
446434 *
0 commit comments