I have read at few places where it suggest not to use @Autowired on fields. Instead constructor injection is preferred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var jshint = require('gulp-jshint'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var rename = require('gulp-rename'); | |
var runSequence = require('run-sequence'); | |
var fs = require('fs'); | |
var del = require('del'); | |
var babel = require('gulp-babel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
module.exports = { | |
context: __dirname + "/webapp", | |
entry: { | |
advancedSearch: [ | |
'./js/advancedSearch.js' | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package katas; | |
import java.time.Instant; | |
import java.time.LocalDateTime; | |
import java.time.OffsetDateTime; | |
import java.time.ZoneId; | |
import java.util.Calendar; | |
import java.util.Date; | |
public class Main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select initcap('assasa') from dual; | |
select substr('asasda',-6,3) from dual; | |
select concat('concat','works') from dual; | |
select trim(' asa ') from dual; | |
select trim(Leading 'a' from 'aaaadfdfaaa') from dual; | |
select trim(Trailing 'a' from 'aaaadfdfaaa') from dual; | |
select trim(both 'a' from 'aaaadfdfaaa') from dual; | |
select instr('12343','3',3,2) from dual; | |
select lpad('asfd',10,'$'),rpad('dad',10,'%') from dual; | |
select replace('1234','1234','9') from dual; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PostConstruct | |
void started() { | |
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What do these option means? | |
-B -f pom.xml -X clean install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static code analysis tools | |
Unnecessary Code Detector | |
https://marketplace.eclipse.org/category/free-tagging/find-unused-code | |
Findbugs | |
https://marketplace.eclipse.org/content/findbugs-eclipse-plugin | |
spotbugs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get annotations on the class object | |
Annotation[] annotations = classobject.getClass() | |
.getAnnotations(); | |
for (Annotation annotation : annotations) { | |
log.debug("annotation type: {}", annotation.annotationType()); | |
Class<? extends Annotation> type = annotation.annotationType(); | |
for (Method method : type.getDeclaredMethods()) { | |
Object val = method.invoke(annotation, (Object[]) null); | |
log.debug("method name: {}, return value:{} return type:{}", method.getName(), val, val.getClass() | |
.getName()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.wgu.dm.config; | |
import java.io.IOException; | |
import java.lang.reflect.InvocationTargetException; | |
import javax.servlet.http.HttpServletResponse; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.web.bind.annotation.ControllerAdvice; | |
import org.springframework.web.bind.annotation.ExceptionHandler; | |
import org.springframework.web.bind.annotation.ResponseBody; | |
import org.springframework.web.bind.annotation.ResponseStatus; |
OlderNewer