function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kibitzerkibitzer 

Spring 12 preview breaking change - has anyone else seen this?

Here's some code that works on a winter 12 dev org bug fails on a Spring 12 sandbox:

 

VisualForce controller:

 

public class Spring12Bug
{
    private Map<String, String> m_entries;

    public Map<String, String> Entries {
        get
        {
            if(m_entries==null) 
                m_entries = new Map<String, String>{'A'=>'Red','B'=>'Green','C'=>'Blue'};
            return m_entries;
        } 
    }

    public Set<String> getKeys()
    {
        return Entries.keyset();
    }


}

 

VisualForce page markup:

 

<apex:page controller="Spring12Bug" >
  <h1>Demonstration of bug</h1>
  <apex:dataTable var="thekey" value="{!Keys}">
      <apex:column headerValue="Entries" value="{!Entries[thekey]}" />
  </apex:dataTable>
</apex:page>

 

On Winter 12 you get:

 

Demonstration of bugEntries

Red
Green
Blue

 

 

On Spring preview you get:

 

Visualforce Error


Map key null not found in map.


(Color changed for readability).

 

There is a workaround - to put the lookup in an OutputText tag inside of the column instead of using the Value attribute. But I figure someone should know about this bug as well.

Best Answer chosen by Admin (Salesforce Developers) 
aballardaballard

Yes, this is a known problem.   It should be fixed very soon. 

All Answers

aballardaballard

Yes, this is a known problem.   It should be fixed very soon. 

This was selected as the best answer
kibitzerkibitzer

Great to hear!


 

NuDevNuDev

Do you know if this will be fixed prior to the release this weekend?

aballardaballard

I believe it will be.

aballardaballard

This should be fixed now.  Please let us know if you still see the problem.