Retrofit source reading

1. A common network request process in development url, parameter -- > request -- > Convert to Http protocol -- > request execution -- > return result -- > Convert to response -- > response convert to our object Only the head and tail are customized by our daily development, and other processes in the middle are carried out ...

Posted by hankster on Mon, 16 Dec 2019 04:55:18 -0800

Recognize JavaAgent -- get all classes loaded by the target process

Author: Longofo @ know Chuangyu 404 LabTime: December 10, 2019Original link: https://paper.seebug.org/1099/ Previously, a class was found in an application, but an error occurred during deserialization test. The error is not class not found, but other 0xxx errors. By searching this error, it is probably that the class was not loaded. Recently, ...

Posted by CRichardson on Thu, 12 Dec 2019 22:15:23 -0800

synthetic: a trick of Java cold knowledge compiler

When we read the JDK reflection package source code, we will encounter the isSynthetic() method. One of its implementations is Modifier.isSynthetic(getModifiers()), and the principle of other methods is the same. Modifier is a special class for defining modifiers, among which static final int synchronous = 0x00001000 is one of the modifiers.I t ...

Posted by Tyche on Thu, 12 Dec 2019 00:17:29 -0800

Not a simple Integer

Integer is a simple one, but it's a little different. Integer is a wrapper class of int, which can play the role of caching. In the java foundation, it said that its range is (- 128-127). In this return, there is a cache, and no new integer object will be created, and its maximum value can be set by setting VM parameters. Let's take a look at t ...

Posted by .Darkman on Sat, 07 Dec 2019 23:03:35 -0800

A simple introduction to Java reflection

1. A brief introduction to class A Class of Class represents a Class and interface in a running Java application. Enumeration is a kind, an annotation is an interface, and each array also belongs to a Class reflected as a Class object, which is shared by all arrays with the same element type and dimension. Primitive Java types (boolean, byte, c ...

Posted by jasonman1 on Sat, 07 Dec 2019 08:22:15 -0800

Record a tuning process

Analysis of jvm execution state Code tuning Regular expressions need precompiling Q In the process of using, the wrong way is used: regenerate the Pattern every time Pattern pattern = Pattern.compile(datePattern1); Matcher match = pattern.matcher(sDate); Causes system threads to run for a long time in S Pattern should be defined as ...

Posted by nikneven on Wed, 04 Dec 2019 21:21:42 -0800

spring boot learning: command line startup

When using spring boot to build application startup, we start the application through the command line in our work. Sometimes we need some specific parameters to do some initialization operations when the application starts. spring boot provides two interfaces for users: CommandLineRunner and ApplicationRunner. 1. CommandLineRunner 1.1 stateme ...

Posted by rivasivan on Wed, 04 Dec 2019 15:59:04 -0800

Common design pattern code and understanding in Java

I. single example mode 1. Hungry Chinese style (too hungry, create an instance when the class is loaded) /** * Starved Han style single case model */ public class HungrySingleInstance { // Generate an instance when the class loads private final static HungrySingleInstance instance = new HungrySingleInstance(); //Because the clas ...

Posted by djrichwz on Wed, 04 Dec 2019 03:06:16 -0800

Java Concurrent Programming: Thread Life Cycle

Preface: In the previous article, we learned the differences between processes and threads, and the advantages and disadvantages of using multithreading. This article focuses on how to create a thread in Java and the lifecycle of a thread. Interview Questions Q: How are threads implemented? What is the difference between Q:start() and run()?Q: ...

Posted by AshleyByrom on Mon, 02 Dec 2019 07:34:34 -0800

jni.h header file analysis 3. Other data structures

Article directory Property ID, method ID structure Field descriptor in local interface Reference types in jni memory management Local method structure JNIEnv and JavaVM Property ID, method ID structure //java attribute ID structure struct _jfieldID; /* opaque structure Opaque, i.e. not specifically ...

Posted by jeger003 on Thu, 28 Nov 2019 08:21:46 -0800