/*
 * Copyright (c) 2016 MCPhoton <http://mcphoton.org> and contributors.
 *
 * This file is part of the Photon Server Implementation <https://github.com/mcphoton/Photon-Server>.
 *
 * The Photon Server Implementation is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * The Photon Server Implementation is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.slf4j.impl;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

public class PhotonLoggerFactory implements ILoggerFactory {

	private final ConcurrentMap<String, Logger> loggerMap = new ConcurrentHashMap<>();

	@Override
	public Logger getLogger(String name) {
		Logger logger = loggerMap.get(name);
		if (logger != null) {
			return logger;
		} else {
			Logger newInstance = new PhotonLogger(name);
			Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);
			return oldInstance == null ? newInstance : oldInstance;
		}
	}

}

@@ -1262,274 +1262,78 @@
 %7B%0A%09%09
-Logger logger = loggerMap.get(name);%0A%09%09if (logger != null) %7B%0A%09%09%09return logger;%0A%09%09%7D else %7B%0A%09%09%09Logger newInstance = new PhotonLogger(name);%0A%09%09%09Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);%0A%09%09%09return oldInstance == null ? newInstance : oldInstance;%0A%09%09%7D
+return loggerMap.computeIfAbsent(name, (k) -%3E new PhotonLogger(name));
 %0A%09%7D%0A

Use map.computeIfAbsent to create the logger when needed