Skip to content

Commit

Permalink
Merge pull request #1 from denAbramoff/21-java-throw-out-loombok
Browse files Browse the repository at this point in the history
21 java throw out loombok
  • Loading branch information
denAbramoff authored May 20, 2024
2 parents 63072cd + 640a869 commit 7b2cd8d
Show file tree
Hide file tree
Showing 196 changed files with 15,222 additions and 6,391 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:18 AS build
RUN apt-get update && apt-get install openjdk-17-jdk -y
RUN apt-get update && apt-get install openjdk-21-jdk -y
WORKDIR /workspace/
COPY . /workspace/
RUN --mount=type=cache,target=/root/.gradle ./gradlew clean build -x test
RUN mkdir -p server/build/dependency && (cd server/build/dependency; jar -xf ../libs/jifa.jar)

FROM eclipse-temurin:17-jdk
FROM eclipse-temurin:21-jdk
VOLUME /tmp
ARG DEPENDENCY=/workspace/server/build/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /jifa/lib
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
[![Eclipse License](https://img.shields.io/github/license/eclipse/jifa?label=License)](https://github.com/eclipse/jifa/blob/main/LICENSE)
![Commit Check](https://github.com/eclipse/jifa/actions/workflows/commit-check.yml/badge.svg?branch=main)

> [中文](https://github.com/eclipse/jifa/blob/main/README_zh.md)
## Introduction

Online Analyzer for Heap Dump, GC Log, Thread Dump and JFR File.
Expand Down
56 changes: 0 additions & 56 deletions README_zh.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
********************************************************************************/
package org.eclipse.jifa.gclog.diagnoser;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.jifa.gclog.event.TimedEvent;
import org.eclipse.jifa.gclog.model.GCModel;
import org.eclipse.jifa.gclog.util.I18nStringView;
Expand All @@ -23,50 +21,105 @@

import static org.eclipse.jifa.gclog.diagnoser.AbnormalType.LAST_TYPE;

@Data
public class AbnormalPoint {
public class AbnormalPoint
{
private AbnormalType type;
private TimedEvent site;
private List<I18nStringView> defaultSuggestions;

public static final AbnormalPoint LEAST_SERIOUS = new AbnormalPoint(LAST_TYPE, null);

public AbnormalPoint(AbnormalType type, TimedEvent site) {
public AbnormalPoint(AbnormalType type, TimedEvent site)
{
this.type = type;
this.site = site;
}

public static final Comparator<AbnormalPoint> compareByImportance = (ab1, ab2) -> {
if (ab1.type != ab2.type) {
public AbnormalType getType()
{
return type;
}

public void setType(AbnormalType type)
{
this.type = type;
}

public TimedEvent getSite()
{
return site;
}

public void setSite(TimedEvent site)
{
this.site = site;
}

public List<I18nStringView> getDefaultSuggestions()
{
return defaultSuggestions;
}

public void setDefaultSuggestions(List<I18nStringView> defaultSuggestions)
{
this.defaultSuggestions = defaultSuggestions;
}

public static final Comparator<AbnormalPoint> compareByImportance = (ab1, ab2) ->
{
if (ab1.type != ab2.type)
{
return ab1.type.getOrdinal() - ab2.type.getOrdinal();
}
return 0;
};

public void generateDefaultSuggestions(GCModel model) {
public void generateDefaultSuggestions(GCModel model)
{
this.defaultSuggestions = new DefaultSuggestionGenerator(model, this).generate();
}

public AbnormalPointVO toVO() {
public AbnormalPointVO toVO()
{
AbnormalPointVO vo = new AbnormalPointVO();
vo.setType(type.getName());
vo.setDefaultSuggestions(defaultSuggestions);
return vo;
}

@Override
public String toString() {
public String toString()
{
return "AbnormalPoint{" +
"type=" + type +
", defaultSuggestions=" + defaultSuggestions +
'}';
}

@Data
@NoArgsConstructor
public static class AbnormalPointVO {
public static class AbnormalPointVO
{
// don't use I18nStringView because frontend need to check this field
private String type;
private List<I18nStringView> defaultSuggestions;

public String getType()
{
return type;
}

public void setType(String type)
{
this.type = type;
}

public List<I18nStringView> getDefaultSuggestions()
{
return defaultSuggestions;
}

public void setDefaultSuggestions(List<I18nStringView> defaultSuggestions)
{
this.defaultSuggestions = defaultSuggestions;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import java.util.HashMap;
import java.util.Map;

public class AbnormalType {
public class AbnormalType
{
public static String I18N_PREFIX = "jifa.gclog.diagnose.abnormal.";
private static Map<String, AbnormalType> name2Type = new HashMap<>();

Expand Down Expand Up @@ -52,34 +53,39 @@ public class AbnormalType {
public static AbnormalType TO_SPACE_EXHAUSTED = new AbnormalType("toSpaceExhausted");
public static AbnormalType LAST_TYPE = new AbnormalType("lastType");


private String name;
private int ordinal;

private AbnormalType(String name) {
private AbnormalType(String name)
{
this.name = name;
ordinal = name2Type.size();
name2Type.put(name, this);
}

public static AbnormalType getType(String name) {
public static AbnormalType getType(String name)
{
return name2Type.getOrDefault(name, null);
}

public String getName() {
public String getName()
{
return name;
}

@Override
public String toString() {
public String toString()
{
return name;
}

public I18nStringView toI18nStringView() {
public I18nStringView toI18nStringView()
{
return new I18nStringView(I18N_PREFIX + name);
}

public int getOrdinal() {
public int getOrdinal()
{
return ordinal;
}
}
Loading

0 comments on commit 7b2cd8d

Please sign in to comment.