Archive for 7월, 2014

[IT] FindBugs XML Report analysis

2014/07/31

http://findbugs.sourceforge.net/

structure

BugCollection ( attr : version)
child tags: Project, BugInstance+ , Errors, FindBugsSummary, ClassFeatures, History

Project (attr : projectName )

BugInstance (attr : type, priority, category .. )
child tags : Class, Field, Method

Class (attr : classname )
child tags : SourceLine

xml report example

<?xml version="1.0" encoding="UTF-8"?>
<BugCollection version="2.0.1" sequence="0" timestamp="1406627647663" analysisTimestamp="1406627647741" ="">
	<Project projectName=""/>
	<BugInstance type="URF_UNREAD_FIELD" priority="2" abbrev="UrF" category="PERFORMANCE">
		<Class classname="com.Test">
			<SourceLine classname="com.Test" start="19" end="103" sourcefile="Test.java" sourcepath="com/Test.java"/>
		</Class>
		<Field classname="com.Test" name="configMap" signature="Ljava/util/Map;" isStatic="false">
			<SourceLine classname="com.Test" sourcefile="Test.java" sourcepath="com/Test.java"/>
		</Field>+
		<Method classname="java.io.FileReader" name="<init>" signature="(Ljava/lang/String;)V" isStatic="false" role="METHOD_CALLED">
			<SourceLine classname="java.io.FileReader" start="58" end="59" startBytecode="0" endBytecode="40" sourcefile="FileReader.java" sourcepath="java/io/FileReader.java"/>
		</Method>+
		<SourceLine/>
  </BugInstance>
  <BugInstance/>
</BugCollection>	

report parsing example

SAXBuilder builder = new SAXBuilder(); 
FileInputStream in = new FileInputStream(new File(fileName)); 
Document doc = builder.build(in);  // XML Loading
Element root = doc.getRootElement();
if("BugCollection".equals(root.getName())){ // find root element
	for(Element element : root.getChildren()){
		if("BugInstance".equals(element.getName())){ // find instance
			String types = element.getAttributeValue("type");   
			String prior = element.getAttributeValue("priority");
			Element classElem = element.getChild(“Class”);  // find class 
			String className = classElem.getAttributeValue("classname");
			System.out.println("classname:"+className+", type:"+ types +", priority:"+prior);
		}
	}
}
Advertisements

[IT] Perforce p4 Java API call example

2014/07/31

– library : perfoce client java library : p4java-2013.2.788582.jar

– reference : p4java manual : http://www.perforce.com/perforce/doc.current/manuals/p4java/

– concept

Depot : 형상관리되는 모든 파일의 revision 원격 저장소

Workspace: Client 작업 공간 (folders or directories) 로컬 경로와 Depot을 연결

기본 LifeCycle : Sync -> Add/Edit -> Submit

– command (filelog) : show files revision

p4 [g-opts] filelog [-c change -h -i -l -L -t -m max -p -s] file[revRange]

example


import com.perforce.p4java.client.IClient;

import com.perforce.p4java.server.CmdSpec;

import com.perforce.p4java.server.IServer;

import com.perforce.p4java.server.ServerFactory;

...

public static void main(String[] args) throws Exception {

String workspacepath = "//redcaworkspace/..."; // local workspace path

IServer server = ServerFactory.getServer("p4java://localhost:1666", null); // connection url

server.connect();

server.setUserName(“p4user”); // username

server.login(“p4pass”); // password

server.setCurrentClient(server.getClient(“redcaworkspace”)); // client workspace name

String[] cmdArgs = new String[] { "-t", "-s", this.workspace + "#have,#head" };

Map[] result = server.execInputStringMapCmd(CmdSpec.FILELOG.name(), cmdArgs, null);

for (Map map : result) {

System.out.println( “user=“+map.get("user0")

+ “repository path=“ + map.get("depotFile") + “action=“ + map.get("action0")

+ “FileSize=“ + map.get("fileSize0") + “datetime=“+map.get("time0") );

}

server.disconnect();

}

Link – Free Icon Sets

2014/07/30

Shared from Zite

우리나라 개발자들이 스타트업에 가지 않으려는 이유 | Insanehong’s Incorrect Note

2014/07/19

insanehong.kr/post/fuck-that-statup

.

from mobile

Daemonizing JVM-based applications | Java Code Geeks

2014/07/19

www.javacodegeeks.com/2014/07/daemonizing-jvm-based-applications.html

from mobile

link – porcelli/plsql-parser · GitHub

2014/07/18

https://github.com/porcelli/plsql-parser

나의 iPad에서 보냄

link – Dependency Finder

2014/07/18

http://depfind.sourceforge.net/

from mobile

Eclipse Metrics plugin continued

2014/07/18

http://metrics2.sourceforge.net/

나의 iPad에서 보냄

Trend Monitoring

2014/07/18

http://www.jarchitect.com/trend

나의 iPad에서 보냄

Technology | Lattix

2014/07/18

http://lattix.com/technology-0

나의 iPad에서 보냄