Skip to content

Instantly share code, notes, and snippets.

View ftomassetti's full-sized avatar

Federico Tomassetti ftomassetti

View GitHub Profile
@ftomassetti
ftomassetti / replacer.rb
Created July 25, 2015 13:09
Small script to update the comment at the top of all source files
$new_text = """/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2015 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@ftomassetti
ftomassetti / gist:74217a4063da29bf3ced
Last active September 5, 2015 09:42
Performance checks for JavaParser
package com.github.javaparser.ast;
import com.github.javaparser.JavaParser;
import com.github.javaparser.ast.visitor.DumpVisitor;
import java.io.File;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
SOME CODE
@ftomassetti
ftomassetti / FindWhileStatements.java
Created May 27, 2017 09:19
Selecting while statements using a reference as condition
public class FindWhileStatements {
public static void main(String[] args) {
String code = "class A {\n" +
"\tstatic boolean f = true;\n" +
"\tvoid methodFoo() {\n" +
"\t\twhile (f) {\n" +
"\t\t\tmethodFoo();\n" +
"\t\t}\n" +
"\t}\n" +
package me.tomassetti.examples;
import com.github.javaparser.JavaParser;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.ast.stmt.WhileStmt;
import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFacade;
import com.github.javaparser.symbolsolver.model.declarations.ValueDeclaration;
import com.github.javaparser.symbolsolver.model.resolution.SymbolReference;
import com.github.javaparser.symbolsolver.model.resolution.TypeSolver;
package Visitor;
import com.github.javaparser.ast.expr.LambdaExpr;
import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
import com.github.javaparser.symbolsolver.javaparsermodel.JavaParserFacade;
import com.github.javaparser.symbolsolver.model.typesystem.Type;
/**
* Created by ameya on 6/3/17.
*/
https://www.deezer.com/track/68116147
https://www.deezer.com/track/2514677
https://www.deezer.com/track/2514683
https://www.deezer.com/track/2263033
https://www.deezer.com/track/68513563
https://www.deezer.com/track/136332084
https://www.deezer.com/track/88003859
https://www.deezer.com/track/78671026
https://www.deezer.com/track/136334560
https://www.deezer.com/track/121921372