<commit_before>package org.motechproject.server.web;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * This class sets and updates the path used for static resources in JSP views
 */
public class DevelopmentModeInterceptor extends HandlerInterceptorAdapter {

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView){
        if(modelAndView != null) {
            String devString = "DEVELOPMENT";
            Boolean developmentMode = devString.equals(System.getenv("ENVIRONMENT"));
            modelAndView.addObject("developmentMode", developmentMode);
        }
    }
}<commit_msg>MOTECH-2022 Static UI (0.8) Changed development mode detection to use ApplicationEnvironment class<commit_after>package org.motechproject.server.web;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.motechproject.osgi.web.ext.ApplicationEnvironment;

/**
 * This class sets and updates the path used for static resources in JSP views
 */
public class DevelopmentModeInterceptor extends HandlerInterceptorAdapter {

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView){
        if(modelAndView != null) {
            modelAndView.addObject("developmentMode", ApplicationEnvironment.isInDevelopmentMode());
        }
    }
}
{'fraction_non_alphanumeric': 0.07842014882655982, 'fraction_numerical': 0.0034344590726960505, 'mean_word_length': 4.925423728813559, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5633640', 'n_tokens_mistral': 443, 'n_tokens_neox': 430, 'n_words': 107}