ERDDAP / erddap

ERDDAP is a scientific data server that gives users a simple, consistent way to download subsets of gridded and tabular scientific datasets in common file formats and make graphs and maps. ERDDAP is a Free and Open Source (Apache and Apache-like) Java Servlet from NOAA NMFS SWFSC Environmental Research Division (ERD).
Creative Commons Zero v1.0 Universal
84 stars 58 forks source link

Fix issue #119: Incorrect varName in logs #141

Closed ayushsingh01042003 closed 6 months ago

ayushsingh01042003 commented 6 months ago

Description

varName was being incorrectly logged by being copied from the attribute

Fixes #119

Type of change

ayushsingh01042003 commented 6 months ago

Hi @ChrisJohnNOAA I've raised the PR as instructed, please take a look if this works and let me know if otherwise.

ayushsingh01042003 commented 6 months ago

@ChrisJohnNOAA That was careless on my part I completely overlooked the name parameter for attributes.add().

Just to make sure I understand the requested changes, The solution should look something like this?

  String ncAttsName = ncAtts.getName();
  Iterator it = ncAtts.iterator();
  while (it.hasNext()) { //there is also a dods.dap.Attribute                        
      Attribute att = (Attribute)it.next();            
      String name = att.getName();
      attributes.add(name, getAttributePA(ncAttsName, att));
  }

I think this should do it, I have pushed the changes, Can you have look at it?